From: Simon Horman <horms@kernel.org>
To: Andrea Mayer <andrea.mayer@uniroma2.it>
Cc: "David S. Miller" <davem@davemloft.net>,
David Ahern <dsahern@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
David Lebrun <david.lebrun@uclouvain.be>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Stefano Salsano <stefano.salsano@uniroma2.it>,
Paolo Lungaroni <paolo.lungaroni@uniroma2.it>,
Ahmed Abdelsalam <ahabdels.dev@gmail.com>
Subject: Re: [net] ipv6: sr: fix missing sk_buff release in seg6_input_core
Date: Fri, 17 May 2024 20:23:54 +0100 [thread overview]
Message-ID: <20240517192354.GB475595@kernel.org> (raw)
In-Reply-To: <20240517164541.17733-1-andrea.mayer@uniroma2.it>
On Fri, May 17, 2024 at 06:45:41PM +0200, Andrea Mayer wrote:
> The seg6_input() function is responsible for adding the SRH into a
> packet, delegating the operation to the seg6_input_core(). This function
> uses the skb_cow_head() to ensure that there is sufficient headroom in
> the sk_buff for accommodating the link-layer header.
> In the event that the skb_cow_header() function fails, the
> seg6_input_core() catches the error but it does not release the sk_buff,
> which will result in a memory leak.
>
> This issue was introduced in commit af3b5158b89d ("ipv6: sr: fix BUG due
> to headroom too small after SRH push") and persists even after commit
> 7a3f5b0de364 ("netfilter: add netfilter hooks to SRv6 data plane"),
> where the entire seg6_input() code was refactored to deal with netfilter
> hooks.
>
> The proposed patch addresses the identified memory leak by requiring the
> seg6_input_core() function to release the sk_buff in the event that
> skb_cow_head() fails.
>
> Fixes: af3b5158b89d ("ipv6: sr: fix BUG due to headroom too small after SRH push")
> Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-05-17 19:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 16:45 [net] ipv6: sr: fix missing sk_buff release in seg6_input_core Andrea Mayer
2024-05-17 19:23 ` Simon Horman [this message]
2024-05-17 22:04 ` David Ahern
2024-05-18 15:47 ` Markus Elfring
2024-05-20 10:40 ` patchwork-bot+netdevbpf
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=20240517192354.GB475595@kernel.org \
--to=horms@kernel.org \
--cc=ahabdels.dev@gmail.com \
--cc=andrea.mayer@uniroma2.it \
--cc=davem@davemloft.net \
--cc=david.lebrun@uclouvain.be \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paolo.lungaroni@uniroma2.it \
--cc=stefano.salsano@uniroma2.it \
/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;
as well as URLs for NNTP newsgroup(s).