linux-stable/fs/coda
Kees Cook 0467681f09 coda: Avoid partial allocation of sig_inputArgs
[ Upstream commit 48df133578 ]

GCC does not like having a partially allocated object, since it cannot
reason about it for bounds checking when it is passed to other code.
Instead, fully allocate sig_inputArgs. (Alternatively, sig_inputArgs
should be defined as a struct coda_in_hdr, if it is actually not using
any other part of the union.) Seen under GCC 13:

../fs/coda/upcall.c: In function 'coda_upcall':
../fs/coda/upcall.c:801:22: warning: array subscript 'union inputArgs[0]' is partly outside array bounds of 'unsigned char[20]' [-Warray-bounds=]
  801 |         sig_inputArgs->ih.opcode = CODA_SIGNAL;
      |                      ^~

Cc: Jan Harkes <jaharkes@cs.cmu.edu>
Cc: coda@cs.cmu.edu
Cc: codalist@coda.cs.cmu.edu
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230127223921.never.882-kees@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-11 16:43:56 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile coda: remove sysctl object from module when unused 2019-07-16 19:23:23 -07:00
cache.c coda: move internal defs out of include/linux/ [ver #2] 2019-07-16 19:23:23 -07:00
cnode.c coda: ftoc validity check integration 2019-07-16 19:23:23 -07:00
coda_cache.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
coda_fs_i.h coda: add hinting support for partial file caching 2019-07-16 19:23:23 -07:00
coda_int.h coda: remove sysctl object from module when unused 2019-07-16 19:23:23 -07:00
coda_linux.c coda: move internal defs out of include/linux/ [ver #2] 2019-07-16 19:23:23 -07:00
coda_linux.h coda: remove sysctl object from module when unused 2019-07-16 19:23:23 -07:00
coda_psdev.h coda: add hinting support for partial file caching 2019-07-16 19:23:23 -07:00
dir.c coda: ftoc validity check integration 2019-07-16 19:23:23 -07:00
file.c coda: add hinting support for partial file caching 2019-07-16 19:23:23 -07:00
inode.c fs: Fill in max and min timestamps in superblock 2019-08-30 07:27:17 -07:00
pioctl.c kill the last users of user_{path,lpath,path_dir}() 2019-08-30 21:30:13 -04:00
psdev.c coda: add hinting support for partial file caching 2019-07-16 19:23:23 -07:00
symlink.c coda: move internal defs out of include/linux/ [ver #2] 2019-07-16 19:23:23 -07:00
sysctl.c coda: remove sysctl object from module when unused 2019-07-16 19:23:23 -07:00
upcall.c coda: Avoid partial allocation of sig_inputArgs 2023-03-11 16:43:56 +01:00