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 667573101AE; Tue, 2 Sep 2025 13:30:38 +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=1756819838; cv=none; b=nqTtjoPYkbN8T1xEnfwuzXuEpkuC9+9h+RQxdUJkYfWxVeFK3jBAdUh/ZraLYTbxJ7faCuYPKbI7Dyim6m1rgrvnI0xpK+SEUWdGq3gDZEUqwmYDwmV08ptBX7FRw0uZjMg/3q/kqoUXWAhIrE6EyB1iXb8H3Nlu2qAStRNPeQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756819838; c=relaxed/simple; bh=KqzalcNpd9ri26nqa1mgz7bWfQnyEM8gj0wIAkUkQSw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DfsrcOGFayUyHtvfwTdDk4NTdBDQSbJ9xX3t1HFBkhIahB0c9C5OdjsQLisr/xnZtLWaKATNJAJKfzlhG6Lrf7NnU9kdTGE6rCxkZsbe7ZjkR40gjo5SMgwtELMmtW4RGL1ICKBu9FYDIKebH1dqLcyz10B/2SgCuCMSB5VvDB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=I+u6WNDw; 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="I+u6WNDw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7112FC4CEED; Tue, 2 Sep 2025 13:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756819837; bh=KqzalcNpd9ri26nqa1mgz7bWfQnyEM8gj0wIAkUkQSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I+u6WNDwradTeXcTQw48XykBORr3RKxSlyMfFnEL0rPNo1xUBGI5itijAwDb8R+9c DEw/zSf5nY6ULe66p5/k00gXx+yL69lYWf89h/7Krhz0fXpKEo5oNjjU3UGKgf3nme a5PypgdB2lPhSrjwEuycjy4NIkf00wJ1kYIv/RgU= 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 6.12 12/95] scsi: core: sysfs: Correct sysfs attributes access rights Date: Tue, 2 Sep 2025 15:19:48 +0200 Message-ID: <20250902131940.085172529@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250902131939.601201881@linuxfoundation.org> References: <20250902131939.601201881@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 6.12-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 32f94db6d6bf5..e669768a7a5bf 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