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 CDA83304BA0; Tue, 2 Sep 2025 13:44:33 +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=1756820673; cv=none; b=a3LolED8YDUKj28xoU6UmWM3ioA6+Cnd7QJ5X9zcEFZ4tzs3EXH7vFjdjGpZr+WY5LRJ7QsCmFizTb5DzNCK3mQwceuUoX9Wf7lT2Su10urcr8fiXq35YaoHOi5yO91rrDQb8YWOAYGuCUFnOHdT5fSXyb4W+C/pU2CNl8eakwQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756820673; c=relaxed/simple; bh=b3bNlw63Z/EkVCj3UBEXNNWuvDNQZplFS26l5865x7Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bNYCkoZMZym9n7ZBqHIo4Mst/Gvoia01p28OqJAX1IhUg6h5eTisZ/T6TNybTCeJZNp+lY7YAmKv4QJI+PWwqpvSPME+4qd7woYgargrxVp7eILoGK/Amke5GrvA7xGyccyQKTYkzDScCONJCSYFjzsFm/iyGdL1rMh6tV+YCg8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Dxse27Lc; 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="Dxse27Lc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EB28C4CEED; Tue, 2 Sep 2025 13:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756820673; bh=b3bNlw63Z/EkVCj3UBEXNNWuvDNQZplFS26l5865x7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dxse27LcZild/KxIdMYJdLteogwJRvwFG/02vpG60DvbXo6++j6xmrgX+v2+82DZ9 4VCLMU8Hwp+blW0vCg8F7fs2AVefgQaKH/crFZmgaIq2QqyIEWpOw49FhRIVe1qe1Q S9V12/uIllISBL6WYdxqnRwQ3rZMdZg+X9xHEzPs= 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.10 03/34] scsi: core: sysfs: Correct sysfs attributes access rights Date: Tue, 2 Sep 2025 15:21:29 +0200 Message-ID: <20250902131926.749929779@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250902131926.607219059@linuxfoundation.org> References: <20250902131926.607219059@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-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 bb37d698da1a1..4992027f125e8 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -264,7 +264,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, @@ -278,7 +278,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