fs/namespace.c:5026:1: warning: the frame size of 1040 bytes is larger than 1024 bytes

From: kernel test robot
Date: Tue Jan 23 2024 - 04:37:38 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7ed2632ec7d72e926b9e8bcc9ad1bb0cd37274bf
commit: 35e27a5744131996061e6e323f1bcb4c827ae867 fs: keep struct mnt_id_req extensible
date: 6 weeks ago
config: x86_64-dcg_x86_64_defconfig-func (https://download.01.org/0day-ci/archive/20240123/202401231743.amoJ86dc-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240123/202401231743.amoJ86dc-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401231743.amoJ86dc-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

fs/namespace.c: In function '__do_sys_statmount':
>> fs/namespace.c:5026:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]
5026 | }
| ^


vim +5026 fs/namespace.c

35e27a57441319 Christian Brauner 2023-11-29 4982
46eae99ef73302 Miklos Szeredi 2023-10-25 4983 SYSCALL_DEFINE4(statmount, const struct mnt_id_req __user *, req,
46eae99ef73302 Miklos Szeredi 2023-10-25 4984 struct statmount __user *, buf, size_t, bufsize,
46eae99ef73302 Miklos Szeredi 2023-10-25 4985 unsigned int, flags)
46eae99ef73302 Miklos Szeredi 2023-10-25 4986 {
46eae99ef73302 Miklos Szeredi 2023-10-25 4987 struct vfsmount *mnt;
46eae99ef73302 Miklos Szeredi 2023-10-25 4988 struct mnt_id_req kreq;
68385d77c05b40 Christian Brauner 2023-11-19 4989 struct kstatmount ks;
68385d77c05b40 Christian Brauner 2023-11-19 4990 /* We currently support retrieval of 3 strings. */
68385d77c05b40 Christian Brauner 2023-11-19 4991 size_t seq_size = 3 * PATH_MAX;
46eae99ef73302 Miklos Szeredi 2023-10-25 4992 int ret;
46eae99ef73302 Miklos Szeredi 2023-10-25 4993
46eae99ef73302 Miklos Szeredi 2023-10-25 4994 if (flags)
46eae99ef73302 Miklos Szeredi 2023-10-25 4995 return -EINVAL;
46eae99ef73302 Miklos Szeredi 2023-10-25 4996
35e27a57441319 Christian Brauner 2023-11-29 4997 ret = copy_mnt_id_req(req, &kreq);
35e27a57441319 Christian Brauner 2023-11-29 4998 if (ret)
35e27a57441319 Christian Brauner 2023-11-29 4999 return ret;
46eae99ef73302 Miklos Szeredi 2023-10-25 5000
68385d77c05b40 Christian Brauner 2023-11-19 5001 retry:
68385d77c05b40 Christian Brauner 2023-11-19 5002 ret = prepare_kstatmount(&ks, &kreq, buf, bufsize, seq_size);
68385d77c05b40 Christian Brauner 2023-11-19 5003 if (ret)
68385d77c05b40 Christian Brauner 2023-11-19 5004 return ret;
68385d77c05b40 Christian Brauner 2023-11-19 5005
46eae99ef73302 Miklos Szeredi 2023-10-25 5006 down_read(&namespace_sem);
46eae99ef73302 Miklos Szeredi 2023-10-25 5007 mnt = lookup_mnt_in_ns(kreq.mnt_id, current->nsproxy->mnt_ns);
68385d77c05b40 Christian Brauner 2023-11-19 5008 if (!mnt) {
68385d77c05b40 Christian Brauner 2023-11-19 5009 up_read(&namespace_sem);
68385d77c05b40 Christian Brauner 2023-11-19 5010 kvfree(ks.seq.buf);
68385d77c05b40 Christian Brauner 2023-11-19 5011 return -ENOENT;
46eae99ef73302 Miklos Szeredi 2023-10-25 5012 }
68385d77c05b40 Christian Brauner 2023-11-19 5013
68385d77c05b40 Christian Brauner 2023-11-19 5014 ks.mnt = mnt;
68385d77c05b40 Christian Brauner 2023-11-19 5015 get_fs_root(current->fs, &ks.root);
68385d77c05b40 Christian Brauner 2023-11-19 5016 ret = do_statmount(&ks);
68385d77c05b40 Christian Brauner 2023-11-19 5017 path_put(&ks.root);
46eae99ef73302 Miklos Szeredi 2023-10-25 5018 up_read(&namespace_sem);
46eae99ef73302 Miklos Szeredi 2023-10-25 5019
68385d77c05b40 Christian Brauner 2023-11-19 5020 if (!ret)
68385d77c05b40 Christian Brauner 2023-11-19 5021 ret = copy_statmount_to_user(&ks);
68385d77c05b40 Christian Brauner 2023-11-19 5022 kvfree(ks.seq.buf);
68385d77c05b40 Christian Brauner 2023-11-19 5023 if (retry_statmount(ret, &seq_size))
68385d77c05b40 Christian Brauner 2023-11-19 5024 goto retry;
46eae99ef73302 Miklos Szeredi 2023-10-25 5025 return ret;
46eae99ef73302 Miklos Szeredi 2023-10-25 @5026 }
46eae99ef73302 Miklos Szeredi 2023-10-25 5027

:::::: The code at line 5026 was first introduced by commit
:::::: 46eae99ef73302f9fb3dddcd67c374b3dffe8fd6 add statmount(2) syscall

:::::: TO: Miklos Szeredi <mszeredi@xxxxxxxxxx>
:::::: CC: Christian Brauner <brauner@xxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki