lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202408200858.vCxqGpji-lkp@intel.com>
Date: Tue, 20 Aug 2024 08:11:11 +0800
From: kernel test robot <lkp@...el.com>
To: Ingo Molnar <mingo@...nel.org>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: kernel/sched/syscalls.c:979:8: error: unexpected token, expected
 comma

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6e4436539ae182dc86d57d13849862bcafaa4709
commit: 04746ed80bcf3130951ed4d5c1bc5b0bcabdde22 sched/syscalls: Split out kernel/sched/syscalls.c from kernel/sched/core.c
date:   3 months ago
config: mips-randconfig-r111-20240819 (https://download.01.org/0day-ci/archive/20240820/202408200858.vCxqGpji-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 26670e7fa4f032a019d23d56c6a02926e854e8af)
reproduce: (https://download.01.org/0day-ci/archive/20240820/202408200858.vCxqGpji-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408200858.vCxqGpji-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from kernel/sched/build_policy.c:24:
   In file included from include/linux/livepatch.h:13:
   In file included from include/linux/ftrace.h:13:
   In file included from include/linux/kallsyms.h:13:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   In file included from kernel/sched/build_policy.c:55:
>> kernel/sched/syscalls.c:979:8: error: unexpected token, expected comma
     979 |         ret = get_user(size, &uattr->size);
         |               ^
   arch/mips/include/asm/uaccess.h:97:33: note: expanded from macro 'get_user'
      97 |         access_ok(__p, sizeof(*__p)) ? __get_user((x), __p) :           \
         |                                        ^
   arch/mips/include/asm/uaccess.h:183:23: note: expanded from macro '__get_user'
     183 |                 __get_data_asm((x), user_lw, __gu_ptr);                 \
         |                                     ^
   <inline asm>:3:10: note: instantiated into assembly here
       3 |         .set    eva
         |                    ^
   In file included from kernel/sched/build_policy.c:55:
>> kernel/sched/syscalls.c:979:8: error: invalid operand for instruction
     979 |         ret = get_user(size, &uattr->size);
         |               ^
   arch/mips/include/asm/uaccess.h:97:33: note: expanded from macro 'get_user'
      97 |         access_ok(__p, sizeof(*__p)) ? __get_user((x), __p) :           \
         |                                        ^
   arch/mips/include/asm/uaccess.h:183:23: note: expanded from macro '__get_user'
     183 |                 __get_data_asm((x), user_lw, __gu_ptr);                 \
         |                                     ^
   <inline asm>:4:10: note: instantiated into assembly here
       4 |         lwe $2, 0($17)
         |                 ^
   In file included from kernel/sched/build_policy.c:55:
   kernel/sched/syscalls.c:1009:2: error: unexpected token, expected comma
    1009 |         put_user(sizeof(*attr), &uattr->size);
         |         ^
   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
         |                    ^
   In file included from kernel/sched/build_policy.c:55:
   kernel/sched/syscalls.c:1009:2: error: invalid operand for instruction
    1009 |         put_user(sizeof(*attr), &uattr->size);
         |         ^
   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:10: note: instantiated into assembly here
       4 |         swe $2, 0($17)
         |                 ^
   1 warning and 4 errors generated.


vim +979 kernel/sched/syscalls.c

   967	
   968	/*
   969	 * Mimics kernel/events/core.c perf_copy_attr().
   970	 */
   971	static int sched_copy_attr(struct sched_attr __user *uattr, struct sched_attr *attr)
   972	{
   973		u32 size;
   974		int ret;
   975	
   976		/* Zero the full structure, so that a short copy will be nice: */
   977		memset(attr, 0, sizeof(*attr));
   978	
 > 979		ret = get_user(size, &uattr->size);
   980		if (ret)
   981			return ret;
   982	
   983		/* ABI compatibility quirk: */
   984		if (!size)
   985			size = SCHED_ATTR_SIZE_VER0;
   986		if (size < SCHED_ATTR_SIZE_VER0 || size > PAGE_SIZE)
   987			goto err_size;
   988	
   989		ret = copy_struct_from_user(attr, sizeof(*attr), uattr, size);
   990		if (ret) {
   991			if (ret == -E2BIG)
   992				goto err_size;
   993			return ret;
   994		}
   995	
   996		if ((attr->sched_flags & SCHED_FLAG_UTIL_CLAMP) &&
   997		    size < SCHED_ATTR_SIZE_VER1)
   998			return -EINVAL;
   999	
  1000		/*
  1001		 * XXX: Do we want to be lenient like existing syscalls; or do we want
  1002		 * to be strict and return an error on out-of-bounds values?
  1003		 */
  1004		attr->sched_nice = clamp(attr->sched_nice, MIN_NICE, MAX_NICE);
  1005	
  1006		return 0;
  1007	
  1008	err_size:
  1009		put_user(sizeof(*attr), &uattr->size);
  1010		return -E2BIG;
  1011	}
  1012	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ