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]
Message-ID: <20110623134209.GA10813@elliptictech.com>
Date:	Thu, 23 Jun 2011 09:42:09 -0400
From:	Nick Bowler <nbowler@...iptictech.com>
To:	Markus Trippelsdorf <markus@...ppelsdorf.de>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Mike Frysinger <vapier@...too.org>,
	Sam Ravnborg <sam@...nborg.org>,
	Artem Bityutskiy <Artem.Bityutskiy@...ia.com>
Subject: Re: __packed vs. __attribute__((packed)) in kernel headers

On 2011-06-22 08:34 +0200, Markus Trippelsdorf wrote:
> One possible solution would be to let the "scripts/headers_install.pl"
> script automatically substitute __packed with __attribute__((packed)):
> 
> diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
> index efb3be1..e0dc065 100644
> --- a/scripts/headers_install.pl
> +++ b/scripts/headers_install.pl
> @@ -35,6 +35,7 @@ foreach my $file (@files) {
>  		$line =~ s/([\s(])__iomem\s/$1/g;
>  		$line =~ s/\s__attribute_const__\s/ /g;
>  		$line =~ s/\s__attribute_const__$//g;
> +		$line =~ s/\s__packed/__attribute__((packed))/g;
>  		$line =~ s/^#include <linux\/compiler.h>//;
>  		$line =~ s/(^|\s)(inline)\b/$1__$2__/g;
>  		$line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
> 
> Any thoughts?

Without any comment on the approach itself, the above change will eat a
space character before __packed, which may break the header by merging a
preceding token into the __attribute__.  It may also change instances of
__packed that occur as a prefix of a longer token.

Note that the __attribute_const__ lines above it take some care to avoid
both of these situations.

Cheers,
-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ