From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30F92379991 for ; Sun, 3 May 2026 16:52:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777827145; cv=none; b=p2nPKzLHnX5GZBDLWDHGciW0923DnpqSp5szIMzpXgJCH7r+4OTl122X0qsw4kwg5R2ozKo1H5lL/oxcqOzNZCDQj2z05PGvpplRzaxHlrFntqGyBYfA8YdLnht6JvtrpnNpiXW3xoCx0aRNtbCgnulOPcAPqPshc2PvgttsUlI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777827145; c=relaxed/simple; bh=bbDhnAzk+L5cIjjzjvzFrxEhmc1wCjbhyyNhC4Yd21o=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=eUAdb9KcjdlglNhX1URixos+IkEnnhl55H6LEYbtTHNcePYeExMaSyxwaSYxRll+BUDfZ/pttAfdw4zpQumENuzUCQXBbhRYR7LsSaOej9NRvfvILs7fQFaEQhjrik7em3QUybloNaMVD4B5jyT4jMBwzBF2e5Q/vU6FP6ygkzM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-6961bdde2a1so7992634eaf.2 for ; Sun, 03 May 2026 09:52:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777827139; x=1778431939; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5mcWp2t4xH+yVmAXuYDH8DXM/9Vq27g6xeRVHyQRCb8=; b=g7cl87gvUNSpiuvLw1BKRXH7SjdmR+sV6jTcU6iWDnW1wmIviMSGrliClRZ52BHoKP PPsM217iD5oN82jKE5z7o+j8Xm+V0Rc7dN99DmVcUWcbL6yLABCXH3HqdlNOszd9t6AD 8RuBNVxVbVY7AJ41zSxGEGaHrqGAcOmtAh/RieCW1iUZ5mY4ASFS4t2TlzxVeSSn18wF gB5lsstW9mO4o+tNH+1odWxV15aOKpLXiUo66qUBSzaoiEGeqzF0I4ZMuLIqeoaLVU/u nMHtpf1CUzQ+36yRyGSt3vxaX6Q/Mx9Q9FFx8vCfrxBQXN1MJdZG305Mo3cjKAbm5eZg YRMg== X-Gm-Message-State: AOJu0Ywo40JxX4+O6W+KB6BXad5xN7Sh/rf8NXDrO+8WxxtfwF/HtyC+ DaYwhk3SiSECLdGlaEhc87P1EaBX0WuU03D8NdbCC1Go/CqxdnprZvGIL/FSpeHy7mSWLm7+c/l xBszQM9Us+H9Z1U2pNy5zqnacmBnUkHZWa3uy1FaZl5g6po09Gjj+nFOCb8A= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:308f:b0:67e:3ae6:9031 with SMTP id 006d021491bc7-69697e28ad7mr3280130eaf.59.1777827138867; Sun, 03 May 2026 09:52:18 -0700 (PDT) Date: Sun, 03 May 2026 09:52:18 -0700 In-Reply-To: <69e4ee46.a00a0220.1bd0ca.0058.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69f77d42.050a0220.1584b9.004a.GAE@google.com> Subject: Forwarded: Re: [syzbot] [kernel?] KMSAN: uninit-value in irqentry_exit_to_kernel_mode_preempt From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" 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 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 --- 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