public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bryn M. Reeves" <bmr@redhat.com>
To: linux-scsi@vger.kernel.org
Subject: [PATCH] [CVE-2009-3939] megaraid_sas: remove sysfs poll_mode_io world writable permissions
Date: Mon, 11 Jan 2010 15:26:39 +0000	[thread overview]
Message-ID: <1263223599.1847.158.camel@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

Hi Linus,

Posted twice to linux-scsi and once to lkml - doesn't seem to have been
picked up yet.

Similar to the problem with dbg_lvl fixed in commit
66dca9b8c50b5e59d3bea8b21cee5c6dae6c9c46 last year.

/sys/bus/pci/drivers/megaraid_sas/poll_mode_io defaults to being
world-writable, which seems bad (letting any user affect kernel driver
behavior).

This turns off group and user write permissions, so that on typical
production systems only root can write to it.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>

Cheers,
Bryn.


[-- Attachment #2: megaraid_sas-restrict-poll_mode_io-write-perms.patch --]
[-- Type: text/x-patch, Size: 1061 bytes --]

Author: Bryn M. Reeves <bmr@redhat.com>
Date:   Thu Nov 12 18:31:54 2009 +0000

    [SCSI] megaraid_sas: remove sysfs poll_mode_io world writeable permissions
    
    /sys/bus/pci/drivers/megaraid_sas/poll_mode_io defaults to being
    world-writable, which seems bad (letting any user affect kernel driver
    behavior).
    
    This turns off group and user write permissions, so that on typical
    production systems only root can write to it.
    
    Signed-off-by: Bryn M. Reeves <bmr@redhat.com>

diff -up linux-2.6.18.noarch/drivers/scsi/megaraid/megaraid_sas.c.bmr0 linux-2.6.18.noarch/drivers/scsi/megaraid/megaraid_sas.c
--- linux-2.6.18.noarch/drivers/scsi/megaraid/megaraid_sas.c.bmr0	2009-09-28 17:37:47.000000000 +0100
+++ linux-2.6.18.noarch/drivers/scsi/megaraid/megaraid_sas.c	2009-09-28 17:38:16.000000000 +0100
@@ -3548,7 +3548,7 @@ out:
 	return retval;
 }
 
-static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUGO,
+static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUSR,
 			megasas_sysfs_show_poll_mode_io,
 			megasas_sysfs_set_poll_mode_io);
 

                 reply	other threads:[~2010-01-11 15:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1263223599.1847.158.camel@localhost \
    --to=bmr@redhat.com \
    --cc=linux-scsi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox