From: Lee Duncan <lduncan@suse.com>
To: jiang.biao2@zte.com.cn, linux-scsi@vger.kernel.org, JBottomley@odin.com
Subject: Re: [Patch] scsi_ioctl: support persistent reserve commands through ioctl for non-root user.
Date: Thu, 3 Sep 2015 09:13:25 -0700 [thread overview]
Message-ID: <55E871A5.6020701@suse.com> (raw)
In-Reply-To: <OF31114848.5C193F0C-ON48257E94.00359001-48257E94.00363255@zte.com.cn>
On 08/01/2015 02:51 AM, jiang.biao2@zte.com.cn wrote:
> scsi_ioctl: support persistent reserve commands through ioctl for
> non-root user.
>
> Scsi persistent reserve commands need to be used for non-root user in
> many scenarios.
> EPERM error will be returned by sg_io() when PERSISTENT_RESERVE_OUT
> or PERSISTENT_RESERVE_IN command is sent through ioctl() for
> non-root user.
> Add PERSISTENT_RESERVE_OUT and PERSISTENT_RESERVE_IN into
> blk_default_cmd_filter in blk_set_cmd_filter_defaults() to support
> persistent reserve commands for non-root user.
>
> Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
> Signed-off-by: Li Ping <li.ping288@zte.com.cn>
> Reviewed-by: Liu Jianjun <liu.jianjun3@zte.com.cn>
>
> diff -urpN block/scsi_ioctl.c block_new/scsi_ioctl.c
> --- block/scsi_ioctl.c 2015-08-01 17:07:47.000000000 +0800
> +++ block_new/scsi_ioctl.c 2015-08-01 17:09:56.000000000 +0800
> @@ -202,6 +202,9 @@ static void blk_set_cmd_filter_defaults(
> __set_bit(GPCMD_LOAD_UNLOAD, filter->write_ok);
> __set_bit(GPCMD_SET_STREAMING, filter->write_ok);
> __set_bit(GPCMD_SET_READ_AHEAD, filter->write_ok);
> + /* Persistent reserve command*/
> + __set_bit(PERSISTENT_RESERVE_IN, filter->read_ok);
> + __set_bit(PERSISTENT_RESERVE_OUT, filter->write_ok);
> }
>
> int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm)
> N�����r��y���b�X��ǧv�^�){.n�+����{���"�{ay�\x1dʇڙ�,j\a��f���h���z�\x1e�w���\f���j:+v���w�j�m����\a����zZ+�����ݢj"��!tml=
>
I disagree that it is a good idea to give non-root users permanent
access to the reservation commands. This can be used to coopt a disc,
including the root disc.
--
Lee Duncan
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-09-03 16:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-01 9:51 [Patch] scsi_ioctl: support persistent reserve commands through ioctl for non-root user jiang.biao2
2015-09-03 16:13 ` Lee Duncan [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=55E871A5.6020701@suse.com \
--to=lduncan@suse.com \
--cc=JBottomley@odin.com \
--cc=jiang.biao2@zte.com.cn \
--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 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.