* Re: [syzbot] [kernel?] KMSAN: uninit-value in irqentry_exit_to_kernel_mode_preempt
2026-04-19 15:01 [syzbot] [kernel?] KMSAN: uninit-value in irqentry_exit_to_kernel_mode_preempt syzbot
@ 2026-05-03 13:01 ` syzbot
2026-05-03 16:52 ` Forwarded: " syzbot
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2026-05-03 13:01 UTC (permalink / raw)
To: linux-kernel, luto, peterz, syzkaller-bugs, tglx, zlatistiv
syzbot has found a reproducer for the following issue on:
HEAD commit: 66edb901bf87 Merge tag 'v7.1-p3' of git://git.kernel.org/p..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=107b2dba580000
kernel config: https://syzkaller.appspot.com/x/.config?x=1c3f61154f3bb7e5
dashboard link: https://syzkaller.appspot.com/bug?extid=23d7fcd204e3837866ff
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=126caece580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11f00d06580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/9014c04fc561/disk-66edb901.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a96b1e11a924/vmlinux-66edb901.xz
kernel image: https://storage.googleapis.com/syzbot-assets/680236de6331/bzImage-66edb901.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+23d7fcd204e3837866ff@syzkaller.appspotmail.com
=====================================================
BUG: KMSAN: uninit-value in irqentry_exit_to_kernel_mode_preempt+0xb0/0xc0 include/linux/irq-entry-common.h:472
irqentry_exit_to_kernel_mode_preempt+0xb0/0xc0 include/linux/irq-entry-common.h:472
irqentry_exit_to_kernel_mode include/linux/irq-entry-common.h:547 [inline]
irqentry_exit+0x7b/0x760 kernel/entry/common.c:164
sysvec_apic_timer_interrupt+0x52/0x90 arch/x86/kernel/apic/apic.c:1061
asm_sysvec_apic_timer_interrupt+0x1f/0x30 arch/x86/include/asm/idtentry.h:697
encrypted_key_alloc+0x8c9/0xa70 security/keys/encrypted-keys/encrypted.c:641
encrypted_instantiate+0x45e/0x3220 security/keys/encrypted-keys/encrypted.c:812
__key_instantiate_and_link+0xfe/0x5d0 security/keys/key.c:446
__key_create_or_update+0x12c4/0x1500 security/keys/key.c:941
key_create_or_update+0x5f/0x80 security/keys/key.c:1021
__do_sys_add_key security/keys/keyctl.c:134 [inline]
__se_sys_add_key+0x656/0x870 security/keys/keyctl.c:74
__x64_sys_add_key+0xe4/0x150 security/keys/keyctl.c:74
x64_sys_call+0xd3f/0x3ea0 arch/x86/include/generated/asm/syscalls_64.h:249
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x134/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Local variable dlen created at:
encrypted_key_alloc+0x4f/0xa70 security/keys/encrypted-keys/encrypted.c:586
encrypted_instantiate+0x45e/0x3220 security/keys/encrypted-keys/encrypted.c:812
CPU: 1 UID: 0 PID: 6291 Comm: syz.0.346 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
=====================================================
---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
^ permalink raw reply [flat|nested] 5+ messages in thread* Forwarded: Re: [syzbot] [kernel?] KMSAN: uninit-value in irqentry_exit_to_kernel_mode_preempt
2026-04-19 15:01 [syzbot] [kernel?] KMSAN: uninit-value in irqentry_exit_to_kernel_mode_preempt syzbot
2026-05-03 13:01 ` syzbot
@ 2026-05-03 16:52 ` syzbot
2026-05-03 22:02 ` Forwarded: Re: [PATCH] security/keys/encrypted: encrypted_key_alloc(): fix KMSAN uninit-value on dlen syzbot
2026-05-04 14:16 ` syzbot
3 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2026-05-03 16:52 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: [syzbot] [kernel?] KMSAN: uninit-value in irqentry_exit_to_kernel_mode_preempt
Author: pardhuvarma.kernel@gmail.com
#syz test
From cdf97dc0c3019448a000ee20b75d2ee7a7ca4bb8 Mon Sep 17 00:00:00 2001
From: PardhuVarma Konduru <pardhuvarma.kernel@gmail.com>
Date: Sun, 3 May 2026 20:45:00 +0530
Subject: [PATCH] security/keys/encrypted: encrypted_key_alloc(): fix KMSAN
uninit-value on dlen
KMSAN reports an uninitialized-value use in encrypted_key_alloc()
due to dlen being referenced in a compound condition when kstrtol()
fails.
Split the condition to ensure dlen is only accessed after successful
initialization.
Preserve original error handling semantics.
Reported-by: syzbot+23d7fcd204e3837866ff@syzkaller.appspotmail.com
Signed-off-by: PardhuVarma Konduru <pardhuvarma.kernel@gmail.com>
---
security/keys/encrypted-keys/encrypted.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/security/keys/encrypted-keys/encrypted.c
b/security/keys/encrypted-keys/encrypted.c
index 56b531587a1e..4bf4b4e8f7b5 100644
--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -588,7 +588,9 @@ static struct encrypted_key_payload
*encrypted_key_alloc(struct key *key,
int ret;
ret = kstrtol(datalen, 10, &dlen);
- if (ret < 0 || dlen < MIN_DATA_SIZE || dlen > MAX_DATA_SIZE)
+ if (ret < 0)
+ return ERR_PTR(-EINVAL);
+ if (dlen < MIN_DATA_SIZE || dlen > MAX_DATA_SIZE)
return ERR_PTR(-EINVAL);
format_len = (!format) ? strlen(key_format_default) : strlen(format);
--
2.54.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Forwarded: Re: [PATCH] security/keys/encrypted: encrypted_key_alloc(): fix KMSAN uninit-value on dlen
2026-04-19 15:01 [syzbot] [kernel?] KMSAN: uninit-value in irqentry_exit_to_kernel_mode_preempt syzbot
2026-05-03 13:01 ` syzbot
2026-05-03 16:52 ` Forwarded: " syzbot
@ 2026-05-03 22:02 ` syzbot
2026-05-04 14:16 ` syzbot
3 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2026-05-03 22:02 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: [PATCH] security/keys/encrypted: encrypted_key_alloc(): fix KMSAN uninit-value on dlen
Author: pardhuvarma.kernel@gmail.com
#syz test
KMSAN reports an uninitialized-value use in encrypted_key_alloc()
due to dlen being referenced in a compound condition when kstrtol()
fails.
Split the condition to ensure dlen is only accessed after successful
initialization.
Preserve original error handling semantics.
Reported-by: syzbot+23d7fcd204e3837866ff@syzkaller.appspotmail.com
Signed-off-by: PardhuVarma Konduru <pardhuvarma.kernel@gmail.com>
---
security/keys/encrypted-keys/encrypted.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/security/keys/encrypted-keys/encrypted.c
b/security/keys/encrypted-keys/encrypted.c
index 56b531587a1e..4bf4b4e8f7b5 100644
--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -588,7 +588,9 @@ static struct encrypted_key_payload
*encrypted_key_alloc(struct key *key,
int ret;
ret = kstrtol(datalen, 10, &dlen);
- if (ret < 0 || dlen < MIN_DATA_SIZE || dlen > MAX_DATA_SIZE)
+ if (ret < 0)
+ return ERR_PTR(-EINVAL);
+ if (dlen < MIN_DATA_SIZE || dlen > MAX_DATA_SIZE)
return ERR_PTR(-EINVAL);
format_len = (!format) ? strlen(key_format_default) : strlen(format);
--
2.54.0
On Mon, May 4, 2026 at 3:22 AM PardhuVarma Konduru <
pardhuvarma.kernel@gmail.com> wrote:
> KMSAN reports an uninitialized-value use in encrypted_key_alloc()
> due to dlen being referenced in a compound condition when kstrtol()
> fails.
>
> Split the condition to ensure dlen is only accessed after successful
> initialization.
>
> Preserve original error handling semantics.
>
> Reported-by: syzbot+23d7fcd204e3837866ff@syzkaller.appspotmail.com
> Signed-off-by: PardhuVarma Konduru <pardhuvarma.kernel@gmail.com>
> ---
> security/keys/encrypted-keys/encrypted.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/security/keys/encrypted-keys/encrypted.c
> b/security/keys/encrypted-keys/encrypted.c
> index 56b531587a1e..4bf4b4e8f7b5 100644
> --- a/security/keys/encrypted-keys/encrypted.c
> +++ b/security/keys/encrypted-keys/encrypted.c
> @@ -588,7 +588,9 @@ static struct encrypted_key_payload
> *encrypted_key_alloc(struct key *key,
> int ret;
>
> ret = kstrtol(datalen, 10, &dlen);
> - if (ret < 0 || dlen < MIN_DATA_SIZE || dlen > MAX_DATA_SIZE)
> + if (ret < 0)
> + return ERR_PTR(-EINVAL);
> + if (dlen < MIN_DATA_SIZE || dlen > MAX_DATA_SIZE)
> return ERR_PTR(-EINVAL);
>
> format_len = (!format) ? strlen(key_format_default) :
> strlen(format);
> --
> 2.54.0
>
>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Forwarded: Re: [PATCH] security/keys/encrypted: encrypted_key_alloc(): fix KMSAN uninit-value on dlen
2026-04-19 15:01 [syzbot] [kernel?] KMSAN: uninit-value in irqentry_exit_to_kernel_mode_preempt syzbot
` (2 preceding siblings ...)
2026-05-03 22:02 ` Forwarded: Re: [PATCH] security/keys/encrypted: encrypted_key_alloc(): fix KMSAN uninit-value on dlen syzbot
@ 2026-05-04 14:16 ` syzbot
3 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2026-05-04 14:16 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: [PATCH] security/keys/encrypted: encrypted_key_alloc(): fix KMSAN uninit-value on dlen
Author: pardhuvarma.kernel@gmail.com
#syz test
On Mon, May 4, 2026 at 7:45 PM PardhuVarma Konduru <
pardhuvarma.kernel@gmail.com> wrote:
> KMSAN reports an uninitialized-value use in encrypted_key_alloc()
> due to dlen being referenced in a compound condition when kstrtol()
> fails.
>
> Split the condition to ensure dlen is only accessed after successful
> initialization.
>
> Preserve original error handling semantics.
>
> Reported-by: syzbot+23d7fcd204e3837866ff@syzkaller.appspotmail.com
> Signed-off-by: PardhuVarma Konduru <pardhuvarma.kernel@gmail.com>
> ---
> security/keys/encrypted-keys/encrypted.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/security/keys/encrypted-keys/encrypted.c
> b/security/keys/encrypted-keys/encrypted.c
> index 56b531587a1e..4bf4b4e8f7b5 100644
> --- a/security/keys/encrypted-keys/encrypted.c
> +++ b/security/keys/encrypted-keys/encrypted.c
> @@ -588,7 +588,9 @@ static struct encrypted_key_payload
> *encrypted_key_alloc(struct key *key,
> int ret;
>
> ret = kstrtol(datalen, 10, &dlen);
> - if (ret < 0 || dlen < MIN_DATA_SIZE || dlen > MAX_DATA_SIZE)
> + if (ret < 0)
> + return ERR_PTR(-EINVAL);
> + if (dlen < MIN_DATA_SIZE || dlen > MAX_DATA_SIZE)
> return ERR_PTR(-EINVAL);
>
> format_len = (!format) ? strlen(key_format_default) :
> strlen(format);
> --
> 2.54.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread