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: <ZrO88YnT8vg5oQGz@bergen>
Date: Wed, 7 Aug 2024 20:29:05 +0200
From: Nicolas Schier <nicolas@...sle.eu>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
	Daniel Gomez <da.gomez@...sung.com>,
	Ard Biesheuvel <ardb@...nel.org>,
	Nathan Chancellor <nathan@...nel.org>
Subject: Re: [PATCH] kbuild: avoid scripts/kallsyms parsing /dev/null

On Thu 08 Aug 2024 03:03:00 GMT, Masahiro Yamada wrote:
> On macOS, getline() sets ENOTTY to errno if it is requested to read
> from /dev/null.
> 
> If this is worth fixing, I would rather pass an empty file to
> scripts/kallsyms instead of adding the ugly #ifdef __APPLE__.
> 
> Fixes: c442db3f49f2 ("kbuild: remove PROVIDE() for kallsyms symbols")
> Reported-by: Daniel Gomez <da.gomez@...sung.com>
> Closes: https://lore.kernel.org/all/20240807-macos-build-support-v1-12-4cd1ded85694@samsung.com/
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
> 
>  scripts/link-vmlinux.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> index f7b2503cdba9..41c68ae3415d 100755
> --- a/scripts/link-vmlinux.sh
> +++ b/scripts/link-vmlinux.sh
> @@ -219,7 +219,8 @@ kallsymso=
>  strip_debug=
>  
>  if is_enabled CONFIG_KALLSYMS; then
> -	kallsyms /dev/null .tmp_vmlinux0.kallsyms
> +	truncate -s0 .tmp_vmlinux.kallsyms0.syms
> +	kallsyms .tmp_vmlinux.kallsyms0.syms .tmp_vmlinux0.kallsyms
>  fi
>  
>  if is_enabled CONFIG_KALLSYMS || is_enabled CONFIG_DEBUG_INFO_BTF; then
> -- 
> 2.43.0
> 
> 

Thanks!  I definitely support moving special MacOS support from source 
code into scripts and Makefiles.

Might you want to add a comment to truncate, to prevent accidental 
attempts to revert/refactor this?

Reviewed-by: Nicolas Schier <nicolas@...sle.eu>

Kind regards,
Nicolas

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ