* [PATCH net] macsec: fix NULL dereference in macsec_upd_offload()
@ 2020-04-06 9:38 Davide Caratti
2020-04-06 17:26 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Davide Caratti @ 2020-04-06 9:38 UTC (permalink / raw)
To: Antoine Tenart, Dmitry Bogdanov, netdev, David S. Miller
macsec_upd_offload() gets the value of MACSEC_OFFLOAD_ATTR_TYPE
without checking its presence in the request message, and this causes
a NULL dereference. Fix it rejecting any configuration that does not
include this attribute.
Reported-and-tested-by: syzbot+7022ab7c383875c17eff@syzkaller.appspotmail.com
Fixes: dcb780fb2795 ("net: macsec: add nla support for changing the offloading selection")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
---
drivers/net/macsec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index da82d7f16a09..0d580d81d910 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -2594,6 +2594,9 @@ static int macsec_upd_offload(struct sk_buff *skb, struct genl_info *info)
return PTR_ERR(dev);
macsec = macsec_priv(dev);
+ if (!tb_offload[MACSEC_OFFLOAD_ATTR_TYPE])
+ return -EINVAL;
+
offload = nla_get_u8(tb_offload[MACSEC_OFFLOAD_ATTR_TYPE]);
if (macsec->offload == offload)
return 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] macsec: fix NULL dereference in macsec_upd_offload()
2020-04-06 9:38 [PATCH net] macsec: fix NULL dereference in macsec_upd_offload() Davide Caratti
@ 2020-04-06 17:26 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-04-06 17:26 UTC (permalink / raw)
To: dcaratti; +Cc: antoine.tenart, dbogdanov, netdev
From: Davide Caratti <dcaratti@redhat.com>
Date: Mon, 6 Apr 2020 11:38:29 +0200
> macsec_upd_offload() gets the value of MACSEC_OFFLOAD_ATTR_TYPE
> without checking its presence in the request message, and this causes
> a NULL dereference. Fix it rejecting any configuration that does not
> include this attribute.
>
> Reported-and-tested-by: syzbot+7022ab7c383875c17eff@syzkaller.appspotmail.com
> Fixes: dcb780fb2795 ("net: macsec: add nla support for changing the offloading selection")
> Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-06 17:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 9:38 [PATCH net] macsec: fix NULL dereference in macsec_upd_offload() Davide Caratti
2020-04-06 17:26 ` David Miller
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.