v1.33.0: tc(8): "dev" keyword: argv off-by-one, false code flow

Steffen Nurpmeso steffen at sdaoden.eu
Thu Jul 8 21:43:41 UTC 2021


Hello again.

  #?0|kent:~# tc qdisc show dev browse
  qdisc noqueue 0: root refcnt 2
  #?0|kent:~# busybox.static tc qdisc show dev browse
  tc: invalid argument 'SHELL=/bin/bash' to 'command'

In the "arg == ARG_dev" branch of tc_main(), there is a "continue"
missing.

diff --git a/networking/tc.c b/networking/tc.c
index 5106844434..177d50fd65 100644
--- a/networking/tc.c
+++ b/networking/tc.c
@@ -538,6 +538,7 @@ int tc_main(int argc UNUSED_PARAM, char **argv)
 			msg.tcm_ifindex = xll_name_to_index(dev);
 			if (cmd >= CMD_show)
 				filter_ifindex = msg.tcm_ifindex;
+			continue;
 		} else
 		if ((arg == ARG_qdisc && obj == OBJ_class && cmd >= CMD_show)
 		 || (arg == ARG_handle && obj == OBJ_qdisc && cmd == CMD_change)

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


More information about the busybox mailing list