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: <CAPXgP12YasX6mBVOamO8Tk1mcFJ04XWh5CjuTRxhRShncgVCtA@mail.gmail.com>
Date:	Thu, 19 Jul 2012 11:38:57 +0200
From:	Kay Sievers <kay@...y.org>
To:	Vivek Goyal <vgoyal@...hat.com>
Cc:	linux kernel mailing list <linux-kernel@...r.kernel.org>,
	Kexec Mailing List <kexec@...ts.infradead.org>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Greg Kroah-Hartmann <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] printk: Export struct log size and member offsets through vmcoreinfo

On Wed, Jul 18, 2012 at 7:56 PM, Vivek Goyal <vgoyal@...hat.com> wrote:
> On Wed, Jul 18, 2012 at 07:27:08PM +0200, Kay Sievers wrote:
>> On Wed, Jul 18, 2012 at 7:18 PM, Vivek Goyal <vgoyal@...hat.com> wrote:
>>
>> > Currently I am not exporting log "level" info as that is a bitfield and
>> > offsetof() bitfields can't be calculated.
>>
>> We could make the level the lower 3 bits of the byte, export the byte,
>> and define that only 3 bits of the byte are valid? Would that help?
>
> Yes, that should work. Here is the prototype patch which stores 5 bits
> of flag and 3 bits of level in a byte. I have not tested it yet, but
> if you like the approach, I will test it.

> -       u8 flags:5;             /* internal record flags */
> -       u8 level:3;             /* syslog level */
> +       u8 flags_level;         /* 5 bit internal record flags, 3 bits syslog

Looks ok.

If we would swap the 5 + 3 bit field byte declaration, and add
__packed, we can still not rely on the level to be consistently the
lower 3 bits of the byte, right?

Thanks,
Kay
--
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