Bug 216660 - fail-nth: don't fail own copy_to/from_user
Summary: fail-nth: don't fail own copy_to/from_user
Status: NEW
Alias: None
Product: Memory Management
Classification: Unclassified
Component: Sanitizers (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: MM/Sanitizers virtual assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-04 17:34 UTC by Dmitry Vyukov
Modified: 2022-11-04 18:40 UTC (History)
1 user (show)

See Also:
Kernel Version: ALL
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Dmitry Vyukov 2022-11-04 17:34:08 UTC
Since we added failing of copy_to/from_user KCOV may fail own reads/writes:
https://elixir.bootlin.com/linux/v6.1-rc3/source/fs/proc/base.c#L1400
https://elixir.bootlin.com/linux/v6.1-rc3/source/fs/proc/base.c#L1425

Potentially this can worked around in user-space, but this is very inconvenient and needs to be done for all KCOV users. I think we need to not fail them in the kernel.

I think it can be done relatively easily by setting task->fail_nth to 0 for the duration of read/write.

Reported-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/all/Y2RbCUdEY2syxRLW@nvidia.com/

Note You need to log in before you can comment on or make changes to this bug.