Patch "autofs: use flexible array in ioctl structure" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    autofs: use flexible array in ioctl structure

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     autofs-use-flexible-array-in-ioctl-structure.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From e910c8e3aa02dc456e2f4c32cb479523c326b534 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@xxxxxxxx>
Date: Tue, 23 May 2023 10:19:35 +0200
Subject: autofs: use flexible array in ioctl structure

From: Arnd Bergmann <arnd@xxxxxxxx>

commit e910c8e3aa02dc456e2f4c32cb479523c326b534 upstream.

Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") introduced a warning
for the autofs_dev_ioctl structure:

In function 'check_name',
    inlined from 'validate_dev_ioctl' at fs/autofs/dev-ioctl.c:131:9,
    inlined from '_autofs_dev_ioctl' at fs/autofs/dev-ioctl.c:624:8:
fs/autofs/dev-ioctl.c:33:14: error: 'strchr' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
   33 |         if (!strchr(name, '/'))
      |              ^~~~~~~~~~~~~~~~~
In file included from include/linux/auto_dev-ioctl.h:10,
                 from fs/autofs/autofs_i.h:10,
                 from fs/autofs/dev-ioctl.c:14:
include/uapi/linux/auto_dev-ioctl.h: In function '_autofs_dev_ioctl':
include/uapi/linux/auto_dev-ioctl.h:112:14: note: source object 'path' of size 0
  112 |         char path[0];
      |              ^~~~

This is easily fixed by changing the gnu 0-length array into a c99
flexible array. Since this is a uapi structure, we have to be careful
about possible regressions but this one should be fine as they are
equivalent here. While it would break building with ancient gcc versions
that predate c99, it helps building with --std=c99 and -Wpedantic builds
in user space, as well as non-gnu compilers. This means we probably
also want it fixed in stable kernels.

Cc: stable@xxxxxxxxxxxxxxx
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
Cc: Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20230523081944.581710-1-arnd@xxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 Documentation/filesystems/autofs-mount-control.rst |    2 +-
 Documentation/filesystems/autofs.rst               |    2 +-
 include/uapi/linux/auto_dev-ioctl.h                |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--- a/Documentation/filesystems/autofs-mount-control.rst
+++ b/Documentation/filesystems/autofs-mount-control.rst
@@ -196,7 +196,7 @@ information and return operation results
 		    struct args_ismountpoint	ismountpoint;
 	    };
 
-	    char path[0];
+	    char path[];
     };
 
 The ioctlfd field is a mount point file descriptor of an autofs mount
--- a/Documentation/filesystems/autofs.rst
+++ b/Documentation/filesystems/autofs.rst
@@ -467,7 +467,7 @@ Each ioctl is passed a pointer to an `au
 			struct args_ismountpoint	ismountpoint;
 		};
 
-                char path[0];
+                char path[];
         };
 
 For the **OPEN_MOUNT** and **IS_MOUNTPOINT** commands, the target
--- a/include/uapi/linux/auto_dev-ioctl.h
+++ b/include/uapi/linux/auto_dev-ioctl.h
@@ -109,7 +109,7 @@ struct autofs_dev_ioctl {
 		struct args_ismountpoint	ismountpoint;
 	};
 
-	char path[0];
+	char path[];
 };
 
 static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in)


Patches currently in stable-queue which might be from arnd@xxxxxxxx are

queue-6.4/memstick-r592-make-memstick_debug_get_tpc_name-stati.patch
queue-6.4/arm-ep93xx-fix-missing-prototype-warnings.patch
queue-6.4/crypto-marvell-cesa-fix-type-mismatch-warning.patch
queue-6.4/drm-nouveau-dispnv50-fix-missing-prototypes-warning.patch
queue-6.4/usb-hide-unused-usbfs_notify_suspend-resume-function.patch
queue-6.4/powercap-rapl-fix-config_iosf_mbi-dependency.patch
queue-6.4/fs-pipe-reveal-missing-function-protoypes.patch
queue-6.4/arm-9303-1-kprobes-avoid-missing-declaration-warning.patch
queue-6.4/arm-omap2-fix-missing-tick_broadcast-prototype.patch
queue-6.4/media-tc358746-select-config_generic_phy.patch
queue-6.4/virt-sevguest-add-config_crypto-dependency.patch
queue-6.4/ksmbd-avoid-field-overflow-warning.patch
queue-6.4/media-cec-i2c-ch7322-also-select-regmap.patch
queue-6.4/drm-amd-display-fix-is_timing_changed-prototype.patch
queue-6.4/autofs-use-flexible-array-in-ioctl-structure.patch
queue-6.4/rdma-irdma-avoid-fortify-string-warning-in-irdma_clr.patch
queue-6.4/staging-vchiq_arm-mark-vchiq_platform_init-static.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux