]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: fix memcpy fortify errors in CUI log format copying
authorDarrick J. Wong <djwong@kernel.org>
Thu, 20 Oct 2022 23:23:16 +0000 (16:23 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 31 Oct 2022 15:58:19 +0000 (08:58 -0700)
commitf41d2089ae2c98611422ab7c9f1cf11b313c6c26
tree3c84378cd62174dd50c837685f87db246e131b28
parent7274652b61abe3e6374f5ae18149b1c54dc65341
xfs: fix memcpy fortify errors in CUI log format copying

Starting in 6.1, CONFIG_FORTIFY_SOURCE checks the length parameter of
memcpy.  Since we're already fixing problems with BUI item copying, we
should fix it everything else.

Refactor the xfs_cui_copy_format function to handle the copying of the
head and the flex array members separately.  While we're at it, fix a
minor validation deficiency in the recovery function.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/xfs_ondisk.h
fs/xfs/xfs_refcount_item.c