On 10-02-2023 09:16, Kevin Brodsky wrote:
Hi,
Following up on Luca's series addressing ioctl-related GCC warnings, this series takes care of the remaining warnings reported by GCC (but not Clang). The patches are all straightforward, except patch 13 (see below).
Some notes:
Patch 1-3 fix up small oversights in our own commits (see Fixes: tags).
Patch 9-10 are about creating user pointers in cases where it is unavoidable, such cases are not concerning.
Patch 11-12 and 14-18 are about creating user pointers because of uapi deficiencies (i.e. user pointers represented as __u64 in structs). They should therefore be viewed as a stopgap while waiting for a full solution (uapi change and compat handling); this is tracked by the following tickets:
- Patch 11: https://git.morello-project.org/morello/kernel/linux/-/issues/48
- Patch 12: https://git.morello-project.org/morello/kernel/linux/-/issues/47
- Patch 14: https://git.morello-project.org/morello/kernel/linux/-/issues/46
- Patch 15: https://git.morello-project.org/morello/kernel/linux/-/issues/50
- Patch 16: https://git.morello-project.org/morello/kernel/linux/-/issues/51
- Patch 17-18: https://git.morello-project.org/morello/kernel/linux/-/issues/52
Patch 13 is upstreamable and is written in that spirit. Fixing up the msg_control/msg_control_user split required grepping all uses, as only a few misuses actually lead to warnings in PCuABI. Note that as an exceptional bending of the rules, this patch introduces a warning (both with Clang and GCC), which is impossible to avoid in a patch for upstream. The next patch (14) fixes the warnings so it should not be an issue in practice.
Well done for this, happy to see our team has opportunities to upstream!
With these patches and Luca's, only a handful of genuine GCC warnings are left:
- A few in fs/aio.c, tracked by https://git.morello-project.org/morello/kernel/linux/-/issues/49
- A few under kernel/bpf/, should be addressed by https://git.morello-project.org/morello/kernel/linux/-/issues/4
Other warnings are Morello GCC defects and have been reported.
One minor question in Patch 1, otherwise, everything looks good to me!
Thanks, Tudor
Thanks, Kevin
Kevin Brodsky (18): arm64: signal: Avoid unnecessary capability arithmetic drivers/android/binder: Cast to (void *) when printing %p drivers/android/binder: Cast user_uintptr_t arg when printing math.h: Make round_{up,down} capability-friendly asm-generic/cacheflush.h: Use appropriate user pointer conversion kernel: signal: Use appropriate user pointer conversion perf/core: Use appropriate user pointer conversion compat: Fix shift warning in compat64 audit: Explicitly create user pointer coredump: Explicitly create user pointer kernel/futex: Explicitly create user pointer rseq: Explicitly create user pointers net: Finish up ->msg_control{,_user} split tcp: Explicitly create user pointers Input: evdev: Explicitly create user pointers mmc: block: Explicitly create user pointers drm: Explicitly create user pointers drm/panfrost: Explicitly create user pointers
arch/arm64/kernel/signal.c | 6 +++-- drivers/android/binder.c | 4 ++-- drivers/android/binder_alloc.c | 25 +++++++++++---------- drivers/gpu/drm/drm_atomic_uapi.c | 8 +++---- drivers/gpu/drm/drm_color_mgmt.c | 12 +++++----- drivers/gpu/drm/drm_connector.c | 8 +++---- drivers/gpu/drm/drm_crtc.c | 2 +- drivers/gpu/drm/drm_framebuffer.c | 2 +- drivers/gpu/drm/drm_lease.c | 4 ++-- drivers/gpu/drm/drm_mode_object.c | 4 ++-- drivers/gpu/drm/drm_plane.c | 2 +- drivers/gpu/drm/panfrost/panfrost_drv.c | 4 ++-- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 2 +- drivers/input/evdev.c | 4 ++-- drivers/mmc/core/block.c | 6 ++--- fs/coredump.c | 2 +- include/asm-generic/cacheflush.h | 6 ++--- include/linux/math.h | 5 +++++ kernel/auditsc.c | 2 +- kernel/compat.c | 4 ++-- kernel/events/core.c | 2 +- kernel/futex/waitwake.c | 2 +- kernel/rseq.c | 4 ++-- kernel/signal.c | 2 +- net/compat.c | 13 ++++++----- net/core/scm.c | 9 +++++--- net/ipv4/tcp.c | 8 +++---- 27 files changed, 82 insertions(+), 70 deletions(-)