Skip to contentSkip to conversation

selftests/memfd: Fix unknown type name build failure

PATCH In review Hardik Garg 4 participants 6 messages May 26, 2023 – May 28, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/memfd: Fix unknown type name build failure

Partially backport v6.3 commit 11f75a01448f ("selftests/memfd: add tests for MFD_NOEXEC_SEAL MFD_EXEC") to fix an unknown type name build error.
In some systems, the __u64 typedef is not present due to differences in system headers, causing compilation errors like this one:

fuse_test.c:64:8: error: unknown type name '__u64'
64 | static __u64 mfd_assert_get_seals(int fd)

This header includes the __u64 typedef which increases the likelihood of successful compilation on a wider variety of systems.

---
 tools/testing/selftests/memfd/fuse_test.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/memfd/fuse_test.c +1 -0
index be675002f918..93798c8c5d54 100644
@@ -22,6 +22,7 @@
 #include <linux/falloc.h>
 #include <fcntl.h>
 #include <linux/memfd.h>
+#include <linux/types.h>
 #include <sched.h>
 #include <stdio.h>
 #include <stdlib.h>
Signature · 1 line
2.25.1
#1 lore raw
FYI: kernel test robot notices the stable kernel rule is not satisfied.

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

Rule: 'Cc: [email protected]' or 'commit <sha1> upstream.'
Subject: [PATCH 6.1 5.15 5.10 5.4 4.19 4.14] selftests/memfd: Fix unknown type name build failure

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

Please ignore this mail if the patch is not relevant for upstream.

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#2 lore raw
Quoted 6 lines · kernel test robot

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

Quoted 7 lines

Rule: 'Cc: [email protected]' or 'commit <sha1> upstream.'
Subject: [PATCH 6.1 5.15 5.10 5.4 4.19 4.14] selftests/memfd: Fix unknown type name build failure

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

Please ignore this mail if the patch is not relevant for upstream.

I think Hardik did the right thing here. This is a build failure bug that's present in stable kernels but was fixed in upstream by an unrelated commit:

11f75a01448f ("selftests/memfd: add tests for MFD_NOEXEC_SEAL MFD_EXEC")

It wouldn't be right to backport that patch because MFD_NOEXEC_SEAL and MFD_EXEC weren't introduced until v6.3.

There was an (unmerged) attempt to fix this specific build failure in upstream:

https://lore.kernel.org/all/[email protected]/

Hardik opted to follow what was done upstream in a patch specifically for the stable tree.

Tyler

Quoted 7 lines
Signature · 3 lines
-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#3 lore raw
Quoted 24 lines · Tyler Hicks
Quoted 6 lines · kernel test robot

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

Quoted 7 lines

Rule: 'Cc: [email protected]' or 'commit <sha1> upstream.'
Subject: [PATCH 6.1 5.15 5.10 5.4 4.19 4.14] selftests/memfd: Fix unknown type name build failure

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

Please ignore this mail if the patch is not relevant for upstream.

I think Hardik did the right thing here. This is a build failure bug that's present in stable kernels but was fixed in upstream by an unrelated commit:

11f75a01448f ("selftests/memfd: add tests for MFD_NOEXEC_SEAL MFD_EXEC")

It wouldn't be right to backport that patch because MFD_NOEXEC_SEAL and MFD_EXEC weren't introduced until v6.3.

Quoted 6 lines

There was an (unmerged) attempt to fix this specific build failure in upstream:

https://lore.kernel.org/all/[email protected]/

Hardik opted to follow what was done upstream in a patch specifically for the stable tree.

Yes, this is the right thing to do, you can ignore the bot :)

Reviewed-by on v1 1/1
#4 lore raw
In reply to Hardik Garg
Quoted 6 lines · Hardik Garg

Partially backport v6.3 commit 11f75a01448f ("selftests/memfd: add tests for MFD_NOEXEC_SEAL MFD_EXEC") to fix an unknown type name build error.
In some systems, the __u64 typedef is not present due to differences in system headers, causing compilation errors like this one:

Quoted 7 lines

fuse_test.c:64:8: error: unknown type name '__u64'
64 | static __u64 mfd_assert_get_seals(int fd)

This header includes the __u64 typedef which increases the likelihood of successful compilation on a wider variety of systems.

Tyler

Quoted 19 lines
---
 tools/testing/selftests/memfd/fuse_test.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/memfd/fuse_test.c +1 -0
index be675002f918..93798c8c5d54 100644
@@ -22,6 +22,7 @@
 #include <linux/falloc.h>
 #include <fcntl.h>
 #include <linux/memfd.h>
+#include <linux/types.h>
 #include <sched.h>
 #include <stdio.h>
 #include <stdlib.h>
Signature · 1 line
2.25.1
maintainer
#5 lore raw
In reply to Hardik Garg
Quoted 9 lines · Hardik Garg

Partially backport v6.3 commit 11f75a01448f ("selftests/memfd: add tests for MFD_NOEXEC_SEAL MFD_EXEC") to fix an unknown type name build error.
In some systems, the __u64 typedef is not present due to differences in system headers, causing compilation errors like this one:

fuse_test.c:64:8: error: unknown type name '__u64'
64 | static __u64 mfd_assert_get_seals(int fd)

Quoted 7 lines

This header includes the __u64 typedef which increases the likelihood of successful compilation on a wider variety of systems.

---
 tools/testing/selftests/memfd/fuse_test.c | 1 +
 1 file changed, 1 insertion(+)

Now queued up, thanks.

greg k-h