fs/namespace.c:4149 __do_sys_fsmount() error: uninitialized symbol 'ret'.
PATCH 5/7 fs/namespace.c:4149 __do_sys_fsmount() error: uninitialized symbol 'ret'.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.open_tree head: 6d2ad41f48768f325a552666b71724bc40ba52c3 commit: 5612eb55c0193003973838c198268730bd4682ce [5/7] fs: add open_tree() context config: hexagon-randconfig-r071-20240606 (https://download.01.org/0day-ci/archive/20240607/[email protected]/config) compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project d7d2d4f53fc79b4b58e8d8d08151b577c3699d4a)
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 <[email protected]> | Reported-by: Dan Carpenter <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/
New smatch warnings:fs/namespace.c:4149 __do_sys_fsmount() error: uninitialized symbol 'ret'.
vim +/ret +4149 fs/namespace.c
5612eb55c019300 Christian Brauner 2024-05-31 4098 SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
5612eb55c019300 Christian Brauner 2024-05-31 4099 unsigned int, attr_flags)
5612eb55c019300 Christian Brauner 2024-05-31 4100 {
5612eb55c019300 Christian Brauner 2024-05-31 4101 struct fs_context *fc;
5612eb55c019300 Christian Brauner 2024-05-31 4102 unsigned int mnt_flags = 0;
5612eb55c019300 Christian Brauner 2024-05-31 4103 long ret;
5612eb55c019300 Christian Brauner 2024-05-31 4104
5612eb55c019300 Christian Brauner 2024-05-31 4105 if (!may_mount())
5612eb55c019300 Christian Brauner 2024-05-31 4106 return -EPERM;
5612eb55c019300 Christian Brauner 2024-05-31 4107
5612eb55c019300 Christian Brauner 2024-05-31 4108 if ((flags & ~(FSMOUNT_CLOEXEC)) != 0)
5612eb55c019300 Christian Brauner 2024-05-31 4109 return -EINVAL;
5612eb55c019300 Christian Brauner 2024-05-31 4110
5612eb55c019300 Christian Brauner 2024-05-31 4111 if (attr_flags & ~FSMOUNT_VALID_FLAGS)
5612eb55c019300 Christian Brauner 2024-05-31 4112 return -EINVAL;
5612eb55c019300 Christian Brauner 2024-05-31 4113
5612eb55c019300 Christian Brauner 2024-05-31 4114 mnt_flags = attr_flags_to_mnt_flags(attr_flags);
5612eb55c019300 Christian Brauner 2024-05-31 4115
5612eb55c019300 Christian Brauner 2024-05-31 4116 switch (attr_flags & MOUNT_ATTR__ATIME) {
5612eb55c019300 Christian Brauner 2024-05-31 4117 case MOUNT_ATTR_STRICTATIME:
5612eb55c019300 Christian Brauner 2024-05-31 4118 break;
5612eb55c019300 Christian Brauner 2024-05-31 4119 case MOUNT_ATTR_NOATIME:
5612eb55c019300 Christian Brauner 2024-05-31 4120 mnt_flags |= MNT_NOATIME;
5612eb55c019300 Christian Brauner 2024-05-31 4121 break;
5612eb55c019300 Christian Brauner 2024-05-31 4122 case MOUNT_ATTR_RELATIME:
5612eb55c019300 Christian Brauner 2024-05-31 4123 mnt_flags |= MNT_RELATIME;
5612eb55c019300 Christian Brauner 2024-05-31 4124 break;
5612eb55c019300 Christian Brauner 2024-05-31 4125 default:
5612eb55c019300 Christian Brauner 2024-05-31 4126 return -EINVAL;
5612eb55c019300 Christian Brauner 2024-05-31 4127 }
5612eb55c019300 Christian Brauner 2024-05-31 4128
5612eb55c019300 Christian Brauner 2024-05-31 4129 CLASS(fd, f)(fs_fd);
5612eb55c019300 Christian Brauner 2024-05-31 4130 if (!f.file)
5612eb55c019300 Christian Brauner 2024-05-31 4131 return -EBADF;
5612eb55c019300 Christian Brauner 2024-05-31 4132
5612eb55c019300 Christian Brauner 2024-05-31 4133 if (!(f.file->f_op->fop_flags & FOP_FS_CONTEXT_OPS))
5612eb55c019300 Christian Brauner 2024-05-31 4134 return -EINVAL;
5612eb55c019300 Christian Brauner 2024-05-31 4135
5612eb55c019300 Christian Brauner 2024-05-31 4136 if ((f.file->f_op == &mount_context_ops) && attr_flags)
5612eb55c019300 Christian Brauner 2024-05-31 4137 return -EINVAL;
5612eb55c019300 Christian Brauner 2024-05-31 4138
5612eb55c019300 Christian Brauner 2024-05-31 4139 fc = f.file->private_data;
5612eb55c019300 Christian Brauner 2024-05-31 4140 scoped_cond_guard(mutex_intr, return -EINTR, &fc->uapi_mutex) {
5612eb55c019300 Christian Brauner 2024-05-31 4141 if (fc->phase != FS_CONTEXT_AWAITING_MOUNT)
5612eb55c019300 Christian Brauner 2024-05-31 4142 return -EBUSY;
5612eb55c019300 Christian Brauner 2024-05-31 4143 if (f.file->f_op == &fscontext_fops)
5612eb55c019300 Christian Brauner 2024-05-31 4144 ret = fsmount_fscontext(fc, flags, mnt_flags);
5612eb55c019300 Christian Brauner 2024-05-31 4145 else if (f.file->f_op == &mount_context_ops)
5612eb55c019300 Christian Brauner 2024-05-31 4146 ret = fsmount_mount_context(fc, flags);ret not initliazed on else path.
5612eb55c019300 Christian Brauner 2024-05-31 4147 }5612eb55c019300 Christian Brauner 2024-05-31 4148
93766fbd2696c2c David Howells 2018-11-01 @4149 return ret; 93766fbd2696c2c David Howells 2018-11-01 4150 }
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki