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, 26 Feb 2015 11:31:00 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Eyal Birger' <eyal.birger@...il.com>,
	"davem@...emloft.net" <davem@...emloft.net>
CC:	"willemb@...gle.com" <willemb@...gle.com>,
	"edumazet@...gle.com" <edumazet@...gle.com>,
	"shmulik.ladkani@...il.com" <shmulik.ladkani@...il.com>,
	"marcel@...tmann.org" <marcel@...tmann.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH net-next 2/7] net: bluetooth: compact struct bt_skb_cb
 by converting boolean fields to bit fields

From: Eyal Birger
> On 64 bit systems, struct bt_skb_cb size is padded by 6 bytes in order
> to reach 8 byte alignment.
> Convert boolean fields force_active, incoming and req_start to bit fields
> in order to eliminate the padding.
...
> +++ b/include/net/bluetooth/bluetooth.h
...
>  struct bt_skb_cb {
>  	__u8 pkt_type;
> -	__u8 incoming;
>  	__u16 opcode;
>  	__u16 expect;
> -	__u8 force_active;
> -	bool req_start;
> +	__u8 force_active:1;
> +	__u8 incoming:1;
> +	__u8 req_start:1;
>  	u8 req_event;
>  	hci_req_complete_t req_complete;
>  	struct l2cap_chan *chan;

You've generated some pad bytes, best to put everything on its natural alignment.
The old version had req_complete at offset 9, the new one at offset 8.
Not sure how this removes 6 bytes of pad.

	David


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ