linux/fs/overlayfs
Oleksandr Tymoshenko 514b6cca20 ovl: properly handle large files in ovl_security_fileattr
commit 3b6b99ef15 upstream.

dentry_open in ovl_security_fileattr fails for any file
larger than 2GB if open method of the underlying filesystem
calls generic_file_open (e.g. fusefs).

The issue can be reproduce using the following script:
(passthrough_ll is an example app from libfuse).

  $ D=/opt/test/mnt
  $ mkdir -p ${D}/{source,base,top/uppr,top/work,ovlfs}
  $ dd if=/dev/zero of=${D}/source/zero.bin bs=1G count=2
  $ passthrough_ll -o source=${D}/source ${D}/base
  $ mount -t overlay overlay \
      -olowerdir=${D}/base,upperdir=${D}/top/uppr,workdir=${D}/top/work \
      ${D}/ovlfs
  $ chmod 0777 ${D}/mnt/ovlfs/zero.bin

Running this script results in "Value too large for defined data type"
error message from chmod.

Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>
Fixes: 72db82115d ("ovl: copy up sync/noatime fileattr flags")
Cc: stable@vger.kernel.org # v5.15+
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-12-14 19:54:16 +01:00
..
copy_up.c overlayfs: set ctime when setting mtime and atime 2023-10-25 12:03:09 +02:00
dir.c ovl: remove upper umask handling from ovl_create_upper() 2024-06-12 11:03:39 +02:00
export.c ovl: update of dentry revalidate flags after copy up 2023-07-19 16:21:33 +02:00
file.c ovl: fix incorrect fdput() on aio completion 2023-09-23 11:11:10 +02:00
inode.c ovl: properly handle large files in ovl_security_fileattr 2024-12-14 19:54:16 +01:00
Kconfig docs: fix broken references to text files 2020-04-20 15:35:59 -06:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
namei.c ovl: update of dentry revalidate flags after copy up 2023-07-19 16:21:33 +02:00
overlayfs.h ovl: let helper ovl_i_path_real() return the realinode 2023-07-23 13:49:28 +02:00
ovl_entry.h ovl: check type and offset of struct vfsmount in ovl_entry 2023-07-27 08:50:32 +02:00
readdir.c whack-a-mole: constifying struct path * 2022-10-06 17:31:02 -07:00
super.c ima: detect changes to the backing overlay file 2023-11-28 17:07:12 +00:00
util.c ovl: Filter invalid inodes with missing lookup function 2024-12-14 19:54:13 +01:00