From: Simon Horman <horms@kernel.org>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: netdev@vger.kernel.org, Cong Wang <cong.wang@bytedance.com>,
Andreas Schultz <aschultz@tpip.net>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Harald Welte <laforge@gnumonks.org>
Subject: Re: [Patch net] gtp: fix a potential NULL pointer dereference
Date: Tue, 27 Aug 2024 15:41:13 +0100 [thread overview]
Message-ID: <20240827144113.GE1368797@kernel.org> (raw)
In-Reply-To: <20240825191638.146748-1-xiyou.wangcong@gmail.com>
On Sun, Aug 25, 2024 at 12:16:38PM -0700, Cong Wang wrote:
> From: Cong Wang <cong.wang@bytedance.com>
>
> When sockfd_lookup() fails, gtp_encap_enable_socket() returns a
> NULL pointer, but its callers only check for error pointers thus miss
> the NULL pointer case.
>
> Fix it by returning an error pointer with the error code carried from
> sockfd_lookup().
>
> (I found this bug during code inspection.)
>
> Fixes: 1e3a3abd8b28 ("gtp: make GTP sockets in gtp_newlink optional")
> Cc: Andreas Schultz <aschultz@tpip.net>
> Cc: Pablo Neira Ayuso <pablo@netfilter.org>
> Cc: Harald Welte <laforge@gnumonks.org>
> Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Thanks Cong,
I agree with your analysis.
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-08-27 14:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-25 19:16 [Patch net] gtp: fix a potential NULL pointer dereference Cong Wang
2024-08-27 14:41 ` Simon Horman [this message]
2024-08-27 16:05 ` Pablo Neira Ayuso
2024-08-27 21: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=20240827144113.GE1368797@kernel.org \
--to=horms@kernel.org \
--cc=aschultz@tpip.net \
--cc=cong.wang@bytedance.com \
--cc=laforge@gnumonks.org \
--cc=netdev@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=xiyou.wangcong@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;
as well as URLs for NNTP newsgroup(s).