Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Aleksa Sarai <asarai-l3A5Bk7waGM@public.gmane.org>
To: Randy Dunlap <rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	"James E.J. Bottomley"
	<jejb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	"Martin K. Petersen"
	<martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cyphar-gVpy/LI/lHzQT0dZR+AlfA@public.gmane.org,
	"Eric W. Biederman"
	<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH] scsi: require CAP_SYS_ADMIN to write to procfs interface
Date: Sun, 5 Nov 2017 07:26:51 +1100	[thread overview]
Message-ID: <8769e150-db7b-b020-66e6-7f5e9c102977@suse.de> (raw)
In-Reply-To: <7595538b-c203-0af4-810e-e3f97334a314-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>

>> Previously, the only capability effectively required to operate on the
>> /proc/scsi interface was CAP_DAC_OVERRIDE (or for some other files,
>> having an fsuid of GLOBAL_ROOT_UID was enough). This means that
>> semi-privileged processes could interfere with core components of a
>> system (such as causing a DoS by removing the underlying SCSI device of
>> the host's / mount).
>>
>> Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
>> Cc: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
>> Signed-off-by: Aleksa Sarai <asarai-l3A5Bk7waGM@public.gmane.org>
>> ---
>>   drivers/scsi/scsi_proc.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
>> index 480a597b3877..486aedce2f05 100644
>> --- a/drivers/scsi/scsi_proc.c
>> +++ b/drivers/scsi/scsi_proc.c
>> @@ -51,7 +51,10 @@ static ssize_t proc_scsi_host_write(struct file *file, const char __user *buf,
>>   	struct Scsi_Host *shost = PDE_DATA(file_inode(file));
>>   	ssize_t ret = -ENOMEM;
>>   	char *page;
>> -
>> +
>> +	if (!capable(CAP_SYS_ADMIN))
>> +		return -EPERM
> 
> did that build without a trailing ';' ?

D'oh. Re-sent, thanks.

-- 
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
https://www.cyphar.com/

      parent reply	other threads:[~2017-11-04 20:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-04 18:59 [PATCH] scsi: require CAP_SYS_ADMIN to write to procfs interface Aleksa Sarai
2017-11-04 20:20 ` Randy Dunlap
     [not found]   ` <7595538b-c203-0af4-810e-e3f97334a314-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-11-04 20:26     ` Aleksa Sarai [this message]

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=8769e150-db7b-b020-66e6-7f5e9c102977@suse.de \
    --to=asarai-l3a5bk7wagm@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=cyphar-gVpy/LI/lHzQT0dZR+AlfA@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    --cc=jejb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.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