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: <ZYG7y0A0lzzN0GqR@smile.fi.intel.com>
Date: Tue, 19 Dec 2023 17:50:35 +0200
From: Andy Shevchenko <andy@...nel.org>
To: tanzirh@...gle.com
Cc: Kees Cook <keescook@...omium.org>, linux-hardening@...r.kernel.org,
	linux-kernel@...r.kernel.org, Nick DeSaulniers <nnn@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>, llvm@...ts.linux.dev,
	Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH v3 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

On Mon, Dec 18, 2023 at 06:44:47PM +0000, tanzirh@...gle.com wrote:
> This patch creates wordpart.h and includes it in asm/word-at-a-time.h
> for the all architectures. WORD_AT_A_TIME_CONSTANTS depends on kernel.h
> because of REPEAT_BYTE. Moving this to another header and including it
> where necessary allows us to not include the bloated kernel.h. Making
> this implicit dependancy on REPEAT_BYTE explicit allows for later
> improvements in the lib/string.c inclusion list.

...

>  #include <linux/kernel.h>
> +#include <linux/wordpart.h>

Expected is to get rid of kernel.h completely.
For instance, in arch/arm/include/asm/word-at-a-time.h case this
should become:

#include <linux/bitops.h>
#include <linux/wordpart.h>

(Briefly looking the same is for include/asm-generic/word-at-a-time.h)

And so on...

...

> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -39,13 +39,6 @@

> -/**
> - * REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value
> - * @x: value to repeat
> - *
> - * NOTE: @x is not checked for > 0xff; larger values produce odd results.
> - */
> -#define REPEAT_BYTE(x)	((~0ul / 0xff) * (x))

Okay, we don't back include because we changing all the users at once.

...

> +++ b/include/linux/wordpart.h
> @@ -0,0 +1,17 @@
> +/* SPDX-License-Identifier: GPL-2.0 */

> +/*
> + * Copyright (C) 2023 Google LLC <tanzirh@...gle.com>
> + */

Can be on a single line.

Is it? Personally I skip this from the split headers, but I'm not your lawyer.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ