* [syzbot] [lsm?] [keyrings?] KCSAN: data-race in __se_sys_keyctl / key_task_permission (3)
@ 2024-07-04 14:18 syzbot
2024-07-04 14:38 ` Dmitry Vyukov
0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2024-07-04 14:18 UTC (permalink / raw)
To: dhowells, jarkko, jmorris, keyrings, linux-kernel,
linux-security-module, paul, serge, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 8a9c6c40432e Merge tag 'io_uring-6.10-20240703' of git://g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=113817ae980000
kernel config: https://syzkaller.appspot.com/x/.config?x=5b9537cd00be479e
dashboard link: https://syzkaller.appspot.com/bug?extid=8c446f45cf5815e9110a
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f01153f3ec8e/disk-8a9c6c40.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/04b88663a824/vmlinux-8a9c6c40.xz
kernel image: https://storage.googleapis.com/syzbot-assets/63c518cc63c5/bzImage-8a9c6c40.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+8c446f45cf5815e9110a@syzkaller.appspotmail.com
==================================================================
BUG: KCSAN: data-race in __se_sys_keyctl / key_task_permission
write to 0xffff88812277dd70 of 4 bytes by task 19442 on cpu 0:
keyctl_setperm_key security/keys/keyctl.c:1098 [inline]
__do_sys_keyctl security/keys/keyctl.c:1926 [inline]
__se_sys_keyctl+0xab5/0xbb0 security/keys/keyctl.c:1874
__x64_sys_keyctl+0x67/0x80 security/keys/keyctl.c:1874
x64_sys_call+0x2bf5/0x2d70 arch/x86/include/generated/asm/syscalls_64.h:251
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
read to 0xffff88812277dd70 of 4 bytes by task 19441 on cpu 1:
key_task_permission+0x14a/0x2c0 security/keys/permission.c:55
lookup_user_key+0x9ea/0xdf0 security/keys/process_keys.c:803
keyctl_setperm_key security/keys/keyctl.c:1083 [inline]
__do_sys_keyctl security/keys/keyctl.c:1926 [inline]
__se_sys_keyctl+0x829/0xbb0 security/keys/keyctl.c:1874
__x64_sys_keyctl+0x67/0x80 security/keys/keyctl.c:1874
x64_sys_call+0x2bf5/0x2d70 arch/x86/include/generated/asm/syscalls_64.h:251
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
value changed: 0x3d010000 -> 0x00000000
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 19441 Comm: syz.1.4799 Tainted: G W 6.10.0-rc6-syzkaller-00067-g8a9c6c40432e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
==================================================================
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [syzbot] [lsm?] [keyrings?] KCSAN: data-race in __se_sys_keyctl / key_task_permission (3)
2024-07-04 14:18 [syzbot] [lsm?] [keyrings?] KCSAN: data-race in __se_sys_keyctl / key_task_permission (3) syzbot
@ 2024-07-04 14:38 ` Dmitry Vyukov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Vyukov @ 2024-07-04 14:38 UTC (permalink / raw)
To: syzbot
Cc: dhowells, jarkko, jmorris, keyrings, linux-kernel,
linux-security-module, paul, serge, syzkaller-bugs
On Thu, 4 Jul 2024 at 16:18, syzbot
<syzbot+8c446f45cf5815e9110a@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 8a9c6c40432e Merge tag 'io_uring-6.10-20240703' of git://g..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=113817ae980000
> kernel config: https://syzkaller.appspot.com/x/.config?x=5b9537cd00be479e
> dashboard link: https://syzkaller.appspot.com/bug?extid=8c446f45cf5815e9110a
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
>
> Unfortunately, I don't have any reproducer for this issue yet.
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/f01153f3ec8e/disk-8a9c6c40.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/04b88663a824/vmlinux-8a9c6c40.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/63c518cc63c5/bzImage-8a9c6c40.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+8c446f45cf5815e9110a@syzkaller.appspotmail.com
>
> ==================================================================
> BUG: KCSAN: data-race in __se_sys_keyctl / key_task_permission
>
> write to 0xffff88812277dd70 of 4 bytes by task 19442 on cpu 0:
> keyctl_setperm_key security/keys/keyctl.c:1098 [inline]
> __do_sys_keyctl security/keys/keyctl.c:1926 [inline]
> __se_sys_keyctl+0xab5/0xbb0 security/keys/keyctl.c:1874
> __x64_sys_keyctl+0x67/0x80 security/keys/keyctl.c:1874
> x64_sys_call+0x2bf5/0x2d70 arch/x86/include/generated/asm/syscalls_64.h:251
> do_syscall_x64 arch/x86/entry/common.c:52 [inline]
> do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
> entry_SYSCALL_64_after_hwframe+0x77/0x7f
>
> read to 0xffff88812277dd70 of 4 bytes by task 19441 on cpu 1:
> key_task_permission+0x14a/0x2c0 security/keys/permission.c:55
> lookup_user_key+0x9ea/0xdf0 security/keys/process_keys.c:803
> keyctl_setperm_key security/keys/keyctl.c:1083 [inline]
> __do_sys_keyctl security/keys/keyctl.c:1926 [inline]
> __se_sys_keyctl+0x829/0xbb0 security/keys/keyctl.c:1874
> __x64_sys_keyctl+0x67/0x80 security/keys/keyctl.c:1874
> x64_sys_call+0x2bf5/0x2d70 arch/x86/include/generated/asm/syscalls_64.h:251
> do_syscall_x64 arch/x86/entry/common.c:52 [inline]
> do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
> entry_SYSCALL_64_after_hwframe+0x77/0x7f
>
> value changed: 0x3d010000 -> 0x00000000
>
> Reported by Kernel Concurrency Sanitizer on:
> CPU: 1 PID: 19441 Comm: syz.1.4799 Tainted: G W 6.10.0-rc6-syzkaller-00067-g8a9c6c40432e #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
> ==================================================================
The code in key_task_permission() looks fishy if it can race with
key->perm updates.
There is possibility for TOCTOU and unintentional re-reads of the field.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-04 14:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-04 14:18 [syzbot] [lsm?] [keyrings?] KCSAN: data-race in __se_sys_keyctl / key_task_permission (3) syzbot
2024-07-04 14:38 ` Dmitry Vyukov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).