[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b7c3a0be-00c6-4add-a3da-3c6195e47b7e@redhat.com>
Date: Mon, 18 Mar 2024 11:02:39 +0100
From: David Hildenbrand <david@...hat.com>
To: Vitaly Chikunov <vt@...linux.org>,
Andrew Morton <akpm@...ux-foundation.org>, Keith Busch <kbusch@...nel.org>,
Yang Shi <shy828301@...il.com>, Zi Yan <ziy@...dia.com>,
Peter Xu <peterx@...hat.com>, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Andrea Arcangeli <aarcange@...hat.com>, Nadav Amit
<nadav.amit@...il.com>, Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH] selftests/mm: Fix build with _FORTIFY_SOURCE
On 18.03.24 03:34, Vitaly Chikunov wrote:
> Add missing flags argument to open(2) call with O_CREAT.
>
> Some tests fail to compile if _FORTIFY_SOURCE is defined (to any valid
> value) (together with -O), resulting in similar error messages such as:
>
> In file included from /usr/include/fcntl.h:342,
> from gup_test.c:1:
> In function 'open',
> inlined from 'main' at gup_test.c:206:10:
> /usr/include/bits/fcntl2.h:50:11: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
> 50 | __open_missing_mode ();
> | ^~~~~~~~~~~~~~~~~~~~~~
>
> _FORTIFY_SOURCE is enabled by default in some distributions, so the
> tests are not built by default and are skipped.
>
> open(2) man-page warns about missing flags argument: "if it is not
> supplied, some arbitrary bytes from the stack will be applied as the
> file mode."
>
> Fixes: aeb85ed4f41a ("tools/testing/selftests/vm/gup_benchmark.c: allow user specified file")
> Fixes: fbe37501b252 ("mm: huge_memory: debugfs for file-backed THP split")
> Fixes: c942f5bd17b3 ("selftests: soft-dirty: add test for mprotect")
> Cc: Keith Busch <kbusch@...nel.org>
> Cc: Zi Yan <ziy@...dia.com>
> Cc: Peter Xu <peterx@...hat.com>
> Cc: Yang Shi <shy828301@...il.com>
> Cc: Andrea Arcangeli <aarcange@...hat.com>
> Cc: Nadav Amit <nadav.amit@...il.com>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Vitaly Chikunov <vt@...linux.org>
> ---
Reviewed-by: David Hildenbrand <david@...hat.com>
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists