[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHC9VhQAdxADGrqEDH4kUuoXsUS_E92UtTDcf+uF7J=QavkP3g@mail.gmail.com>
Date: Wed, 2 Apr 2025 14:28:40 -0400
From: Paul Moore <paul@...l-moore.com>
To: Simon Horman <horms@...nel.org>
Cc: Debin Zhu <mowenroot@....com>, pabeni@...hat.com, 1985755126@...com,
kuba@...nel.org, linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v3] netlabel: Fix NULL pointer exception caused by CALIPSO
on IPv4 sockets
On Wed, Apr 2, 2025 at 5:36 AM Simon Horman <horms@...nel.org> wrote:
> On Tue, Apr 01, 2025 at 08:40:18PM +0800, Debin Zhu wrote:
> > When calling netlbl_conn_setattr(), addr->sa_family is used
> > to determine the function behavior. If sk is an IPv4 socket,
> > but the connect function is called with an IPv6 address,
> > the function calipso_sock_setattr() is triggered.
> > Inside this function, the following code is executed:
> >
> > sk_fullsock(__sk) ? inet_sk(__sk)->pinet6 : NULL;
> >
> > Since sk is an IPv4 socket, pinet6 is NULL, leading to a
> > null pointer dereference.
> >
> > This patch fixes the issue by checking if inet6_sk(sk)
> > returns a NULL pointer before accessing pinet6.
> >
> > Fixes: ceba1832b1b2("calipso: Set the calipso socket label to match the secattr.")
>
> There is probably no need to repost for this, but
> there is a missing space in the Fixes tag. It should be like this:
>
> Fixes: ceba1832b1b2 ("calipso: Set the calipso socket label to match the secattr.")
Thanks.
Not sure if the netdev folks are going to pick this up or if I'll end
up taking it, but if I end up taking it I'll update the tag while
merging.
> > Signed-off-by: Debin Zhu <mowenroot@....com>
> > Signed-off-by: Bitao Ouyang <1985755126@...com>
> > Acked-by: Paul Moore <paul@...l-moore.com>
--
paul-moore.com
Powered by blists - more mailing lists