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 0C15038F9A for ; Sun, 19 May 2024 10:12:54 +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=1716113574; cv=none; b=Wme2iRtmoLsamlN0OXX89Un3al51QiPi9jPaTP/a8YzPcKC7Y+1iXSAYcsMAE4/0gusuSs02FArDyk3aN/958gcpsvonC4eWanL6pnpAgqb3hcHbD5PRWAr3wHu5tJqGTz3/QqXJ44zoVfF1pQUgLR12WJis/SFhGM+QX9DZvDo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716113574; c=relaxed/simple; bh=3bJ5cTz1Kb2oxccQiu6KG9euCoJ/KtnyWW94+Cofoyc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GoIAdJ+7dLpCLn6pqF0m+JOYZKrErc+pUr/oTeQSEjat4H8/frHvxUfp7L3y3JgSe6GI7m502voONoXWqqbhvLmUdnMEf0fBXcadNSyTjNWHB5o67UvLKBL+AwkVluf0b9vCmpf0cvAwfOE3vOEF9WTqskoeyYhcFP10vhDQ1m8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BoPLsjX9; 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="BoPLsjX9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85789C32781; Sun, 19 May 2024 10:12:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716113573; bh=3bJ5cTz1Kb2oxccQiu6KG9euCoJ/KtnyWW94+Cofoyc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=BoPLsjX9VBni0Uq14LZ01FQTKrManErasOsTTy2nfX2uQs0bqJmXBr1EHKMz4hQaC 2IHYF0lkZ3k1gccAewTvzh9droXGtEs9nwnkX3qPygebk8k4EMgvdEr1bvZLdFzrFq Dc980hcKTTzSzWwQyvaj40S5CEx5XXe24eWgaZH8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35941: net: skbuff: add overflow debug check to pull/push helpers Date: Sun, 19 May 2024 12:11:35 +0200 Message-ID: <2024051919-CVE-2024-35941-1a9e@gregkh> X-Mailer: git-send-email 2.45.1 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=2933; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=3bJ5cTz1Kb2oxccQiu6KG9euCoJ/KtnyWW94+Cofoyc=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmeF9zvJT69d2H/wy71HwuvHvVPOudewiY0STN42yLVj wZr/XxvdsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEeK8xzJU9aiqwx+/cJt+J S/gn2t+UPLi0LpVhQQ9z9Wc9XmvbN7OrMqrDk0pbjhWFAQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: net: skbuff: add overflow debug check to pull/push helpers syzbot managed to trigger following splat: BUG: KASAN: use-after-free in __skb_flow_dissect+0x4a3b/0x5e50 Read of size 1 at addr ffff888208a4000e by task a.out/2313 [..] __skb_flow_dissect+0x4a3b/0x5e50 __skb_get_hash+0xb4/0x400 ip_tunnel_xmit+0x77e/0x26f0 ipip_tunnel_xmit+0x298/0x410 .. Analysis shows that the skb has a valid ->head, but bogus ->data pointer. skb->data gets its bogus value via the neigh layer, which does: 1556 __skb_pull(skb, skb_network_offset(skb)); ... and the skb was already dodgy at this point: skb_network_offset(skb) returns a negative value due to an earlier overflow of skb->network_header (u16). __skb_pull thus "adjusts" skb->data by a huge offset, pointing outside skb->head area. Allow debug builds to splat when we try to pull/push more than INT_MAX bytes. After this, the syzkaller reproducer yields a more precise splat before the flow dissector attempts to read off skb->data memory: WARNING: CPU: 5 PID: 2313 at include/linux/skbuff.h:2653 neigh_connected_output+0x28e/0x400 ip_finish_output2+0xb25/0xed0 iptunnel_xmit+0x4ff/0x870 ipgre_xmit+0x78e/0xbb0 The Linux kernel CVE team has assigned CVE-2024-35941 to this issue. Affected and fixed versions =========================== Fixed in 6.1.86 with commit 8af60bb2b215 Fixed in 6.6.27 with commit 1b2b26595bb0 Fixed in 6.8.6 with commit fff05b2b004d Fixed in 6.9 with commit 219eee9c0d16 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-2024-35941 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: include/linux/skbuff.h 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/8af60bb2b215f478b886f1d6d302fefa7f0b917d https://git.kernel.org/stable/c/1b2b26595bb09febf14c5444c873ac4ec90a5a77 https://git.kernel.org/stable/c/fff05b2b004d9a8a2416d08647f3dc9068e357c8 https://git.kernel.org/stable/c/219eee9c0d16f1b754a8b85275854ab17df0850a