All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: jeff@garzik.org, netdev@vger.kernel.org
Subject: [PATCH] cxgb3: Use CAP_SYS_RAWIO for firmware
Date: Tue, 29 Apr 2008 14:29:30 +0100	[thread overview]
Message-ID: <20080429142930.0181f078@core> (raw)

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!

Signed-off-by: Alan Cox <alan@redhat.com>

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
--- linux.vanilla-2.6.25-mm1/drivers/net/cxgb3/cxgb3_main.c	2008-04-28 11:36:42.000000000 +0100
+++ linux-2.6.25-mm1/drivers/net/cxgb3/cxgb3_main.c	2008-04-18 17:14:44.000000000 +0100
@@ -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;

             reply	other threads:[~2008-04-29 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 13:29 Alan Cox [this message]
2008-05-06 16:28 ` [PATCH] cxgb3: Use CAP_SYS_RAWIO for firmware Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080429142930.0181f078@core \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.