All of lore.kernel.org
 help / color / mirror / Atom feed
* [iptables PATCH] xshared: Accept an option if any given command allows it
@ 2025-04-23 12:19 Phil Sutter
  2025-04-23 21:09 ` Phil Sutter
  0 siblings, 1 reply; 7+ messages in thread
From: Phil Sutter @ 2025-04-23 12:19 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Adam Nielsen

Fixed commit made option checking overly strict: Some commands may be
commbined (foremost --list and --zero), reject a given option only if it
is not allowed by any of the given commands.

Reported-by: Adam Nielsen <a.nielsen@shikadi.net>
Fixes: 9c09d28102bb4 ("xshared: Simplify generic_opt_check()")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 iptables/xshared.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iptables/xshared.c b/iptables/xshared.c
index cdfd11ab2f279..fc61e0fd832bd 100644
--- a/iptables/xshared.c
+++ b/iptables/xshared.c
@@ -980,7 +980,7 @@ static void generic_opt_check(struct xt_cmd_parse_ops *ops,
 	 */
 	for (i = 0, optval = 1; i < NUMBER_OF_OPT; optval = (1 << ++i)) {
 		if ((options & optval) &&
-		    (options_v_commands[i] & command) != command)
+		    !(options_v_commands[i] & command))
 			xtables_error(PARAMETER_PROBLEM,
 				      "Illegal option `%s' with this command",
 				      ops->option_name(optval));
-- 
2.49.0


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

end of thread, other threads:[~2025-04-24 11:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23 12:19 [iptables PATCH] xshared: Accept an option if any given command allows it Phil Sutter
2025-04-23 21:09 ` Phil Sutter
2025-04-23 22:58   ` Adam Nielsen
2025-04-23 23:40     ` Phil Sutter
2025-04-24  0:04       ` Adam Nielsen
2025-04-24  8:26         ` Phil Sutter
2025-04-24 11:07           ` Adam Nielsen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.