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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 19 May 2017 17:41:17 -0400 (EDT)
From:   David Miller <davem@...emloft.net>
To:     firogm@...il.com
Cc:     t.sailer@...mni.ethz.ch, wharms@....de, andreyknvl@...gle.com,
        linux-hams@...r.kernel.org, gregkh@...uxfoundation.org,
        netdev@...r.kernel.org
Subject: Re: [PATCH v2] hdlcdrv: fix divide error bug if bitrate is 0

From: Firo Yang <firogm@...il.com>
Date: Fri, 19 May 2017 21:21:46 +0800

> @@ -576,6 +576,10 @@ static int hdlcdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
>  	case HDLCDRVCTL_CALIBRATE:
>  		if(!capable(CAP_SYS_RAWIO))
>  			return -EPERM;
> +		if (!netif_running(dev))
> +			return -ENODEV;
> +		if (!(s->par.bitrate > 0))
> +			return -EINVAL;

This test is so un-canonical and convoluted.

Please use something more straightforward.  I really think Alan
Cox's patch handled this more cleanly.  Make the test something
like "if (x <= 0) return -EINVAL;".

I also am not convinced about the netif_running() test and at
best it is a separate change from this divide by zero bug fix
so belongs in a separate patch.

Thank you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ