[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <92170809-c45e-4b39-09b7-37b28b05d479@wifirst.fr>
Date: Thu, 8 Oct 2020 16:49:52 +0200
From: Florent Fourcot <florent.fourcot@...irst.fr>
To: Eric Dumazet <eric.dumazet@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] neigh: add netlink filtering based on LLADDR for
dump
Hello Éric,
>> + if (memcmp(lladdr, neigh->ha, neigh->dev->addr_len) != 0)
>
> Where do you check that lladdr contains exactly neigh->dev->addr_len bytes ?
True, I do not check. I had some doubt about the best implementation,
since we could do:
* exact matching
* prefix matching (with a memcmp on length of lladdr)
Do you may have an opinion on the best choice?
>> + case NDA_LLADDR:
>> + filter->lladdr = nla_data(tb[i]);
>
> This comes from user space, and could contains an arbitrary amount of bytes, like 0 byte.
>
> You probably have to store the full attribute, so that you can use nla_len() and nla_data()
>
I will send a v2.
By the way, it looks like neigh_add() function never check if NDA_LLADDR
length is greater than dev->addr_len (it only rejects smaller values).
Should we add a check on it? I do not see any impact today, except than
user does not receive an error on invalid data, it will configure an
entry anyway.
Thanks,
--
Florent.
Powered by blists - more mailing lists