[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210305224226.GA801@amd>
Date: Fri, 5 Mar 2021 23:42:26 +0100
From: Pavel Machek <pavel@...x.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Adam Nichols <adam@...mm-co.com>,
Chris Leech <cleech@...hat.com>,
Mike Christie <michael.christie@...cle.com>,
Lee Duncan <lduncan@...e.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Subject: Re: [PATCH 5.10 083/102] scsi: iscsi: Restrict sessions and handles
to admin capabilities
Hi!
> From: Lee Duncan <lduncan@...e.com>
>
> commit 688e8128b7a92df982709a4137ea4588d16f24aa upstream.
>
> Protect the iSCSI transport handle, available in sysfs, by requiring
> CAP_SYS_ADMIN to read it. Also protect the netlink socket by restricting
> reception of messages to ones sent with CAP_SYS_ADMIN. This disables
> normal users from being able to end arbitrary iSCSI sessions.
Should not normal filesystem permissions be used?
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -132,6 +132,9 @@ show_transport_handle(struct device *dev
> char *buf)
> {
> struct iscsi_internal *priv = dev_to_iscsi_internal(dev);
> +
> + if (!capable(CAP_SYS_ADMIN))
> + return -EACCES;
> return sprintf(buf, "%llu\n", (unsigned long long)iscsi_handle(priv->iscsi_transport));
> }
> static DEVICE_ATTR(handle, S_IRUGO, show_transport_handle, NULL);
AFAICT we make the file 0444 (world readable) and then fail the read
with capability check. If the file is not supposed to be
world-readable, it should have 0400 permissions, right?
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists