All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: netdev@vger.kernel.org, Cong Wang <cong.wang@bytedance.com>,
	Andreas Schultz <aschultz@tpip.net>,
	Harald Welte <laforge@gnumonks.org>
Subject: Re: [Patch net] gtp: fix a potential NULL pointer dereference
Date: Tue, 27 Aug 2024 18:05:13 +0200	[thread overview]
Message-ID: <Zs35Oeb7O0rpR5mR@calendula> (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>

Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>

Thanks.

  parent reply	other threads:[~2024-08-27 16:05 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
2024-08-27 16:05 ` Pablo Neira Ayuso [this message]
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=Zs35Oeb7O0rpR5mR@calendula \
    --to=pablo@netfilter.org \
    --cc=aschultz@tpip.net \
    --cc=cong.wang@bytedance.com \
    --cc=laforge@gnumonks.org \
    --cc=netdev@vger.kernel.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 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.