kernel/livepatch/transition.c:372:44: sparse: sparse: incorrect type in argument 1 (different address spaces)
From: kbuild test robot
Date: Thu May 28 2020 - 04:04:18 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b0c3ba31be3e45a130e13b278cf3b90f69bda6f6
commit: 913292c97d750fe4188b4f5aa770e5e0ca1e5a91 sched.h: Annotate sighand_struct with __rcu
date: 4 months ago
config: x86_64-randconfig-s022-20200528 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-240-gf0fe1cd9-dirty
git checkout 913292c97d750fe4188b4f5aa770e5e0ca1e5a91
# save the attached .config to linux build tree
make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
>> kernel/livepatch/transition.c:372:44: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] <asn:4> * @@
kernel/livepatch/transition.c:372:44: sparse: expected struct spinlock [usertype] *lock
kernel/livepatch/transition.c:372:44: sparse: got struct spinlock [noderef] <asn:4> *
kernel/livepatch/transition.c:374:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] <asn:4> * @@
kernel/livepatch/transition.c:374:46: sparse: expected struct spinlock [usertype] *lock
kernel/livepatch/transition.c:374:46: sparse: got struct spinlock [noderef] <asn:4> *
vim +372 kernel/livepatch/transition.c
d83a7cb375eec2 Josh Poimboeuf 2017-02-13 338
0b3d52790e1cfd Miroslav Benes 2019-01-15 339 /*
0b3d52790e1cfd Miroslav Benes 2019-01-15 340 * Sends a fake signal to all non-kthread tasks with TIF_PATCH_PENDING set.
0b3d52790e1cfd Miroslav Benes 2019-01-15 341 * Kthreads with TIF_PATCH_PENDING set are woken up.
0b3d52790e1cfd Miroslav Benes 2019-01-15 342 */
0b3d52790e1cfd Miroslav Benes 2019-01-15 343 static void klp_send_signals(void)
0b3d52790e1cfd Miroslav Benes 2019-01-15 344 {
0b3d52790e1cfd Miroslav Benes 2019-01-15 345 struct task_struct *g, *task;
0b3d52790e1cfd Miroslav Benes 2019-01-15 346
0b3d52790e1cfd Miroslav Benes 2019-01-15 347 if (klp_signals_cnt == SIGNALS_TIMEOUT)
0b3d52790e1cfd Miroslav Benes 2019-01-15 348 pr_notice("signaling remaining tasks\n");
0b3d52790e1cfd Miroslav Benes 2019-01-15 349
0b3d52790e1cfd Miroslav Benes 2019-01-15 350 read_lock(&tasklist_lock);
0b3d52790e1cfd Miroslav Benes 2019-01-15 351 for_each_process_thread(g, task) {
0b3d52790e1cfd Miroslav Benes 2019-01-15 352 if (!klp_patch_pending(task))
0b3d52790e1cfd Miroslav Benes 2019-01-15 353 continue;
0b3d52790e1cfd Miroslav Benes 2019-01-15 354
0b3d52790e1cfd Miroslav Benes 2019-01-15 355 /*
0b3d52790e1cfd Miroslav Benes 2019-01-15 356 * There is a small race here. We could see TIF_PATCH_PENDING
0b3d52790e1cfd Miroslav Benes 2019-01-15 357 * set and decide to wake up a kthread or send a fake signal.
0b3d52790e1cfd Miroslav Benes 2019-01-15 358 * Meanwhile the task could migrate itself and the action
0b3d52790e1cfd Miroslav Benes 2019-01-15 359 * would be meaningless. It is not serious though.
0b3d52790e1cfd Miroslav Benes 2019-01-15 360 */
0b3d52790e1cfd Miroslav Benes 2019-01-15 361 if (task->flags & PF_KTHREAD) {
0b3d52790e1cfd Miroslav Benes 2019-01-15 362 /*
0b3d52790e1cfd Miroslav Benes 2019-01-15 363 * Wake up a kthread which sleeps interruptedly and
0b3d52790e1cfd Miroslav Benes 2019-01-15 364 * still has not been migrated.
0b3d52790e1cfd Miroslav Benes 2019-01-15 365 */
0b3d52790e1cfd Miroslav Benes 2019-01-15 366 wake_up_state(task, TASK_INTERRUPTIBLE);
0b3d52790e1cfd Miroslav Benes 2019-01-15 367 } else {
0b3d52790e1cfd Miroslav Benes 2019-01-15 368 /*
0b3d52790e1cfd Miroslav Benes 2019-01-15 369 * Send fake signal to all non-kthread tasks which are
0b3d52790e1cfd Miroslav Benes 2019-01-15 370 * still not migrated.
0b3d52790e1cfd Miroslav Benes 2019-01-15 371 */
0b3d52790e1cfd Miroslav Benes 2019-01-15 @372 spin_lock_irq(&task->sighand->siglock);
0b3d52790e1cfd Miroslav Benes 2019-01-15 373 signal_wake_up(task, 0);
0b3d52790e1cfd Miroslav Benes 2019-01-15 374 spin_unlock_irq(&task->sighand->siglock);
0b3d52790e1cfd Miroslav Benes 2019-01-15 375 }
0b3d52790e1cfd Miroslav Benes 2019-01-15 376 }
0b3d52790e1cfd Miroslav Benes 2019-01-15 377 read_unlock(&tasklist_lock);
0b3d52790e1cfd Miroslav Benes 2019-01-15 378 }
0b3d52790e1cfd Miroslav Benes 2019-01-15 379
:::::: The code at line 372 was first introduced by commit
:::::: 0b3d52790e1cfd6b80b826a245d24859e89632f7 livepatch: Remove signal sysfs attribute
:::::: TO: Miroslav Benes <mbenes@xxxxxxx>
:::::: CC: Jiri Kosina <jkosina@xxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip