Skip to contentSkip to conversation

cxgb3: Use CAP_SYS_RAWIO for firmware

PATCH Applied Alan Cox 2 participants 2 messages Apr 29, 2008 – May 6, 2008

Subsystems (2)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 cxgb3: Use CAP_SYS_RAWIO for firmware

Otherwise theoretically at least

CAP_NET_ADMIN
Reload new firmware
Wait..
Firmware patches kernel

So it should be CAY_SYS_RAWIO - not that I suspect this is in fact a credible attack vector!

drivers/net/cxgb3/cxgb3_main.c +2 -2
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-mm1/drivers/net/cxgb3/cxgb3_main.c linux-2.6.25-mm1/drivers/net/cxgb3/cxgb3_main.c
@@ -1894,11 +1894,11 @@
 		u8 *fw_data;
 		struct ch_mem_range t;
 
-		if (!capable(CAP_NET_ADMIN))
+		if (!capable(CAP_SYS_RAWIO))
 			return -EPERM;
 		if (copy_from_user(&t, useraddr, sizeof(t)))
 			return -EFAULT;
-
+		/* Check t.len sanity ? */
 		fw_data = kmalloc(t.len, GFP_KERNEL);
 		if (!fw_data)
 			return -ENOMEM;
Applied
#1 lore raw
Quoted 11 lines · Alan Cox

Otherwise theoretically at least

CAP_NET_ADMIN
Reload new firmware
Wait..
Firmware patches kernel

So it should be CAY_SYS_RAWIO - not that I suspect this is in fact a credible attack vector!

applied