[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zs35Oeb7O0rpR5mR@calendula>
Date: Tue, 27 Aug 2024 18:05:13 +0200
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: netdev@...r.kernel.org, Cong Wang <cong.wang@...edance.com>,
Andreas Schultz <aschultz@...p.net>,
Harald Welte <laforge@...monks.org>
Subject: Re: [Patch net] gtp: fix a potential NULL pointer dereference
On Sun, Aug 25, 2024 at 12:16:38PM -0700, Cong Wang wrote:
> From: Cong Wang <cong.wang@...edance.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@...p.net>
> Cc: Pablo Neira Ayuso <pablo@...filter.org>
> Cc: Harald Welte <laforge@...monks.org>
> Signed-off-by: Cong Wang <cong.wang@...edance.com>
Reviewed-by: Pablo Neira Ayuso <pablo@...filter.org>
Thanks.
Powered by blists - more mailing lists