From: Eric Dumazet <eric.dumazet@gmail.com>
To: cheung wall <zzqq0103.hey@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
pekkas@netcore.fi, jmorris@namei.org, yoshfuji@linux-ipv6.org,
kaber@trash.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: "Kernel Warn in af_inet" in Linux Kernel Version 2.6.26
Date: Mon, 2 Dec 2024 11:04:30 +0100 [thread overview]
Message-ID: <83df9d63-0c27-46a4-9321-ef6337bae1c5@gmail.com> (raw)
In-Reply-To: <CAKHoSAtVJ=oycBBrcdxrTqZ8yW9dS=dWUU=mxQitJ+f73mGWcQ@mail.gmail.com>
On 12/2/24 5:30 AM, cheung wall wrote:
> Hello,
>
> I am writing to report a potential vulnerability identified in the
> Linux Kernel version 2.6.26.
> This issue was discovered using our custom vulnerability discovery
> tool.
>
> Affected File:
>
> File: net/ipv4/af_inet.c
>
> Detailed call trace:
>
> [ 1788.473836] KERNEL: assertion (!atomic_read(&sk->sk_wmem_alloc))
> failed at net/ipv4/af_inet.c (155)
> [ 1788.473836] KERNEL: assertion (!sk->sk_wmem_queued) failed at
> net/ipv4/af_inet.c (156)
> [ 1788.473836] KERNEL: assertion (!sk->sk_forward_alloc) failed at
> net/ipv4/af_inet.c (157)
> [ 1788.473836] KERNEL: assertion (!atomic_read(&sk->sk_wmem_alloc))
> failed at net/ipv4/af_inet.c (155)
> [ 1788.473836] KERNEL: assertion (!sk->sk_wmem_queued) failed at
> net/ipv4/af_inet.c (156)
> [ 1788.473862] KERNEL: assertion (!sk->sk_forward_alloc) failed at
> net/ipv4/af_inet.c (157)
>
> Repro C Source Code: https://pastebin.com/qs5y6Bcy
>
> Root Cause:
>
> The root cause of this bug lies in the improper handling of socket
> write memory management in the IPv4 stack, specifically in the
> assertions within net/ipv4/af_inet.c. The PoC triggers a sequence of
> socket operations, including socket, sendto, listen, and accept, with
> crafted input data and parameters. These operations result in
> inconsistent states of the sock structure, where critical fields like
> sk_wmem_alloc, sk_wmem_queued, and sk_forward_alloc are not properly
> cleared or synchronized. The kernel fails to maintain the expected
> invariants for these fields, leading to assertion failures that
> indicate a logical inconsistency in memory allocation or deallocation
> for socket operations. This issue highlights a potential lack of
> proper cleanup or state transition checks in the network stack.
Please do not fuzz old and not supported kernels.
Or do not report to us the issues, _unless_ they also trigger on
recent/supported kernels.
Thank you.
prev parent reply other threads:[~2024-12-02 10:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 4:30 "Kernel Warn in af_inet" in Linux Kernel Version 2.6.26 cheung wall
2024-12-02 10:04 ` Eric Dumazet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83df9d63-0c27-46a4-9321-ef6337bae1c5@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pekkas@netcore.fi \
--cc=yoshfuji@linux-ipv6.org \
--cc=zzqq0103.hey@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox