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: <ZjrpieLKXFhklVwR@linux.bj.intel.com>
Date: Wed, 8 May 2024 10:55:05 +0800
From: Tao Su <tao1.su@...ux.intel.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-sound@...r.kernel.org, kvm@...r.kernel.org,
	netdev@...r.kernel.org, linux-rtc@...r.kernel.org,
	linux-sgx@...r.kernel.org, edliaw@...gle.com,
	ivan.orlov0322@...il.com, broonie@...nel.org, perex@...ex.cz,
	tiwai@...e.com, shuah@...nel.org, seanjc@...gle.com,
	pbonzini@...hat.com, bongsu.jeon@...sung.com, davem@...emloft.net,
	edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
	alexandre.belloni@...tlin.com, jarkko@...nel.org,
	dave.hansen@...ux.intel.com
Subject: Re: [PATCH] selftests: Add _GNU_SOURCE definition when including
 kselftest_harness.h

On Tue, May 07, 2024 at 10:06:51AM -0700, Andrew Morton wrote:
> On Tue,  7 May 2024 14:35:34 +0800 Tao Su <tao1.su@...ux.intel.com> wrote:
> 
> > asprintf() is declared in stdio.h when defining _GNU_SOURCE, but stdio.h
> > is so common that many files don’t define _GNU_SOURCE before including
> > stdio.h, and defining _GNU_SOURCE after including stdio.h will no longer
> > take effect.
> > 
> > Since kselftest_harness.h introduces asprintf(), it is necessary to add
> > _GNU_SOURCE definition in all selftests including kselftest_harness.h,
> > otherwise, there will be warnings or even errors during compilation.
> > There are already many selftests that define _GNU_SOURCE or put the
> > include of kselftest_harness.h at the very beginning of the .c file, just
> > add the _GNU_SOURCE definition in the tests that have compilation warnings.
> 
> That asprintf() continues to cause problems.  How about we just remove
> it? Do the malloc(snprintf(str, 0, ...)) separately?

Removing asprintf() is indeed an good option, but using snprintf(str, 0, ...)
to get string size may go against the original intention of commit 38c957f07038.

Back to commit 38c957f07038, I don't see any advantage in using LINE_MAX.
Can we use a fixed value instead of LINE_MAX? E.g., 1024, 2048. Then we
just need to revert commit 809216233555.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ