linux-stable/fs/jfs
Dr. David Alan Gilbert ebe060369f jfs: Fix fortify moan in symlink
JFS has in jfs_incore.h:

      /* _inline may overflow into _inline_ea when needed */
      /* _inline_ea may overlay the last part of
       * file._xtroot if maxentry = XTROOTINITSLOT
       */
      union {
        struct {
          /* 128: inline symlink */
          unchar _inline[128];
          /* 128: inline extended attr */
          unchar _inline_ea[128];
        };
        unchar _inline_all[256];

and currently the symlink code copies into _inline;
if this is larger than 128 bytes it triggers a fortify warning of the
form:

  memcpy: detected field-spanning write (size 132) of single field
     "ip->i_link" at fs/jfs/namei.c:950 (size 18446744073709551615)

when it's actually OK.

Copy it into _inline_all instead.

Reported-by: syzbot+5fc38b2ddbbca7f5c680@syzkaller.appspotmail.com
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
2022-10-27 17:16:00 -05:00
..
acl.c vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
file.c attr: port attribute changes to new types 2022-06-26 18:18:56 +02:00
inode.c jfs: stop using the nobh helper 2022-08-02 12:34:04 -04:00
ioctl.c block: add a bdev_discard_granularity helper 2022-04-17 19:49:59 -06:00
jfs_acl.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
jfs_btree.h
jfs_debug.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
jfs_debug.h
jfs_dinode.h jfs: Avoid field-overflowing memcpy() 2021-06-23 09:21:52 -05:00
jfs_discard.c
jfs_discard.h
jfs_dmap.c fs: jfs: fix shift-out-of-bounds in dbAllocAG 2022-10-18 08:49:42 -05:00
jfs_dmap.h jfs: Fix array index bounds check in dbAdjTree 2020-11-13 16:03:07 -06:00
jfs_dtree.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_dtree.h
jfs_extent.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_extent.h jfs: remove unused declarations for jfs 2022-10-18 08:50:26 -05:00
jfs_filsys.h JFS: more checks for invalid superblock 2020-12-18 15:23:33 -06:00
jfs_imap.c jfs: Avoid field-overflowing memcpy() 2021-06-23 09:21:52 -05:00
jfs_imap.h
jfs_incore.h jfs: Avoid field-overflowing memcpy() 2021-06-23 09:21:52 -05:00
jfs_inode.c inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
jfs_inode.h jfs: convert to fileattr 2021-04-12 15:04:29 +02:00
jfs_lock.h
jfs_logmgr.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_logmgr.h jfs: delete duplicated words + other fixes 2020-11-13 13:36:00 -06:00
jfs_metapage.c jfs: Remove check for PageUptodate 2022-06-29 08:51:07 -04:00
jfs_metapage.h
jfs_mount.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_superblock.h
jfs_txnmgr.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_txnmgr.h
jfs_types.h
jfs_umount.c jfs: remove redundant assignments to ipaimap and ipaimap2 2022-10-18 10:41:59 -05:00
jfs_unicode.c
jfs_unicode.h
jfs_uniupr.c
jfs_xattr.h fs/jfs/jfs_xattr.h: Fix spelling typo in comment 2022-10-18 08:50:26 -05:00
jfs_xtree.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_xtree.h jfs: remove unused declarations for jfs 2022-10-18 08:50:26 -05:00
Kconfig docs: fix a couple of new broken references 2019-07-31 14:12:26 -06:00
Makefile fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
namei.c jfs: Fix fortify moan in symlink 2022-10-27 17:16:00 -05:00
resize.c jfs: use sb_bdev_nr_blocks 2021-10-18 14:43:23 -06:00
super.c fs/jfs: replace ternary operator with min_t() 2022-10-18 08:50:26 -05:00
symlink.c
xattr.c acl: handle idmapped mounts 2021-01-24 14:27:17 +01:00