uaccess: Updates to scoped_user_access()
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 7 repliesIn review
- v15 patches 0 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | uaccess: Fix scoped_user_read_access() for 'pointer to const'include/ | +20 | 3 replies | |
| 2/5 | compiler.h: Add generic support for 'autoterminating nested for() loops'include/ | +26 | 0 replies | |
| 3/5 | uaccess.h: Use with() and and_with() in __scoped_user_access()include/ | +4 | 0 replies | |
| 4/5 | uaccess: Disable -Wshadow in __scoped_user_access()include/ | +3 | 3 replies | |
| 5/5 | signal: Use scoped_user_access() instead of __put/get_user()kernel/ | +42 | 1 reply |
Reviews trailers per patch
1 of 5 patches has a Reviewed-by or Acked-by.
| Patch | Christophe Leroy (CS GROUP) |
|---|---|
| 1/5 | R-b T-b |
| 2/5 | |
| 3/5 | |
| 4/5 | |
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/5] uaccess: Updates to scoped_user_access()
From: David Laight <[email protected]>
Converting kernel/signal.c to use scoped_user_access() had compilation warnings because some of the pointers are 'pointer to const'. This is fixed in patch 1.
The same problem has been found compiling arch/powerpc/lib/checksum_wrappers.c
For v2 I've changed the code to use 'auto' and replaced the over-complex CLASS definition (and its for loop) with a much simpler __cleanup() function on the second loop.
Patches 2 and 3 factor out the 'autoterminating nested for loops'. I'm sure there'll be a 'bikeshed' discussion about the names.
Patch 4 stops warnings from -Wshadow (enabled by W=2). I did think about making the _diag_xxx conditional on a W=2 build, but since the pre-processor just emits #pragma lines and they are smaller that the for() loop it doesn't seem worth while.
Patch 5 is the change to signal.c that prompted patch 1. The generated code looks fine, but I've not tested it. Most of the changes are to 'compat' code - so are probably not usually performance critical.
IIRC the non-compat code uses copy_to/from_user() for the structures so is probably slower than the compat code's member by member copy.
David Laight (5):
uaccess: Fix scoped_user_read_access() for 'pointer to const' compiler.h: Add generic support for 'autoterminating nested for()
loops'
uaccess.h: Use with() and and_with() in __scoped_user_access()
uaccess: Disable -Wshadow in __scoped_user_access()
signal: Use scoped_user_access() instead of __put/get_user()
include/linux/compiler.h | 26 +++++++++++++++ include/linux/uaccess.h | 51 ++++++++++------------------ kernel/signal.c | 72 +++++++++++++++++++++++----------------- 3 files changed, 86 insertions(+), 63 deletions(-)
Signature · 1 line
2.39.5