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: <20230504083613.3789010-1-pvorel@suse.cz>
Date:   Thu,  4 May 2023 10:36:13 +0200
From:   Petr Vorel <pvorel@...e.cz>
To:     linux-kernel@...r.kernel.org
Cc:     Petr Vorel <pvorel@...e.cz>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>, sam@...nborg.org,
        Ruben Ayrapetyan <ruben.ayrapetyan@....com>,
        Kevin Brodsky <kevin.brodsky@....com>
Subject: [PATCH v2] uapi/netfilter: Prefer ISO-friendly __typeof__

typeof() is a GNU extension, UAPI requires ISO C, therefore __typeof__()
should be used.  Similarly to 31088f6f7906 ("uapi/linux/const.h: Prefer
ISO-friendly __typeof__") use __typeof__() also in x_tables.h.

Fixes: 72b2b1dd77e8 ("netfilter: xtables: replace XT_ENTRY_ITERATE macro")
Reviewed-by: Kevin Brodsky <kevin.brodsky@....com>
Signed-off-by: Petr Vorel <pvorel@...e.cz>
---
Changes v1->v2:
* Add Kevin's Reviewed-by:
  https://lore.kernel.org/lkml/f8bd4212-9cca-03ca-884a-c9dec63bb256@arm.com/
* Update hash to 31088f6f7906 (Kevin)
* Add Fixes: 72b2b1dd77e8 (Kevin)

 include/uapi/linux/netfilter/x_tables.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/netfilter/x_tables.h b/include/uapi/linux/netfilter/x_tables.h
index 796af83a963a..d4eced07f2a2 100644
--- a/include/uapi/linux/netfilter/x_tables.h
+++ b/include/uapi/linux/netfilter/x_tables.h
@@ -172,11 +172,11 @@ struct xt_counters_info {
 
 /* pos is normally a struct ipt_entry/ip6t_entry/etc. */
 #define xt_entry_foreach(pos, ehead, esize) \
-	for ((pos) = (typeof(pos))(ehead); \
-	     (pos) < (typeof(pos))((char *)(ehead) + (esize)); \
-	     (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset))
+	for ((pos) = (__typeof__(pos))(ehead); \
+	     (pos) < (__typeof__(pos))((char *)(ehead) + (esize)); \
+	     (pos) = (__typeof__(pos))((char *)(pos) + (pos)->next_offset))
 
-/* can only be xt_entry_match, so no use of typeof here */
+/* can only be xt_entry_match, so no use of __typeof__ here */
 #define xt_ematch_foreach(pos, entry) \
 	for ((pos) = (struct xt_entry_match *)entry->elems; \
 	     (pos) < (struct xt_entry_match *)((char *)(entry) + \
-- 
2.40.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ