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:   Thu, 09 Sep 2021 16:27:21 +0100 (BST)
From:   David Miller <davem@...emloft.net>
To:     linux@...ck-us.net
Cc:     ajk@...nets.uni-bremen.de, kuba@...nel.org,
        linux-hams@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: 6pack: Fix tx timeout and slot time

From: Guenter Roeck <linux@...ck-us.net>
Date: Thu, 9 Sep 2021 07:53:29 -0700

> On 9/9/21 4:34 AM, David Miller wrote:
>> From: Guenter Roeck <linux@...ck-us.net>
>> Date: Wed,  8 Sep 2021 20:57:43 -0700
>> 
>>> tx timeout and slot time are currently specified in units of HZ.
>>> On Alpha, HZ is defined as 1024. When building alpha:allmodconfig,
>>> this results in the following error message.
>>>
>>> drivers/net/hamradio/6pack.c: In function 'sixpack_open':
>>> drivers/net/hamradio/6pack.c:71:41: error:
>>> 	unsigned conversion from 'int' to 'unsigned char'
>>> 	changes value from '256' to '0'
>>>
>>> In the 6PACK protocol, tx timeout is specified in units of 10 ms
>>> and transmitted over the wire. Defining a value dependent on HZ
>>> doesn't really make sense. Assume that the intent was to set tx
>>> timeout and slot time based on a HZ value of 100 and use constants
>>> instead of values depending on HZ for SIXP_TXDELAY and SIXP_SLOTTIME.
>>>
>>> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
>>> ---
>>> No idea if this is correct or even makes sense. Compile tested only.
>> These are timer offsets so they have to me HZ based.  Better to make
>> the
>> structure members unsigned long, I think.
>> 
> 
> Hmm, ok. Both tx_delay and slottime are updated in sp_encaps(),
> though,
> from data in the transmit buffer. The KISS protocol description states
> that the values are in units of 10ms; that is where my assumption
> came from.

They are ms and must be converted using to HZ in order to use the values as timer offsets.

The values are perfectly fine, the types used to store them need to be fixed.

> Anyway, I am inclined to just mark the protocol as dependent on
> !ALPHA. Would you accept that ?

No, fix this properly.  Make the unsigfned char members be unsigned long.

Why do you not want to fix it this way?

Thank you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ