lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 24 Jun 2019 09:26:04 +0200 From: Michal Kubecek <mkubecek@...e.cz> To: netdev@...r.kernel.org Cc: Shannon Nelson <snelson@...sando.io> Subject: Re: [PATCH net-next 13/18] ionic: Add initial ethtool support On Fri, Jun 21, 2019 at 03:30:20PM -0700, Shannon Nelson wrote: > On 6/20/19 7:32 PM, Michal Kubecek wrote: > > On Thu, Jun 20, 2019 at 01:24:19PM -0700, Shannon Nelson wrote: > > > + if (ring->tx_pending > IONIC_MAX_TXRX_DESC || > > > + ring->tx_pending < IONIC_MIN_TXRX_DESC || > > > + ring->rx_pending > IONIC_MAX_TXRX_DESC || > > > + ring->rx_pending < IONIC_MIN_TXRX_DESC) { > > > + netdev_info(netdev, "Descriptors count must be in the range [%d-%d]\n", > > > + IONIC_MIN_TXRX_DESC, IONIC_MAX_TXRX_DESC); > > > + return -EINVAL; > > > + } > > The upper bounds have been already checked in ethtool_set_ringparam() so > > that the two conditions can never be satisfied here. > > > > ... > > > +static int ionic_set_channels(struct net_device *netdev, > > > + struct ethtool_channels *ch) > > > +{ > > > + struct lif *lif = netdev_priv(netdev); > > > + bool running; > > > + > > > + if (!ch->combined_count || ch->other_count || > > > + ch->rx_count || ch->tx_count) > > > + return -EINVAL; > > > + > > > + if (ch->combined_count > lif->ionic->ntxqs_per_lif) > > > + return -EINVAL; > > This has been already checked in ethtool_set_channels(). > > That's what I get for copying from an existing driver. I'll check those and > clean them up. The checks in general code were only added recently so most drivers probably still have their own checks. Michal Kubecek
Powered by blists - more mailing lists