uaccess: fix sparse warning on get/put_user for bitwise types
Status from this message: Applied.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest40 patches 43 repliesApplied
- v116 patches 16 repliesSuperseded
Changes in v2 from the cover letter
- xtensa and powerpc patches have been merged by maintainers, drop them
- added patches to fix put_user on a bunch of architectures
- add acks received since v1
- a bunch of whitespace tweaks
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/40 | x86/uaccess: fix sparse errorsarch/ | +1 | 1 reply | |
| 2/40 | alpha/uaccess: fix sparse errorsarch/ | +2 | 0 replies | |
| 3/40 | arm64/uaccess: fix sparse errorsarch/ | +1 | 4 replies | |
| 4/40 | avr32/uaccess: fix sparse errorsarch/ | +2 | 0 replies | |
| 5/40 | blackfin/uaccess: fix sparse errorsarch/ | +1 | 0 replies | |
| 6/40 | cris/uaccess: fix sparse errorsarch/ | +2 | 1 reply | |
| 7/40 | ia64/uaccess: fix sparse errorsarch/ | +1 | 0 replies | |
| 8/40 | m32r/uaccess: fix sparse errorsarch/ | +2 | 0 replies | |
| 9/40 | metag/uaccess: fix sparse errorsarch/ | +2 | 2 replies | |
| 10/40 | microblaze/uaccess: fix sparse errorsarch/ | +2 | 1 reply | |
| 11/40 | openrisc/uaccess: fix sparse errorsarch/ | +2 | 0 replies | |
| 12/40 | parisc/uaccess: fix sparse errorsarch/ | +1 | 0 replies | |
| 13/40 | sh/uaccess: fix sparse errorsarch/ | +2 | 0 replies | |
| 14/40 | sparc32/uaccess: fix sparse errorsarch/ | +4 | 1 reply | |
| 15/40 | sparc64/uaccess: fix sparse errorsarch/ | +2 | 1 reply | |
| 16/40 | m68k/uaccess: fix sparse errorsarch/ | +20 | 1 reply | |
| 17/40 | arm: fix put_user sparse errorsarch/ | +2 | 0 replies | |
| 18/40 | blackfin: fix put_user sparse errorsarch/ | +4 | 0 replies | |
| 19/40 | ia64: fix put_user sparse errorsarch/ | +5 | 0 replies | |
| 20/40 | metag: fix put_user sparse errorsarch/ | +13 | 1 reply | |
| 21/40 | sh: fix put_user sparse errorsarch/ | +4 | 0 replies | |
| 22/40 | tile: fix put_user sparse errorsarch/ | +1 | 5 replies | |
| 23/40 | tile: enable sparse checks for get/put_userarch/ | +4 | 4 replies | |
| 24/40 | avr32: whitespace fixarch/ | +1 | 1 reply | |
| 25/40 | arch/sparc: uaccess_32 macro whitespace fixesarch/ | +226 | 1 reply | |
| 26/40 | arch/sparc: uaccess_64 macro whitespace fixesarch/ | +142 | 7 replies | |
| 27/40 | blackfin: macro whitespace fixesarch/ | +11 | 0 replies | |
| 28/40 | microblaze: whitespace fixarch/ | +1 | 1 reply | |
| 29/40 | alpha: macro whitespace fixesarch/ | +41 | 0 replies | |
| 30/40 | arm: macro whitespace fixesarch/ | +46 | 0 replies | |
| 31/40 | arm64: macro whitespace fixesarch/ | +1 | 1 reply | |
| 32/40 | avr32: macro whitespace fixesarch/ | +9 | 1 reply | |
| 33/40 | cris: macro whitespace fixesarch/ | +58 | 1 reply | |
| 34/40 | frv: macro whitespace fixesarch/ | +1 | 0 replies | |
| 35/40 | m32r: macro whitespace fixesarch/ | +42 | 0 replies | |
| 36/40 | m68k: macro whitespace fixesarch/ | +1 | 1 reply | |
| 37/40 | parisc: macro whitespace fixesarch/ | +58 | 0 replies | |
| 38/40 | s390: macro whitespace fixesarch/ | +2 | 2 replies | |
| 39/40 | sh: macro whitespace fixesarch/ | +1 | 0 replies | |
| 40/40 | xtensa: macro whitespace fixesarch/ | +45 | 1 reply |
Reviews trailers per patch
17 of 40 patches have a Reviewed-by or Acked-by.
| Patch | Will Deacon | Hans-Christian Egtvedt | Steven Miao | Helge Deller | David S. Miller | Max Filippov | James Hogan | Geert Uytterhoeven | Thomas Gleixner |
|---|---|---|---|---|---|---|---|---|---|
| 1/40 | A-b | ||||||||
| 2/40 | |||||||||
| 3/40 | A-b | ||||||||
| 4/40 | A-b | ||||||||
| 5/40 | A-b | ||||||||
| 6/40 | |||||||||
| 7/40 | |||||||||
| 8/40 | |||||||||
| 9/40 | A-b | ||||||||
| 10/40 | |||||||||
| 11/40 | |||||||||
| 12/40 | A-b | ||||||||
| 13/40 | |||||||||
| 14/40 | A-b | ||||||||
| 15/40 | A-b | ||||||||
| 16/40 | A-b | ||||||||
| 17/40 | |||||||||
| 18/40 | |||||||||
| 19/40 | |||||||||
| 20/40 | A-b | ||||||||
| 21/40 | |||||||||
| 22/40 | |||||||||
| 23/40 | |||||||||
| 24/40 | A-b | ||||||||
| 25/40 | A-b | ||||||||
| 26/40 | A-b | ||||||||
| 27/40 | |||||||||
| 28/40 | |||||||||
| 29/40 | |||||||||
| 30/40 | |||||||||
| 31/40 | A-b | ||||||||
| 32/40 | A-b | ||||||||
| 33/40 | |||||||||
| 34/40 | |||||||||
| 35/40 | |||||||||
| 36/40 | A-b | ||||||||
| 37/40 | |||||||||
| 38/40 | |||||||||
| 39/40 | |||||||||
| 40/40 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 9 reviewers.
Cover letter [PATCH v2 00/40] uaccess: fix sparse warning on get/put_user for bitwise types
changes from v1:
- xtensa and powerpc patches have been merged by maintainers, drop them
- added patches to fix put_user on a bunch of architectures
- add acks received since v1
- a bunch of whitespace tweaks
At the moment, if p and x are both tagged as bitwise types, some of get_user(x, p), put_user(x, p), __get_user(x, p), __put_user(x, p) produce a sparse warning on many architectures.
This is a false positive: *p on these architectures is loaded into long (typically using asm), then cast back to typeof(*p).
When typeof(*p) is a bitwise type (which is uncommon), such a cast needs __force, otherwise sparse produces a warning.
Some architectures already have the __force tag, add it where it's missing.
I verified that adding these __force casts does not supress any useful warnings.
Specifically, vhost wants to read/write bitwise types in userspace memory using get_user/put_user.
At the moment this triggers sparse errors, since the value is passed through an integer.
For example:
__le32 __user *p;
__u32 x;both
put_user(x, p);
and
get_user(x, p);should be safe, but produce warnings on some architectures.
While there, I noticed that a bunch of architectures violated coding style rules within uaccess macros.
Added patches to fix them up.
I tested this on x86 only. Since it's just adding __force, should be trivially safe everywhere?
Arnd, did you merge v1 already? If yes, can you please replace with this version?
Michael S. Tsirkin (40):
x86/uaccess: fix sparse errors
alpha/uaccess: fix sparse errors
arm64/uaccess: fix sparse errors
avr32/uaccess: fix sparse errors
blackfin/uaccess: fix sparse errors
cris/uaccess: fix sparse errors
ia64/uaccess: fix sparse errors
m32r/uaccess: fix sparse errors
metag/uaccess: fix sparse errors
microblaze/uaccess: fix sparse errors
openrisc/uaccess: fix sparse errors
parisc/uaccess: fix sparse errors
sh/uaccess: fix sparse errors
sparc32/uaccess: fix sparse errors
sparc64/uaccess: fix sparse errors
m68k/uaccess: fix sparse errors
arm: fix put_user sparse errors
blackfin: fix put_user sparse errors
ia64: fix put_user sparse errors
metag: fix put_user sparse errors
sh: fix put_user sparse errors
tile: fix put_user sparse errors
tile: enable sparse checks for get/put_user
avr32: whitespace fix
arch/sparc: uaccess_32 macro whitespace fixes
arch/sparc: uaccess_64 macro whitespace fixes
blackfin: macro whitespace fixes
microblaze: whitespace fix
alpha: macro whitespace fixes
arm: macro whitespace fixes
arm64: macro whitespace fixes
avr32: macro whitespace fixes
cris: macro whitespace fixes
frv: macro whitespace fixes
m32r: macro whitespace fixes
m68k: macro whitespace fixes
parisc: macro whitespace fixes
s390: macro whitespace fixes
sh: macro whitespace fixes
xtensa: macro whitespace fixes
arch/alpha/include/asm/uaccess.h | 86 ++++---- arch/arm/include/asm/uaccess.h | 96 ++++----- arch/arm64/include/asm/uaccess.h | 4 +- arch/avr32/include/asm/uaccess.h | 24 +-- arch/blackfin/include/asm/uaccess.h | 32 +-- arch/cris/include/asm/uaccess.h | 117 +++++------ arch/frv/include/asm/segment.h | 2 +- arch/ia64/include/asm/uaccess.h | 11 +- arch/m32r/include/asm/uaccess.h | 88 ++++---- arch/m68k/include/asm/segment.h | 2 +- arch/m68k/include/asm/uaccess_mm.h | 40 ++-- arch/metag/include/asm/uaccess.h | 25 ++- arch/microblaze/include/asm/uaccess.h | 6 +- arch/openrisc/include/asm/uaccess.h | 4 +- arch/parisc/include/asm/uaccess.h | 116 +++++------ arch/s390/include/asm/uaccess.h | 4 +- arch/sh/include/asm/segment.h | 2 +- arch/sh/include/asm/uaccess.h | 4 +- arch/sh/include/asm/uaccess_64.h | 8 +- arch/sparc/include/asm/uaccess_32.h | 364 +++++++++++++++++++++------------- arch/sparc/include/asm/uaccess_64.h | 246 +++++++++++++---------- arch/tile/include/asm/uaccess.h | 6 +- arch/x86/include/asm/uaccess.h | 2 +- arch/xtensa/include/asm/uaccess.h | 90 ++++----- 24 files changed, 759 insertions(+), 620 deletions(-)
Signature · 1 line
MST