public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christian Brauner <brauner@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Jeff Layton <jlayton@kernel.org>,
	Amir Goldstein <amir73il@gmail.com>, Jan Kara <jack@suse.cz>
Subject: fs/pidfs.c:279:10: error: unexpected token, expected comma
Date: Thu, 10 Apr 2025 10:57:55 +0800	[thread overview]
Message-ID: <202504101318.oSgjogsQ-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3b07108ada81a8ebcebf1fe61367b4e436c895bd
commit: 230536ff6b06b199995687aa7fbf164970ebda85 pidfs: support FS_IOC_GETVERSION
date:   4 months ago
config: mips-randconfig-r064-20250408 (https://download.01.org/0day-ci/archive/20250410/202504101318.oSgjogsQ-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 92c93f5286b9ff33f27ff694d2dc33da1c07afdd)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250410/202504101318.oSgjogsQ-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504101318.oSgjogsQ-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from fs/pidfs.c:10:
   In file included from include/linux/pid_namespace.h:7:
   In file included from include/linux/mm.h:2223:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> fs/pidfs.c:279:10: error: unexpected token, expected comma
     279 |                 return put_user(file_inode(file)->i_generation, argp);
         |                        ^
   arch/mips/include/asm/uaccess.h:71:33: note: expanded from macro 'put_user'
      71 |         access_ok(__p, sizeof(*__p)) ? __put_user((x), __p) : -EFAULT;  \
         |                                        ^
   arch/mips/include/asm/uaccess.h:136:18: note: expanded from macro '__put_user'
     136 |                 __put_data_asm(user_sw, __pu_ptr);                      \
         |                                ^
   <inline asm>:3:10: note: instantiated into assembly here
       3 |         .set    eva
         |                    ^
   fs/pidfs.c:279:10: error: instruction requires a CPU feature not currently enabled
     279 |                 return put_user(file_inode(file)->i_generation, argp);
         |                        ^
   arch/mips/include/asm/uaccess.h:71:33: note: expanded from macro 'put_user'
      71 |         access_ok(__p, sizeof(*__p)) ? __put_user((x), __p) : -EFAULT;  \
         |                                        ^
   arch/mips/include/asm/uaccess.h:136:18: note: expanded from macro '__put_user'
     136 |                 __put_data_asm(user_sw, __pu_ptr);                      \
         |                                ^
   <inline asm>:4:2: note: instantiated into assembly here
       4 |         swe $3, 0($17)
         |         ^
   1 warning and 2 errors generated.


vim +279 fs/pidfs.c

   265	
   266	static long pidfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
   267	{
   268		struct task_struct *task __free(put_task) = NULL;
   269		struct nsproxy *nsp __free(put_nsproxy) = NULL;
   270		struct pid *pid = pidfd_pid(file);
   271		struct ns_common *ns_common = NULL;
   272		struct pid_namespace *pid_ns;
   273	
   274		if (cmd == FS_IOC_GETVERSION) {
   275			if (!arg)
   276				return -EINVAL;
   277	
   278			__u32 __user *argp = (__u32 __user *)arg;
 > 279			return put_user(file_inode(file)->i_generation, argp);
   280		}
   281	
   282		task = get_pid_task(pid, PIDTYPE_PID);
   283		if (!task)
   284			return -ESRCH;
   285	
   286		/* Extensible IOCTL that does not open namespace FDs, take a shortcut */
   287		if (_IOC_NR(cmd) == _IOC_NR(PIDFD_GET_INFO))
   288			return pidfd_info(task, cmd, arg);
   289	
   290		if (arg)
   291			return -EINVAL;
   292	
   293		scoped_guard(task_lock, task) {
   294			nsp = task->nsproxy;
   295			if (nsp)
   296				get_nsproxy(nsp);
   297		}
   298		if (!nsp)
   299			return -ESRCH; /* just pretend it didn't exist */
   300	
   301		/*
   302		 * We're trying to open a file descriptor to the namespace so perform a
   303		 * filesystem cred ptrace check. Also, we mirror nsfs behavior.
   304		 */
   305		if (!ptrace_may_access(task, PTRACE_MODE_READ_FSCREDS))
   306			return -EACCES;
   307	
   308		switch (cmd) {
   309		/* Namespaces that hang of nsproxy. */
   310		case PIDFD_GET_CGROUP_NAMESPACE:
   311			if (IS_ENABLED(CONFIG_CGROUPS)) {
   312				get_cgroup_ns(nsp->cgroup_ns);
   313				ns_common = to_ns_common(nsp->cgroup_ns);
   314			}
   315			break;
   316		case PIDFD_GET_IPC_NAMESPACE:
   317			if (IS_ENABLED(CONFIG_IPC_NS)) {
   318				get_ipc_ns(nsp->ipc_ns);
   319				ns_common = to_ns_common(nsp->ipc_ns);
   320			}
   321			break;
   322		case PIDFD_GET_MNT_NAMESPACE:
   323			get_mnt_ns(nsp->mnt_ns);
   324			ns_common = to_ns_common(nsp->mnt_ns);
   325			break;
   326		case PIDFD_GET_NET_NAMESPACE:
   327			if (IS_ENABLED(CONFIG_NET_NS)) {
   328				ns_common = to_ns_common(nsp->net_ns);
   329				get_net_ns(ns_common);
   330			}
   331			break;
   332		case PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE:
   333			if (IS_ENABLED(CONFIG_PID_NS)) {
   334				get_pid_ns(nsp->pid_ns_for_children);
   335				ns_common = to_ns_common(nsp->pid_ns_for_children);
   336			}
   337			break;
   338		case PIDFD_GET_TIME_NAMESPACE:
   339			if (IS_ENABLED(CONFIG_TIME_NS)) {
   340				get_time_ns(nsp->time_ns);
   341				ns_common = to_ns_common(nsp->time_ns);
   342			}
   343			break;
   344		case PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE:
   345			if (IS_ENABLED(CONFIG_TIME_NS)) {
   346				get_time_ns(nsp->time_ns_for_children);
   347				ns_common = to_ns_common(nsp->time_ns_for_children);
   348			}
   349			break;
   350		case PIDFD_GET_UTS_NAMESPACE:
   351			if (IS_ENABLED(CONFIG_UTS_NS)) {
   352				get_uts_ns(nsp->uts_ns);
   353				ns_common = to_ns_common(nsp->uts_ns);
   354			}
   355			break;
   356		/* Namespaces that don't hang of nsproxy. */
   357		case PIDFD_GET_USER_NAMESPACE:
   358			if (IS_ENABLED(CONFIG_USER_NS)) {
   359				rcu_read_lock();
   360				ns_common = to_ns_common(get_user_ns(task_cred_xxx(task, user_ns)));
   361				rcu_read_unlock();
   362			}
   363			break;
   364		case PIDFD_GET_PID_NAMESPACE:
   365			if (IS_ENABLED(CONFIG_PID_NS)) {
   366				rcu_read_lock();
   367				pid_ns = task_active_pid_ns(task);
   368				if (pid_ns)
   369					ns_common = to_ns_common(get_pid_ns(pid_ns));
   370				rcu_read_unlock();
   371			}
   372			break;
   373		default:
   374			return -ENOIOCTLCMD;
   375		}
   376	
   377		if (!ns_common)
   378			return -EOPNOTSUPP;
   379	
   380		/* open_namespace() unconditionally consumes the reference */
   381		return open_namespace(ns_common);
   382	}
   383	

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

             reply	other threads:[~2025-04-10  2:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10  2:57 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-12-31 22:47 fs/pidfs.c:279:10: error: unexpected token, expected comma kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202504101318.oSgjogsQ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox