netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ieee802154: Prevent user from crashing the host
@ 2023-03-01 15:44 Miquel Raynal
  2023-03-02  8:48 ` Miquel Raynal
  2023-03-02 13:45 ` Stefan Schmidt
  0 siblings, 2 replies; 5+ messages in thread
From: Miquel Raynal @ 2023-03-01 15:44 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet,
	netdev
  Cc: Alexander Aring, Stefan Schmidt, linux-wpan, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Guilhem Imberton, Thomas Petazzoni, Miquel Raynal, Sanan Hasanov

Avoid crashing the machine by checking
info->attrs[NL802154_ATTR_SCAN_TYPE] presence before de-referencing it,
which was the primary intend of the blamed patch.

Reported-by: Sanan Hasanov <sanan.hasanov@Knights.ucf.edu>
Suggested-by: Eric Dumazet <edumazet@google.com>
Fixes: a0b6106672b5 ("ieee802154: Convert scan error messages to extack")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 net/ieee802154/nl802154.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 88380606af2c..a18fb98a4b09 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -1412,7 +1412,7 @@ static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info)
 		return -EOPNOTSUPP;
 	}
 
-	if (!nla_get_u8(info->attrs[NL802154_ATTR_SCAN_TYPE])) {
+	if (!info->attrs[NL802154_ATTR_SCAN_TYPE]) {
 		NL_SET_ERR_MSG(info->extack, "Malformed request, missing scan type");
 		return -EINVAL;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net] ieee802154: Prevent user from crashing the host
  2023-03-01 15:44 [PATCH net] ieee802154: Prevent user from crashing the host Miquel Raynal
@ 2023-03-02  8:48 ` Miquel Raynal
  2023-03-02 10:20   ` Paolo Abeni
  2023-03-02 13:45 ` Stefan Schmidt
  1 sibling, 1 reply; 5+ messages in thread
From: Miquel Raynal @ 2023-03-02  8:48 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet,
	netdev
  Cc: Alexander Aring, Stefan Schmidt, linux-wpan, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Guilhem Imberton, Thomas Petazzoni, Sanan Hasanov

Hello,

miquel.raynal@bootlin.com wrote on Wed,  1 Mar 2023 16:44:50 +0100:

> Avoid crashing the machine by checking
> info->attrs[NL802154_ATTR_SCAN_TYPE] presence before de-referencing it,
> which was the primary intend of the blamed patch.

Subject should have been wpan instead of net, sorry for the confusion.

> Reported-by: Sanan Hasanov <sanan.hasanov@Knights.ucf.edu>
> Suggested-by: Eric Dumazet <edumazet@google.com>
> Fixes: a0b6106672b5 ("ieee802154: Convert scan error messages to extack")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  net/ieee802154/nl802154.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
> index 88380606af2c..a18fb98a4b09 100644
> --- a/net/ieee802154/nl802154.c
> +++ b/net/ieee802154/nl802154.c
> @@ -1412,7 +1412,7 @@ static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info)
>  		return -EOPNOTSUPP;
>  	}
>  
> -	if (!nla_get_u8(info->attrs[NL802154_ATTR_SCAN_TYPE])) {
> +	if (!info->attrs[NL802154_ATTR_SCAN_TYPE]) {
>  		NL_SET_ERR_MSG(info->extack, "Malformed request, missing scan type");
>  		return -EINVAL;
>  	}


Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] ieee802154: Prevent user from crashing the host
  2023-03-02  8:48 ` Miquel Raynal
@ 2023-03-02 10:20   ` Paolo Abeni
  2023-03-02 13:47     ` Stefan Schmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Abeni @ 2023-03-02 10:20 UTC (permalink / raw)
  To: Miquel Raynal, David S. Miller, Jakub Kicinski, Eric Dumazet,
	netdev
  Cc: Alexander Aring, Stefan Schmidt, linux-wpan, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Guilhem Imberton, Thomas Petazzoni, Sanan Hasanov

Hello,

On Thu, 2023-03-02 at 09:48 +0100, Miquel Raynal wrote:
> miquel.raynal@bootlin.com wrote on Wed,  1 Mar 2023 16:44:50 +0100:
> 
> > Avoid crashing the machine by checking
> > info->attrs[NL802154_ATTR_SCAN_TYPE] presence before de-referencing it,
> > which was the primary intend of the blamed patch.
> 
> Subject should have been wpan instead of net, sorry for the confusion.

I read the above as you intend this patch to go through
Alexander/Stefan tree, thus dropping from netdev PW.

LMK if you prefer otherwise, thanks!

Paolo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] ieee802154: Prevent user from crashing the host
  2023-03-01 15:44 [PATCH net] ieee802154: Prevent user from crashing the host Miquel Raynal
  2023-03-02  8:48 ` Miquel Raynal
@ 2023-03-02 13:45 ` Stefan Schmidt
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Schmidt @ 2023-03-02 13:45 UTC (permalink / raw)
  To: Miquel Raynal, David S. Miller, Jakub Kicinski, Paolo Abeni,
	Eric Dumazet, netdev
  Cc: Alexander Aring, linux-wpan, David Girault, Romuald Despres,
	Frederic Blain, Nicolas Schodet, Guilhem Imberton,
	Thomas Petazzoni, Sanan Hasanov

Hello.

On 01.03.23 16:44, Miquel Raynal wrote:
> Avoid crashing the machine by checking
> info->attrs[NL802154_ATTR_SCAN_TYPE] presence before de-referencing it,
> which was the primary intend of the blamed patch.
> 
> Reported-by: Sanan Hasanov <sanan.hasanov@Knights.ucf.edu>
> Suggested-by: Eric Dumazet <edumazet@google.com>
> Fixes: a0b6106672b5 ("ieee802154: Convert scan error messages to extack")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>   net/ieee802154/nl802154.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
> index 88380606af2c..a18fb98a4b09 100644
> --- a/net/ieee802154/nl802154.c
> +++ b/net/ieee802154/nl802154.c
> @@ -1412,7 +1412,7 @@ static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info)
>   		return -EOPNOTSUPP;
>   	}
>   
> -	if (!nla_get_u8(info->attrs[NL802154_ATTR_SCAN_TYPE])) {
> +	if (!info->attrs[NL802154_ATTR_SCAN_TYPE]) {
>   		NL_SET_ERR_MSG(info->extack, "Malformed request, missing scan type");
>   		return -EINVAL;
>   	}

This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!

regards
Stefan Schmidt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] ieee802154: Prevent user from crashing the host
  2023-03-02 10:20   ` Paolo Abeni
@ 2023-03-02 13:47     ` Stefan Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Schmidt @ 2023-03-02 13:47 UTC (permalink / raw)
  To: Paolo Abeni, Miquel Raynal, David S. Miller, Jakub Kicinski,
	Eric Dumazet, netdev
  Cc: Alexander Aring, linux-wpan, David Girault, Romuald Despres,
	Frederic Blain, Nicolas Schodet, Guilhem Imberton,
	Thomas Petazzoni, Sanan Hasanov

Hello Paolo.

On 02.03.23 11:20, Paolo Abeni wrote:
> Hello,
> 
> On Thu, 2023-03-02 at 09:48 +0100, Miquel Raynal wrote:
>> miquel.raynal@bootlin.com wrote on Wed,  1 Mar 2023 16:44:50 +0100:
>>
>>> Avoid crashing the machine by checking
>>> info->attrs[NL802154_ATTR_SCAN_TYPE] presence before de-referencing it,
>>> which was the primary intend of the blamed patch.
>>
>> Subject should have been wpan instead of net, sorry for the confusion.
> 
> I read the above as you intend this patch to go through
> Alexander/Stefan tree, thus dropping from netdev PW.

That is correct. I just applied it and will send a pull request for net 
later today once it passed all my tests here.

regards
Stefan Schmidt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-02 13:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-01 15:44 [PATCH net] ieee802154: Prevent user from crashing the host Miquel Raynal
2023-03-02  8:48 ` Miquel Raynal
2023-03-02 10:20   ` Paolo Abeni
2023-03-02 13:47     ` Stefan Schmidt
2023-03-02 13:45 ` Stefan Schmidt

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).