diff options
| author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2018-12-30 07:33:20 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-12-30 14:35:36 -0500 |
| commit | f989d03ef25df3fc26d3ea0fe7c19c9830577166 (patch) | |
| tree | 949313d43808a2f758ea52cf82c072e6988f2769 /net | |
| parent | f7d18ef6a95f399544d7b767291980cecddc32eb (diff) | |
net: rtnetlink: address is mandatory for rtnl_fdb_get
We must have an address to lookup otherwise we'll derefence a null
pointer in the ndo_fdb_get callbacks.
CC: Roopa Prabhu <roopa@cumulusnetworks.com>
CC: David Ahern <dsa@cumulusnetworks.com>
Reported-by: syzbot+017b1f61c82a1c3e7efd@syzkaller.appspotmail.com
Fixes: 5b2f94b27622 ("net: rtnetlink: support for fdb get")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
| -rw-r--r-- | net/core/rtnetlink.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 48f61885fd6f..5ea1bed08ede 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
| @@ -4104,6 +4104,11 @@ static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh, | |||
| 4104 | if (err < 0) | 4104 | if (err < 0) |
| 4105 | return err; | 4105 | return err; |
| 4106 | 4106 | ||
| 4107 | if (!addr) { | ||
| 4108 | NL_SET_ERR_MSG(extack, "Missing lookup address for fdb get request"); | ||
| 4109 | return -EINVAL; | ||
| 4110 | } | ||
| 4111 | |||
| 4107 | if (brport_idx) { | 4112 | if (brport_idx) { |
| 4108 | dev = __dev_get_by_index(net, brport_idx); | 4113 | dev = __dev_get_by_index(net, brport_idx); |
| 4109 | if (!dev) { | 4114 | if (!dev) { |
