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]
Message-ID: <alpine.OSX.2.21.1912131555280.38100@amhui-mobl1.amr.corp.intel.com>
Date:   Fri, 13 Dec 2019 16:06:19 -0800 (PST)
From:   Mat Martineau <mathew.j.martineau@...ux.intel.com>
To:     Eric Dumazet <eric.dumazet@...il.com>
cc:     netdev@...r.kernel.org, mptcp@...ts.01.org
Subject: Re: [PATCH net-next 02/11] sock: Make sk_protocol a 16-bit value


On Fri, 13 Dec 2019, Eric Dumazet wrote:

>
>
> On 12/13/19 3:00 PM, Mat Martineau wrote:
>> Match the 16-bit width of skbuff->protocol. Fills an 8-bit hole so
>> sizeof(struct sock) does not change.
>>
>> Signed-off-by: Mat Martineau <mathew.j.martineau@...ux.intel.com>
>> ---
>>  include/net/sock.h          | 4 ++--
>>  include/trace/events/sock.h | 2 +-
>>  2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/net/sock.h b/include/net/sock.h
>> index 81dc811aad2e..9dd225f62012 100644
>> --- a/include/net/sock.h
>> +++ b/include/net/sock.h
>> @@ -456,10 +456,10 @@ struct sock {
>>  				sk_no_check_tx : 1,
>>  				sk_no_check_rx : 1,
>>  				sk_userlocks : 4,
>> -				sk_protocol  : 8,
>> +				sk_pacing_shift : 8,
>>  				sk_type      : 16;
>> +	u16			sk_protocol;
>>  	u16			sk_gso_max_segs;
>> -	u8			sk_pacing_shift;
>
> Unfortunately sk_pacing_shift must not be a bit field.
>
> I have a patch to add proper READ_ONCE()/WRITE_ONCE() on it,
> since an update can be done from a lockless context ( sk_pacing_shift_update())

Ok, thanks for noting this. I'll remove the change to sk_pacing_shift.

--
Mat Martineau
Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ