Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1736227

Re: [PATCH net] net/ncsi: Don't assume last available channel exists

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH net] net/ncsi: Don't assume last available channel exists
Date 2017-09-21 01:10 +0200
Message-ID <urWhX-19i-7@gated-at.bofh.it> (permalink)
References <urEEp-6kH-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Date: Wed, 20 Sep 2017 14:12:51 +1000

> When handling new VLAN tags in NCSI we check the maximum allowed number
> of filters on the last active ("hot") channel. However if the 'add'
> callback is called before NCSI has configured a channel, this causes a
> NULL dereference.
> 
> Check that we actually have a hot channel, and warn if it is missing.
> 
> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>

Well, a few things.

We should not allow this driver method to be invoked in the first
place if the device is not in a state where the operation is legal
yet.

Second of all, if !ndp is true, you should not return 0 to indicate
success.

But more fundamentally, we should block this method from being
callable unless the device is in the proper state and can complete the
operation.

Seriously, these checks should be completely unnecessary if those
issues are handled properly.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net] net/ncsi: Don't assume last available channel exists Samuel Mendoza-Jonas <sam@mendozajonas.com> - 2017-09-20 06:20 +0200
  Re: [PATCH net] net/ncsi: Don't assume last available channel  exists David Miller <davem@davemloft.net> - 2017-09-21 01:10 +0200
    Re: [PATCH net] net/ncsi: Don't assume last available channel exists Samuel Mendoza-Jonas <sam@mendozajonas.com> - 2017-09-22 03:10 +0200
      Re: [PATCH net] net/ncsi: Don't assume last available channel  exists David Miller <davem@davemloft.net> - 2017-09-22 03:20 +0200

csiph-web