Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B963019F42C for ; Thu, 1 May 2025 14:15:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746108932; cv=none; b=s6gVwPOKbn15G2bgYuE2MO8VYoSz751Fo4su075W2hBHuz5pbSeHn3CRlrE8NZ4XucBak5Kzh7gnmKmkeh2M+cZj2nno9zRqQJArWJCChkCQJIbHujFSvYIxnenzL6uV6bCLDQOrvIL7FBd7Qx1OS/CSA8fdLdmotcKZVrW2PWg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746108932; c=relaxed/simple; bh=KHNr0RumjUMebxyXlv5EEahOBLUTp1ShUF40tD/1W9c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FUskWOnpESANqvCl8cbElxFeXN/8qdmGedTwBC6ejlrnpSyFLakG+BoYfXFQaoTA+hzz5qOu2BX354b1EJH/C5c/O9LCzzkNargoMT6kxFHE0iZWTqAsbJfrTeVy9g5EKj6AxjeWLFTu3YB53kemnlrZtIsriO/Nyte1jVvuNB8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=w5Fu/6pc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="w5Fu/6pc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 395EAC4CEE3; Thu, 1 May 2025 14:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746108932; bh=KHNr0RumjUMebxyXlv5EEahOBLUTp1ShUF40tD/1W9c=; h=From:To:Cc:Subject:Date:Reply-to:From; b=w5Fu/6pcZdBy5q4p+KR1SyfKWGUTznTu6QBm/ObxqjCCBtOVwcJUHA5FBqHp3O6BX U9E+Bi+p854pZyAR4IAykK/Nmj9/yDaQ+KRz6SAwmk1k7TNnE6NUcgPzFxR26zToqR 59qnEE7B52cjPkD4v+qitSvy+2W6guD72gsbTtkI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49856: net: tun: call napi_schedule_prep() to ensure we own a napi Date: Thu, 1 May 2025 16:10:46 +0200 Message-ID: <2025050145-CVE-2022-49856-4dc0@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3855; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=A14hLtRjwhVtJcIy4S+a6ISUqVM4dKodGNDhv40j2YM=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDaukio+VZvco9dl8Ezy1bbWO/L6p2ZzBFx7q83Aqc Oz8u6G/I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbyJYRhrqhsgSGzStG5zXIH X6YKn+IozBe8w7Dg9K4OkdtbNb29J+2s8uya1SrM/mcLAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: net: tun: call napi_schedule_prep() to ensure we own a napi A recent patch exposed another issue in napi_get_frags() caught by syzbot [1] Before feeding packets to GRO, and calling napi_complete() we must first grab NAPI_STATE_SCHED. [1] WARNING: CPU: 0 PID: 3612 at net/core/dev.c:6076 napi_complete_done+0x45b/0x880 net/core/dev.c:6076 Modules linked in: CPU: 0 PID: 3612 Comm: syz-executor408 Not tainted 6.1.0-rc3-syzkaller-00175-g1118b2049d77 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 RIP: 0010:napi_complete_done+0x45b/0x880 net/core/dev.c:6076 Code: c1 ea 03 0f b6 14 02 4c 89 f0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 24 04 00 00 41 89 5d 1c e9 73 fc ff ff e8 b5 53 22 fa <0f> 0b e9 82 fe ff ff e8 a9 53 22 fa 48 8b 5c 24 08 31 ff 48 89 de RSP: 0018:ffffc90003c4f920 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 0000000000000030 RCX: 0000000000000000 RDX: ffff8880251c0000 RSI: ffffffff875a58db RDI: 0000000000000007 RBP: 0000000000000001 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000001 R12: ffff888072d02628 R13: ffff888072d02618 R14: ffff888072d02634 R15: 0000000000000000 FS: 0000555555f13300(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055c44d3892b8 CR3: 00000000172d2000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: napi_complete include/linux/netdevice.h:510 [inline] tun_get_user+0x206d/0x3a60 drivers/net/tun.c:1980 tun_chr_write_iter+0xdb/0x200 drivers/net/tun.c:2027 call_write_iter include/linux/fs.h:2191 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x182/0x700 fs/read_write.c:861 vfs_writev+0x1aa/0x630 fs/read_write.c:934 do_writev+0x133/0x2f0 fs/read_write.c:977 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f37021a3c19 The Linux kernel CVE team has assigned CVE-2022-49856 to this issue. Affected and fixed versions =========================== Issue fixed in mainline with commit 07d120a Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-49856 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/net/tun.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/310f0855352ee4b2eb38855c99185c23e6e1496b https://git.kernel.org/stable/c/30b0263d0366ea63aa7cad0407dfd945cc348580 https://git.kernel.org/stable/c/534762e261c84d43e5d56a780e40278b94c20540 https://git.kernel.org/stable/c/9132fa043f96ac545254ab326db5c6fd47d54acb https://git.kernel.org/stable/c/999550c8cbb3fcb535f542d652fe1cb936839e5f https://git.kernel.org/stable/c/07d120aa33cc9d9115753d159f64d20c94458781