]> git.baikalelectronics.ru Git - kernel.git/commit
Merge tag 'make-attr-fork-permanent-5.20_2022-07-14' of git://git.kernel.org/pub...
authorDarrick J. Wong <djwong@kernel.org>
Thu, 14 Jul 2022 16:46:37 +0000 (09:46 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 14 Jul 2022 16:46:37 +0000 (09:46 -0700)
commitdb0f7570fe4d16134cea41cc240243addb917496
treeb6f9cb11f2326d65d2d789bfc448b0cd3ca2cd8a
parent632e611ccf3d726e6de907494eb67fe2926e182a
parentd738b77ac66fe81fcf336f913fddfb51520000d3
Merge tag 'make-attr-fork-permanent-5.20_2022-07-14' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-5.20-mergeB

xfs: make attr forks permanent

This series fixes a use-after-free bug that syzbot uncovered.  The UAF
itself is a result of a race condition between getxattr and removexattr
because callers to getxattr do not necessarily take any sort of locks
before calling into the filesystem.

Although the race condition itself can be fixed through clever use of a
memory barrier, further consideration of the use cases of extended
attributes shows that most files always have at least one attribute, so
we might as well make them permanent.

v2: Minor tweaks suggested by Dave, and convert some more macros to
helper functions.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
* tag 'make-attr-fork-permanent-5.20_2022-07-14' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
  xfs: replace inode fork size macros with functions
  xfs: replace XFS_IFORK_Q with a proper predicate function
  xfs: use XFS_IFORK_Q to determine the presence of an xattr fork
  xfs: make inode attribute forks a permanent part of struct xfs_inode
  xfs: convert XFS_IFORK_PTR to a static inline helper
fs/xfs/libxfs/xfs_inode_buf.c
fs/xfs/xfs_icache.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_qm.c
fs/xfs/xfs_trace.h