From: Martin Schiller <ms@dev.tdt.de>
To: Wei Yongjun <weiyongjun@huaweicloud.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Hendry <andrew.hendry@gmail.com>,
Matthew Daley <mattjd@gmail.com>,
Wei Yongjun <weiyongjun1@huawei.com>,
linux-x25@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net] net/x25: Fix skb leak in x25_lapb_receive_frame()
Date: Mon, 14 Nov 2022 12:53:48 +0100 [thread overview]
Message-ID: <ca0d14934e90d4767309cea20e6510dd@dev.tdt.de> (raw)
In-Reply-To: <20221114110519.514538-1-weiyongjun@huaweicloud.com>
On 2022-11-14 12:05, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> x25_lapb_receive_frame() using skb_copy() to get a private copy of
> skb, the new skb should be freed in the undersized/fragmented skb
> error handling path. Otherwise there is a memory leak.
>
> Fixes: cb101ed2c3c7 ("x25: Handle undersized/fragmented skbs")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> net/x25/x25_dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c
> index 5259ef8f5242..748d8630ab58 100644
> --- a/net/x25/x25_dev.c
> +++ b/net/x25/x25_dev.c
> @@ -117,7 +117,7 @@ int x25_lapb_receive_frame(struct sk_buff *skb,
> struct net_device *dev,
>
> if (!pskb_may_pull(skb, 1)) {
> x25_neigh_put(nb);
> - return 0;
> + goto drop;
> }
>
> switch (skb->data[0]) {
Looks good to me.
Thanks.
Acked-by: Martin Schiller <ms@dev.tdt.de>
next prev parent reply other threads:[~2022-11-14 11:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 11:05 [PATCH net] net/x25: Fix skb leak in x25_lapb_receive_frame() Wei Yongjun
2022-11-14 11:53 ` Martin Schiller [this message]
2022-11-16 4:30 ` 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=ca0d14934e90d4767309cea20e6510dd@dev.tdt.de \
--to=ms@dev.tdt.de \
--cc=andrew.hendry@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-x25@vger.kernel.org \
--cc=mattjd@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=weiyongjun1@huawei.com \
--cc=weiyongjun@huaweicloud.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.