From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC9ED305E04; Tue, 2 Sep 2025 13:42:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756820539; cv=none; b=XlnaLUhsKkC3RvZ13rsfQFDdHp/+Fz1S1Eom5gb3TAijW9R8M+Jw8pypDTqrulUqZsIBa1ZtXhy7Z+sUXXNFdtNlEr5qnjUWdWAOPRSV+KN4ooyRaFq6NZMv5N7p7j1qyKx0Gx0D5sJSRTzO0EKj9uzu8fYnO7t1JEDHYa+rIWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756820539; c=relaxed/simple; bh=5hunf4IAnWLbLBpJTMp3AbyMRMPkVIjugJlDBb/I/1w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Tv/dwjGW5fZlAxhZu8NGxO+daeCDCeOA2hHFJgXVyopAu6XthE5YkXMY8IVn7FYAaKMAuf5nTvwX7BLgHpwS3iW/aC4AOHNe7ZGlk5zjhsqTfneZ+JG1LuDC9APXC5lWw/colcb1Rogb8v4MLLANu/rNffLpCBP1aBMmRs+EKWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yIiee4/a; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yIiee4/a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34510C4CEED; Tue, 2 Sep 2025 13:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756820539; bh=5hunf4IAnWLbLBpJTMp3AbyMRMPkVIjugJlDBb/I/1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yIiee4/aSiSa3gG2jQumzZQXkQIJZfxjcgixx282uqWQo2DX0PO/Bz0KIWyKMIdNY zhkumW1Gm0hBofTQJLZEm98T1N5fdn2PbiddQqy0U54W38433XD4dnjjpv+fRxS5Ya jkkkjlUc3k0T5M/MUt8hhtTLqgBx42w34aJLttU8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Damien Le Moal , John Garry , Johannes Thumshin , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.15 03/33] scsi: core: sysfs: Correct sysfs attributes access rights Date: Tue, 2 Sep 2025 15:21:21 +0200 Message-ID: <20250902131927.182275100@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250902131927.045875971@linuxfoundation.org> References: <20250902131927.045875971@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Damien Le Moal [ Upstream commit a2f54ff15c3bdc0132e20aae041607e2320dbd73 ] The SCSI sysfs attributes "supported_mode" and "active_mode" do not define a store method and thus cannot be modified. Correct the DEVICE_ATTR() call for these two attributes to not include S_IWUSR to allow write access as they are read-only. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20250728041700.76660-1-dlemoal@kernel.org Reviewed-by: John Garry Reviewed-by: Johannes Thumshin Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/scsi_sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 4c72116c8693c..7d3cbf4e6bc6e 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -265,7 +265,7 @@ show_shost_supported_mode(struct device *dev, struct device_attribute *attr, return show_shost_mode(supported_mode, buf); } -static DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL); +static DEVICE_ATTR(supported_mode, S_IRUGO, show_shost_supported_mode, NULL); static ssize_t show_shost_active_mode(struct device *dev, @@ -279,7 +279,7 @@ show_shost_active_mode(struct device *dev, return show_shost_mode(shost->active_mode, buf); } -static DEVICE_ATTR(active_mode, S_IRUGO | S_IWUSR, show_shost_active_mode, NULL); +static DEVICE_ATTR(active_mode, S_IRUGO, show_shost_active_mode, NULL); static int check_reset_type(const char *str) { -- 2.50.1