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:	Wed, 2 Mar 2016 07:10:10 +0100
From:	Oliver Hartkopp <socketcan@...tkopp.net>
To:	Marek Vasut <marex@...x.de>, linux-can@...r.kernel.org
Cc:	netdev@...r.kernel.org, Marc Kleine-Budde <mkl@...gutronix.de>,
	Mark Rutland <mark.rutland@....com>,
	Wolfgang Grandegger <wg@...ndegger.com>
Subject: Re: [PATCH 3/4] net: can: ifi: Fix RX and TX ID mask

Hi Marek,

On 03/01/2016 10:23 PM, Marek Vasut wrote:
> On 03/01/2016 06:49 PM, Oliver Hartkopp wrote:


>>> -#define IFI_CANFD_RXFIFO_ID_ID_STD_MASK		0x3ff
>>> +#define IFI_CANFD_RXFIFO_ID_ID_STD_MASK		0x7ff
>>>  #define IFI_CANFD_RXFIFO_ID_ID_XTD_MASK		0x1fffffff
>>
>> You should use the CAN_SFF_MASK and CAN_EFF_MASK in your code instead of
>> defining you private IFI_CANFD_RXFIFO_ID_ID_?TD_MASK definitions.
>>
>> You won't have trapped into this problem then :-)
> 
> These are register bitfield definitions, so should I really ?
> 
> My OCD kicks in and tells me it'd be odd and inconsistent with the rest
> of the bitfields, but if you prefer it that way, I'll just send an
> updated patch.
> 

Your bit mask is masking the CAN ID out of a given variable.
That's what CAN_SFF_MASK and CAN_EFF_MASK is made for.

So at least it should be:

#define IFI_CANFD_RXFIFO_ID_ID_STD_MASK		CAN_SFF_MASK
#define IFI_CANFD_RXFIFO_ID_ID_XTD_MASK		CAN_EFF_MASK

Btw. These defines are _never_ referenced in ifi_canfd.c so they should be
removed anyway.

Regards,
Oliver

Powered by blists - more mailing lists