linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] selftests/mm: Fix build with _FORTIFY_SOURCE
       [not found] <20240318023445.3192922-1-vt@altlinux.org>
@ 2024-03-18  2:59 ` Zi Yan
  2024-03-18 10:02 ` David Hildenbrand
  1 sibling, 0 replies; 2+ messages in thread
From: Zi Yan @ 2024-03-18  2:59 UTC (permalink / raw)
  To: Vitaly Chikunov
  Cc: Andrew Morton, Keith Busch, Yang Shi, David Hildenbrand, Peter Xu,
	linux-mm, linux-kselftest, linux-kernel, Andrea Arcangeli,
	Nadav Amit, Shuah Khan

[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]

On 17 Mar 2024, at 22: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@kernel.org>
> Cc: Zi Yan <ziy@nvidia.com>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Yang Shi <shy828301@gmail.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Nadav Amit <nadav.amit@gmail.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
> ---
>  tools/testing/selftests/mm/gup_test.c             | 2 +-
>  tools/testing/selftests/mm/soft-dirty.c           | 2 +-
>  tools/testing/selftests/mm/split_huge_page_test.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)

LGTM. Thanks. Reviewed-by: Zi Yan <ziy@nvidia.com>

--
Best Regards,
Yan, Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests/mm: Fix build with _FORTIFY_SOURCE
       [not found] <20240318023445.3192922-1-vt@altlinux.org>
  2024-03-18  2:59 ` [PATCH] selftests/mm: Fix build with _FORTIFY_SOURCE Zi Yan
@ 2024-03-18 10:02 ` David Hildenbrand
  1 sibling, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2024-03-18 10:02 UTC (permalink / raw)
  To: Vitaly Chikunov, Andrew Morton, Keith Busch, Yang Shi, Zi Yan,
	Peter Xu, linux-mm, linux-kselftest, linux-kernel
  Cc: Andrea Arcangeli, Nadav Amit, Shuah Khan

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@kernel.org>
> Cc: Zi Yan <ziy@nvidia.com>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Yang Shi <shy828301@gmail.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Nadav Amit <nadav.amit@gmail.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
> ---

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-18 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240318023445.3192922-1-vt@altlinux.org>
2024-03-18  2:59 ` [PATCH] selftests/mm: Fix build with _FORTIFY_SOURCE Zi Yan
2024-03-18 10:02 ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).