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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 10 Jul 2018 15:55:32 +0000
From:   Ioana Ciocoi Radulescu <ruxandra.radulescu@....com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
CC:     "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Ioana Ciornei <ioana.ciornei@....com>
Subject: RE: [PATCH 5/5] staging: fsl-dpaa2/eth: Remove Rx frame size check

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@...cle.com]
> Sent: Monday, July 9, 2018 10:28 PM
> To: Ioana Ciocoi Radulescu <ruxandra.radulescu@....com>
> Cc: gregkh@...uxfoundation.org; devel@...verdev.osuosl.org; linux-
> kernel@...r.kernel.org; Ioana Ciornei <ioana.ciornei@....com>
> Subject: Re: [PATCH 5/5] staging: fsl-dpaa2/eth: Remove Rx frame size check
> 
> On Mon, Jul 09, 2018 at 10:01:11AM -0500, Ioana Radulescu wrote:
> > @@ -2385,6 +2365,12 @@ static int netdev_init(struct net_device
> *net_dev)
> >
> >  	/* Set MTU upper limit; lower limit is 68B (default value) */
> >  	net_dev->max_mtu = DPAA2_ETH_MAX_MTU;
> > +	err = dpni_set_max_frame_length(priv->mc_io, 0, priv->mc_token,
> > +					(u16)DPAA2_ETH_MFL);
> 
> The cast was there in the original code so this is not a comment on this
> particular patch (which seems fine) but there is no need to cast.
> 
> Generally it's best to avoid unnecessary casts.  As a human reader, I
> find the cast confusing.  It indicates that DPAA2_ETH_MFL somehow
> requires special handling.  Perhaps it's negative or we are trying to
> truncate away the high bits.  But neither of those things really make
> sense.
> 
> From a static analysis perspective if DPAA2_ETH_MFL doesn't fit nicely
> then we would want to generate a warning.  But the cast explicitly
> disables the check.

I really don't remember why the cast was there in the first place.
It doesn't look like it's needed anymore, DPAA2_ETH_MFL has a
positive value (around 10K) that fits just fine inside a u16.

I see Greg already applied the patch, so I'll send a separate one to
remove the cast.

Thanks,
Ioana

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ