tree:
https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.15
head: b4852fbf90916fdc2f1e0e282e100f7e0e889d77
commit: aabdf8c83677b5a7a86f9501b98ba5c7fa290648 [976/2818] CHROMIUM: alt-syscall: Make
required syscalls available for use
config:
arm-chromiumos-arm-customedconfig-chrome-os:chromeos-5.15:b4852fbf90916fdc2f1e0e282e100f7e0e889d77
(
https://download.01.org/0day-ci/archive/20211212/202112120809.hAd2Uwqx-lk...)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add chrome-os
https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.15
git checkout aabdf8c83677b5a7a86f9501b98ba5c7fa290648
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir
ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> kernel/sys.c:203:5: error: no previous prototype for
'ksys_setpriority' [-Werror=missing-prototypes]
203 | int
ksys_setpriority(int which, int who, int niceval)
| ^~~~~~~~~~~~~~~~
> kernel/sys.c:278:5: error: no previous prototype for
'ksys_getpriority' [-Werror=missing-prototypes]
278 | int
ksys_getpriority(int which, int who)
| ^~~~~~~~~~~~~~~~
> kernel/sys.c:2274:5: error: no previous prototype for
'ksys_prctl' [-Werror=missing-prototypes]
2274 | int ksys_prctl(int
option, unsigned long arg2, unsigned long arg3,
| ^~~~~~~~~~
> kernel/sys.c:2556:5: error: no previous prototype for
'ksys_getcpu' [-Werror=missing-prototypes]
2556 | int
ksys_getcpu(unsigned __user *cpup, unsigned __user *nodep,
| ^~~~~~~~~~~
cc1: all warnings being treated as errors
--
> kernel/time/time.c:354:5: error: no previous prototype for
'ksys_adjtimex_time32' [-Werror=missing-prototypes]
354 | int
ksys_adjtimex_time32(struct old_timex32 __user * utp)
| ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
> kernel/time/posix-timers.c:1112:5: error: no previous prototype
for 'ksys_clock_adjtime' [-Werror=missing-prototypes]
1112 | int
ksys_clock_adjtime(const clockid_t which_clock,
| ^~~~~~~~~~~~~~~~~~
> kernel/time/posix-timers.c:1188:5: error: no previous prototype
for 'ksys_clock_adjtime32' [-Werror=missing-prototypes]
1188 | int
ksys_clock_adjtime32(clockid_t which_clock, struct old_timex32 __user * utp)
| ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
> kernel/events/core.c:11987:5: error: no previous prototype for
'ksys_perf_event_open' [-Werror=missing-prototypes]
11987 | int
ksys_perf_event_open(struct perf_event_attr __user * attr_uptr, pid_t pid,
| ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/ksys_setpriority +203 kernel/sys.c
202
203 int ksys_setpriority(int which, int who, int niceval)
204 {
205 struct task_struct *g, *p;
206 struct user_struct *user;
207 const struct cred *cred = current_cred();
208 int error = -EINVAL;
209 struct pid *pgrp;
210 kuid_t uid;
211
212 if (which > PRIO_USER || which < PRIO_PROCESS)
213 goto out;
214
215 /* normalize: avoid signed division (rounding problems) */
216 error = -ESRCH;
217 if (niceval < MIN_NICE)
218 niceval = MIN_NICE;
219 if (niceval > MAX_NICE)
220 niceval = MAX_NICE;
221
222 rcu_read_lock();
223 read_lock(&tasklist_lock);
224 switch (which) {
225 case PRIO_PROCESS:
226 if (who)
227 p = find_task_by_vpid(who);
228 else
229 p = current;
230 if (p)
231 error = set_one_prio(p, niceval, error);
232 break;
233 case PRIO_PGRP:
234 if (who)
235 pgrp = find_vpid(who);
236 else
237 pgrp = task_pgrp(current);
238 do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
239 error = set_one_prio(p, niceval, error);
240 } while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
241 break;
242 case PRIO_USER:
243 uid = make_kuid(cred->user_ns, who);
244 user = cred->user;
245 if (!who)
246 uid = cred->uid;
247 else if (!uid_eq(uid, cred->uid)) {
248 user = find_user(uid);
249 if (!user)
250 goto out_unlock; /* No processes for this user */
251 }
252 do_each_thread(g, p) {
253 if (uid_eq(task_uid(p), uid) && task_pid_vnr(p))
254 error = set_one_prio(p, niceval, error);
255 } while_each_thread(g, p);
256 if (!uid_eq(uid, cred->uid))
257 free_uid(user); /* For find_user() */
258 break;
259 }
260 out_unlock:
261 read_unlock(&tasklist_lock);
262 rcu_read_unlock();
263 out:
264 return error;
265 }
266
267 SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
268 {
269 return ksys_setpriority(which, who, niceval);
270 }
271
272 /*
273 * Ugh. To avoid negative return values, "getpriority()" will
274 * not return the normal nice-value, but a negated value that
275 * has been offset by 20 (ie it returns 40..1 instead of -20..19)
276 * to stay compatible.
277 */
278 int ksys_getpriority(int which, int who)
279 {
280 struct task_struct *g, *p;
281 struct user_struct *user;
282 const struct cred *cred = current_cred();
283 long niceval, retval = -ESRCH;
284 struct pid *pgrp;
285 kuid_t uid;
286
287 if (which > PRIO_USER || which < PRIO_PROCESS)
288 return -EINVAL;
289
290 rcu_read_lock();
291 read_lock(&tasklist_lock);
292 switch (which) {
293 case PRIO_PROCESS:
294 if (who)
295 p = find_task_by_vpid(who);
296 else
297 p = current;
298 if (p) {
299 niceval = nice_to_rlimit(task_nice(p));
300 if (niceval > retval)
301 retval = niceval;
302 }
303 break;
304 case PRIO_PGRP:
305 if (who)
306 pgrp = find_vpid(who);
307 else
308 pgrp = task_pgrp(current);
309 do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
310 niceval = nice_to_rlimit(task_nice(p));
311 if (niceval > retval)
312 retval = niceval;
313 } while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
314 break;
315 case PRIO_USER:
316 uid = make_kuid(cred->user_ns, who);
317 user = cred->user;
318 if (!who)
319 uid = cred->uid;
320 else if (!uid_eq(uid, cred->uid)) {
321 user = find_user(uid);
322 if (!user)
323 goto out_unlock; /* No processes for this user */
324 }
325 do_each_thread(g, p) {
326 if (uid_eq(task_uid(p), uid) && task_pid_vnr(p)) {
327 niceval = nice_to_rlimit(task_nice(p));
328 if (niceval > retval)
329 retval = niceval;
330 }
331 } while_each_thread(g, p);
332 if (!uid_eq(uid, cred->uid))
333 free_uid(user); /* for find_user() */
334 break;
335 }
336 out_unlock:
337 read_unlock(&tasklist_lock);
338 rcu_read_unlock();
339
340 return retval;
341 }
342
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org