Re: [Bridge] [PATCH] net: bridge: check for a null p->dev before dereferencing it

2018-11-24 Thread David Miller
From: Nikolay Aleksandrov Date: Sat, 24 Nov 2018 14:21:07 +0200 > I was contacted recently about this privately and this was my reply: > "Checking new_nbp() and del_nbp() it should not be possible to reach that code > with p->dev or p->br as NULL. The cap check code has always been there, I just

Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options

2018-11-24 Thread nikolay
On 24 November 2018 18:25:41 EET, Andrew Lunn wrote: >On Sat, Nov 24, 2018 at 06:18:33PM +0200, niko...@cumulusnetworks.com >wrote: >> On 24 November 2018 18:10:41 EET, Andrew Lunn wrote: >> >> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id >opt, >> >bool on, >> >> +

Re: [Bridge] [PATCH net-next v2 2/3] net: bridge: add no_linklocal_learn bool option

2018-11-24 Thread Andrew Lunn
On Sat, Nov 24, 2018 at 04:34:21AM +0200, Nikolay Aleksandrov wrote: > Use the new boolopt API to add an option which disables learning from > link-local packets. The default is kept as before and learning is > enabled. This is a simple map from a boolopt bit to a bridge private > flag that is

Re: [Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts

2018-11-24 Thread Andrew Lunn
On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote: > Now that we have at least one bool option, we can export all of the > supported bool options via optmask when dumping them. > > v2: new patch > > Signed-off-by: Nikolay Aleksandrov Reviewed-by: Andrew Lunn Andrew

Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options

2018-11-24 Thread Andrew Lunn
On Sat, Nov 24, 2018 at 06:18:33PM +0200, niko...@cumulusnetworks.com wrote: > On 24 November 2018 18:10:41 EET, Andrew Lunn wrote: > >> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, > >bool on, > >> +struct netlink_ext_ack *extack) > >> +{ > >> + switch

Re: [Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts

2018-11-24 Thread nikolay
On 24 November 2018 18:16:47 EET, Andrew Lunn wrote: >On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote: >> Now that we have at least one bool option, we can export all of the >> supported bool options via optmask when dumping them. >> >Hi Nik > >That answers my question

Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options

2018-11-24 Thread nikolay
On 24 November 2018 18:10:41 EET, Andrew Lunn wrote: >> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, >bool on, >> + struct netlink_ext_ack *extack) >> +{ >> +switch (opt) { >> +default: >> +/* shouldn't be called with unsupported

Re: [Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts

2018-11-24 Thread Andrew Lunn
On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote: > Now that we have at least one bool option, we can export all of the > supported bool options via optmask when dumping them. > Hi Nik That answers my question then... I'm assuming this means there is no easy way to generate a

Re: [Bridge] [PATCH] net: bridge: check for a null p->dev before dereferencing it

2018-11-24 Thread Nikolay Aleksandrov
On 24/11/2018 14:15, Colin King wrote: > From: Colin Ian King > > A recent change added a null check on p->dev after p->dev was being > dereferenced by the ns_capable check on p->dev. Fix this by performing > the p->dev sanity check before it is dereferenced. > > Detected by CoverityScan,

[Bridge] [PATCH] net: bridge: check for a null p->dev before dereferencing it

2018-11-24 Thread Colin King
From: Colin Ian King A recent change added a null check on p->dev after p->dev was being dereferenced by the ns_capable check on p->dev. Fix this by performing the p->dev sanity check before it is dereferenced. Detected by CoverityScan, CID#751490 ("Dereference before null check") Fixes: