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-next>] [day] [month] [year] [list]
Message-ID: <tencent_3E0335A1CE2C91CB09159057B15138441F07@qq.com>
Date:   Thu, 10 Nov 2022 23:17:12 +0800
From:   Rong Tao <rtoax@...mail.com>
To:     davem@...emloft.net
Cc:     Rong Tao <rongtao@...tc.cn>, Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        netdev@...r.kernel.org (open list:NETWORKING [GENERAL]),
        linux-kernel@...r.kernel.org (open list),
        bpf@...r.kernel.org (open list:BPF [MISC])
Subject: [PATCH] net/ipv4: Fix error: type name requires a specifier or qualifier

From: Rong Tao <rongtao@...tc.cn>

since commit 5854a09b4957("net/ipv4: Use __DECLARE_FLEX_ARRAY() helper")
linux/in.h use __DECLARE_FLEX_ARRAY() macro, and sync to tools/ in commit
036b8f5b8970("tools headers uapi: Update linux/in.h copy"), this macro
define in linux/stddef.h, which introduced in commit 3080ea5553cc("stddef:
Introduce DECLARE_FLEX_ARRAY() helper"), thus, stddef.h should be included
in in.h, which resolves the compilation error below:

How to reproduce this compilation error:

$ make -C tools/testing/selftests/bpf/
In file included from progs/bpf_flow.c:8:
linux/in.h:199:3: error: type name requires a specifier or qualifier
                __DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
                ^
linux/in.h:199:32: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
                __DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
                                             ^
2 errors generated.

Same error occurs with cgroup_skb_sk_lookup_kern.c, connect_force_port4.c,
connect_force_port6.c, etc. that contain the header linux/in.h.

Signed-off-by: Rong Tao <rongtao@...tc.cn>
---
 include/uapi/linux/in.h       | 1 +
 tools/include/uapi/linux/in.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h
index f243ce665f74..07a4cb149305 100644
--- a/include/uapi/linux/in.h
+++ b/include/uapi/linux/in.h
@@ -20,6 +20,7 @@
 #define _UAPI_LINUX_IN_H
 
 #include <linux/types.h>
+#include <linux/stddef.h>
 #include <linux/libc-compat.h>
 #include <linux/socket.h>
 
diff --git a/tools/include/uapi/linux/in.h b/tools/include/uapi/linux/in.h
index f243ce665f74..07a4cb149305 100644
--- a/tools/include/uapi/linux/in.h
+++ b/tools/include/uapi/linux/in.h
@@ -20,6 +20,7 @@
 #define _UAPI_LINUX_IN_H
 
 #include <linux/types.h>
+#include <linux/stddef.h>
 #include <linux/libc-compat.h>
 #include <linux/socket.h>
 
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ