linux-stable/fs/coda
Kees Cook 7d10fc49d8 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-10 09:33:52 +01:00
..
Kconfig
Makefile
cache.c
cnode.c coda: avoid doing bad things on inode type changes during revalidation 2021-11-09 10:02:51 -08:00
coda_cache.h
coda_fs_i.h
coda_int.h
coda_linux.c coda: avoid doing bad things on inode type changes during revalidation 2021-11-09 10:02:51 -08:00
coda_linux.h coda: avoid doing bad things on inode type changes during revalidation 2021-11-09 10:02:51 -08:00
coda_psdev.h
dir.c coda: avoid hidden code duplication in rename 2021-11-09 10:02:51 -08:00
file.c fs: Move many prototypes to pagemap.h 2022-03-21 12:59:02 -04:00
inode.c fs: allocate inode by using alloc_inode_sb() 2022-03-22 15:57:03 -07:00
pioctl.c
psdev.c coda: bump module version to 7.2 2021-11-09 10:02:51 -08:00
symlink.c coda: Convert coda_symlink_filler() to use a folio 2022-08-02 12:34:03 -04:00
sysctl.c
upcall.c coda: Avoid partial allocation of sig_inputArgs 2023-03-10 09:33:52 +01:00