Bug 217508 - Started to get "memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL"
Summary: Started to get "memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL"
Status: RESOLVED CODE_FIX
Alias: None
Product: Linux
Classification: Unclassified
Component: Kernel (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: Virtual assignee for kernel bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-30 06:48 UTC by Stuart Foster
Modified: 2023-06-02 07:14 UTC (History)
2 users (show)

See Also:
Kernel Version: 6.3
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Xorg Log file (35.37 KB, text/plain)
2023-05-30 09:17 UTC, Stuart Foster
Details
dmesg from kernel 6.3.4 (71.38 KB, text/plain)
2023-05-30 09:18 UTC, Stuart Foster
Details
Bisect log (5.19 KB, text/plain)
2023-05-31 09:22 UTC, Stuart Foster
Details

Description Stuart Foster 2023-05-30 06:48:08 UTC
Recent kernels seem to generate this:

"memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=3976 'Xorg'"

Is this a kernel problem or something to do with Xorg ?

Seen in Kernels 6.3.4 and 6.4.0-rc4.

Thanks
Comment 1 Bagas Sanjaya 2023-05-30 08:59:36 UTC
(In reply to Stuart Foster from comment #0)
> Recent kernels seem to generate this:
> 
> "memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=3976 'Xorg'"
> 
> Is this a kernel problem or something to do with Xorg ?
> 
> Seen in Kernels 6.3.4 and 6.4.0-rc4.
> 
> Thanks

What is your dmesg? Xorg logs? Can you describe your hardware setup?
Comment 2 Stuart Foster 2023-05-30 09:16:23 UTC
Hardware is:

AMD FX-8370 Eight-Core Processor with Oland PRO [Radeon R7 240/340 / Radeon 520]

The os is a recent LFS/BLFS system.

Logs to follow.
Comment 3 Stuart Foster 2023-05-30 09:17:04 UTC
Created attachment 304356 [details]
Xorg Log file
Comment 4 Stuart Foster 2023-05-30 09:18:14 UTC
Created attachment 304357 [details]
dmesg from kernel 6.3.4
Comment 5 Bagas Sanjaya 2023-05-30 10:09:21 UTC
(In reply to Stuart Foster from comment #0)
> Recent kernels seem to generate this:
> 
> "memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=3976 'Xorg'"
> 
> Is this a kernel problem or something to do with Xorg ?
> 
> Seen in Kernels 6.3.4 and 6.4.0-rc4.

Is this issue also occur on older kernels?
Comment 6 Stuart Foster 2023-05-30 15:24:14 UTC
Does not occur on 6.2.15 which is the kernel I used prior to moving to 6.3.4
Comment 7 Stuart Foster 2023-05-30 22:07:12 UTC
Back tracking 6.2.16 is Ok, 6.3.0 has the problem. I will bisect and see if I can find the root cause.
Comment 8 Stuart Foster 2023-05-31 09:22:24 UTC
Created attachment 304359 [details]
Bisect log

Result of the bisect:

Bisecting: 0 revisions left to test after this (roughly 0 steps)
[32d118ad50a5afecb74358bcefc5cb6ea6ccfc2b] selftests/memfd: add tests for F_SEAL_EXEC
105ff5339f498af74e60d7662c8f1c4d21f1342d is the first bad commit
commit 105ff5339f498af74e60d7662c8f1c4d21f1342d
Author: Jeff Xu <jeffxu@google.com>
Comment 9 Stuart Foster 2023-06-01 15:22:26 UTC
Comments received in e-mails:

Vlastimil Babka wrote:

Hm indeed it seems to have introduced 2 new flags and immediately warn if
any process doesn't use them. Maybe it would make sense for some of the
non-default values of vm.memfd_noexec, but it's too early to warn
unconditionally everywhere, no?

Kees reply:

This is pretty standard for getting new options like this noticed by
userspace -- there is no regression in _behavior_. It's just a reminder
to fix userspace code.
Comment 10 Bagas Sanjaya 2023-06-02 02:13:36 UTC
(In reply to Stuart Foster from comment #9)
> Comments received in e-mails:
> 
> Vlastimil Babka wrote:
> 
> Hm indeed it seems to have introduced 2 new flags and immediately warn if
> any process doesn't use them. Maybe it would make sense for some of the
> non-default values of vm.memfd_noexec, but it's too early to warn
> unconditionally everywhere, no?
> 
> Kees reply:
> 
> This is pretty standard for getting new options like this noticed by
> userspace -- there is no regression in _behavior_. It's just a reminder
> to fix userspace code.

Can you file bug against Xorg to your distro's bug tracker?
Comment 11 Stuart Foster 2023-06-02 07:10:34 UTC
On 02/06/2023 03:13, bugzilla-daemon@kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=217508
> 
> --- Comment #10 from Bagas Sanjaya (bagasdotme@gmail.com) ---
> (In reply to Stuart Foster from comment #9)
>> Comments received in e-mails:
>>
>> Vlastimil Babka wrote:
>>
>> Hm indeed it seems to have introduced 2 new flags and immediately warn if
>> any process doesn't use them. Maybe it would make sense for some of the
>> non-default values of vm.memfd_noexec, but it's too early to warn
>> unconditionally everywhere, no?
>>
>> Kees reply:
>>
>> This is pretty standard for getting new options like this noticed by
>> userspace -- there is no regression in _behavior_. It's just a reminder
>> to fix userspace code.
> 
> Can you file bug against Xorg to your distro's bug tracker?
> 
Yes I have done that all ready.
Comment 12 Stuart Foster 2023-06-02 07:14:03 UTC
Raised the issue with Xorg:

https://gitlab.freedesktop.org/xorg/xserver/-/issues/1553

Note You need to log in before you can comment on or make changes to this bug.