All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl()
@ 2021-06-21 18:02 Eric Dumazet
  2021-06-22 18:30 ` Alexander Aring
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2021-06-21 18:02 UTC (permalink / raw
  To: David S . Miller, Jakub Kicinski
  Cc: netdev, Eric Dumazet, Eric Dumazet, Alexander Aring,
	Stefan Schmidt, syzbot

From: Eric Dumazet <edumazet@google.com>

Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE
must be present to avoid a crash.

Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexander Aring <alex.aring@gmail.com>
Cc: Stefan Schmidt <stefan@datenfreihafen.org>
Reported-by: syzbot <syzkaller@googlegroups.com>
---
 drivers/net/ieee802154/mac802154_hwsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
index da9135231c079d4ecc0783aa62f2fec07c3f86e6..d5e8b5a067fc6c044dac5dbe3544f4a768f78a76 100644
--- a/drivers/net/ieee802154/mac802154_hwsim.c
+++ b/drivers/net/ieee802154/mac802154_hwsim.c
@@ -480,7 +480,7 @@ static int hwsim_del_edge_nl(struct sk_buff *msg, struct genl_info *info)
 	struct hwsim_edge *e;
 	u32 v0, v1;
 
-	if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] &&
+	if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] ||
 	    !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
 		return -EINVAL;
 
-- 
2.32.0.288.g62a8d224e6-goog


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

* Re: [PATCH net] ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl()
  2021-06-21 18:02 [PATCH net] ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl() Eric Dumazet
@ 2021-06-22 18:30 ` Alexander Aring
  2021-06-22 19:39   ` Stefan Schmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Aring @ 2021-06-22 18:30 UTC (permalink / raw
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, netdev, Eric Dumazet,
	Stefan Schmidt, syzbot

Hi,

On Mon, 21 Jun 2021 at 14:02, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> From: Eric Dumazet <edumazet@google.com>
>
> Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE
> must be present to avoid a crash.
>
> Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Alexander Aring <alex.aring@gmail.com>
> Cc: Stefan Schmidt <stefan@datenfreihafen.org>
> Reported-by: syzbot <syzkaller@googlegroups.com>

Acked-by: Alexander Aring <aahringo@redhat.com>

Thanks!

- Alex

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

* Re: [PATCH net] ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl()
  2021-06-22 18:30 ` Alexander Aring
@ 2021-06-22 19:39   ` Stefan Schmidt
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Schmidt @ 2021-06-22 19:39 UTC (permalink / raw
  To: Alexander Aring, Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, netdev, Eric Dumazet, syzbot

Hello.

On 22.06.21 20:30, Alexander Aring wrote:
> Hi,
> 
> On Mon, 21 Jun 2021 at 14:02, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>
>> From: Eric Dumazet <edumazet@google.com>
>>
>> Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE
>> must be present to avoid a crash.
>>
>> Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> Cc: Alexander Aring <alex.aring@gmail.com>
>> Cc: Stefan Schmidt <stefan@datenfreihafen.org>
>> Reported-by: syzbot <syzkaller@googlegroups.com>
> 
> Acked-by: Alexander Aring <aahringo@redhat.com>
> 
> Thanks!

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] 3+ messages in thread

end of thread, other threads:[~2021-06-22 19:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-21 18:02 [PATCH net] ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl() Eric Dumazet
2021-06-22 18:30 ` Alexander Aring
2021-06-22 19:39   ` Stefan Schmidt

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.