From patchwork Thu Jan 2 12:01:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13924452 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 0B9AA7DA9C; Thu, 2 Jan 2025 12:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735819305; cv=none; b=d8v6hyC7OxbkXpgOLMyVsddscMOd9g0gJWDEXsmlQdiFDa3NT6EH64g1FGEdJwpeuCu1yFDaHWzjSc4YsY3phDuGaPzdw+NLB2GxTZbEcYgUvzaFLPeeRBXdqL5Dkgurlx8jE9I/wklQD1Byl5dhkrzXf2lBbOloXm2hNFhpFP8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735819305; c=relaxed/simple; bh=A7tmEh5g1RF0O8e+nNgPoFqTEpOsQ/LwXFI2flN3GLw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DCqQiy9vp5ZPFOcz+SGI+WDy965R2H9lOjSVJoKj6QFdWVLW1V2/1Ci7Tbp1UZE0NP6iy/RfJA1Tu5QrbAmhEtMmhkl0UhqGpnPHilLAHI9dqIWFNIh7fUge0wA2peGCrVShnhCyqG8fphiCElrxiFt5Qvb7x1qiT0LP4L5uh9w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=fgUQW8HZ; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="fgUQW8HZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1735819292; bh=A7tmEh5g1RF0O8e+nNgPoFqTEpOsQ/LwXFI2flN3GLw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fgUQW8HZOqnOpSBEcOqr8tCFGf9MmfZfKkIe/Uu3OnWvPv9baz62WDDrE4lNPLgtN tHGudBlwwLqKko4Mlxq9pjfgRoB4C72JT81R4UKsx/QpTjquNPOXTCXKrHP2RU0Hk/ 4UH+YmU5soxFhz4FIMeWPibHOwPzNx0iqMTmE1vI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 02 Jan 2025 13:01:31 +0100 Subject: [PATCH 1/4] elevator: Enable const sysfs attributes Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250102-sysfs-const-attr-elevator-v1-1-9837d2058c60@weissschuh.net> References: <20250102-sysfs-const-attr-elevator-v1-0-9837d2058c60@weissschuh.net> In-Reply-To: <20250102-sysfs-const-attr-elevator-v1-0-9837d2058c60@weissschuh.net> To: Jens Axboe , Yu Kuai Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735819292; l=2248; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=A7tmEh5g1RF0O8e+nNgPoFqTEpOsQ/LwXFI2flN3GLw=; b=zgnf9hGcztJO1koRepY+g9DqNcoSBFwq4pD/vRbYg3OcpO32vuZHCmV+qDt8biSozaZSjxVs1 pKounLIhRJNB3Ebx7oxYHPy5RLuQJIKlq3rwNWGVNv5BtInCTmsFQoE X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The elevator core does not need to modify the sysfs attributes added by the elevators. Reflect this in the types, so the attributes can be moved into read-only memory. Signed-off-by: Thomas Weißschuh --- block/elevator.c | 8 ++++---- block/elevator.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 7c3ba80e5ff4a390e62bb4318d364e95da92cd3c..0254ff79a696032e032781c4d9519e9ab7f52cb7 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -405,12 +405,12 @@ struct request *elv_former_request(struct request_queue *q, struct request *rq) return NULL; } -#define to_elv(atr) container_of((atr), struct elv_fs_entry, attr) +#define to_elv(atr) container_of_const((atr), struct elv_fs_entry, attr) static ssize_t elv_attr_show(struct kobject *kobj, struct attribute *attr, char *page) { - struct elv_fs_entry *entry = to_elv(attr); + const struct elv_fs_entry *entry = to_elv(attr); struct elevator_queue *e; ssize_t error; @@ -428,7 +428,7 @@ static ssize_t elv_attr_store(struct kobject *kobj, struct attribute *attr, const char *page, size_t length) { - struct elv_fs_entry *entry = to_elv(attr); + const struct elv_fs_entry *entry = to_elv(attr); struct elevator_queue *e; ssize_t error; @@ -461,7 +461,7 @@ int elv_register_queue(struct request_queue *q, bool uevent) error = kobject_add(&e->kobj, &q->disk->queue_kobj, "iosched"); if (!error) { - struct elv_fs_entry *attr = e->type->elevator_attrs; + const struct elv_fs_entry *attr = e->type->elevator_attrs; if (attr) { while (attr->attr.name) { if (sysfs_create_file(&e->kobj, &attr->attr)) diff --git a/block/elevator.h b/block/elevator.h index dbf357ef4fab9362b7fb2f53724b6bea2ff057b7..e526662c5dbb1f313cb2346b72f713e1cd58665e 100644 --- a/block/elevator.h +++ b/block/elevator.h @@ -71,7 +71,7 @@ struct elevator_type size_t icq_size; /* see iocontext.h */ size_t icq_align; /* ditto */ - struct elv_fs_entry *elevator_attrs; + const struct elv_fs_entry *elevator_attrs; const char *elevator_name; const char *elevator_alias; struct module *elevator_owner; From patchwork Thu Jan 2 12:01:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13924451 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 0BA0518FDB2; Thu, 2 Jan 2025 12:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735819305; cv=none; b=RmV8bn6FyhNXXNvOgeLzgF92yd52LAdj62rwIKdXAfi+X7eQMNGz+A+G45ElM3KaYfpOHKq9XlTrIauIccYt/9t+LThAwxnCfl7UamSgalhgNms8HI3XUcWVGkQQGXBTF0MIXOySxLtGypzya7Ix0UPtUn0XfTqaEa28zYxjiuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735819305; c=relaxed/simple; bh=WD60vvlaO/9NSCYrqpuUaM1VdxoLzNlEclK2oVJ1JRU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jp7UY0Bg9zsQhJ48Y8eAJIguqh+w7fw/CKBBkgZjtsEQruf6DCm7cCT7UhJUjjUf5CLt3JU2gvxnof5a8HMRZv5ocfFWcL3IUOFaVTnGq9EpElx2eFViTDhqOGMA6MDyEKZAJY3YdZjii3qlQxG9no7HY7fXa3Jg7xOa9zqN6AU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=BiIGgS+d; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="BiIGgS+d" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1735819292; bh=WD60vvlaO/9NSCYrqpuUaM1VdxoLzNlEclK2oVJ1JRU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BiIGgS+diHCuNJ7//XzQcm1PB6fIUnTB3R/q6v6KtK7CRp7mApiPXvp5WqpSWfq9N Q8ccqlv6zLQ52cEV+rJLGXOUPML81DWsYbuBcJ++d6X/JNu3TJlhluW8J8bA0cBPIc 8XWK7hPwsMGfshLjsNHOeCY96HY6usKrOhL0xRL0= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 02 Jan 2025 13:01:32 +0100 Subject: [PATCH 2/4] block: mq-deadline: Constify sysfs attributes Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250102-sysfs-const-attr-elevator-v1-2-9837d2058c60@weissschuh.net> References: <20250102-sysfs-const-attr-elevator-v1-0-9837d2058c60@weissschuh.net> In-Reply-To: <20250102-sysfs-const-attr-elevator-v1-0-9837d2058c60@weissschuh.net> To: Jens Axboe , Yu Kuai Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735819292; l=920; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=WD60vvlaO/9NSCYrqpuUaM1VdxoLzNlEclK2oVJ1JRU=; b=XvBzdSqltsivaV+Pk7hf+KvhH0z2/9FqCGJ+KZ1eNUxSr8oJGwFtJynvG8Q1IrIE/VNLlvIpB Xq+j5nXxhI3CmNUL4Oa/EsnZ8xmZNg9uKgFf/Nn/tkjDDWc3WcSf8UF X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The elevator core now allows instances of 'struct elv_fs_entry' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- block/mq-deadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/mq-deadline.c b/block/mq-deadline.c index 5528347b5fcfca3d5bda443f9a116e29b95dd0c1..754f6b7415cdce0a3af60545731a1f2ec525d2e6 100644 --- a/block/mq-deadline.c +++ b/block/mq-deadline.c @@ -834,7 +834,7 @@ STORE_INT(deadline_fifo_batch_store, &dd->fifo_batch, 0, INT_MAX); #define DD_ATTR(name) \ __ATTR(name, 0644, deadline_##name##_show, deadline_##name##_store) -static struct elv_fs_entry deadline_attrs[] = { +static const struct elv_fs_entry deadline_attrs[] = { DD_ATTR(read_expire), DD_ATTR(write_expire), DD_ATTR(writes_starved), From patchwork Thu Jan 2 12:01:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13924450 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 0BA8D194C8B; Thu, 2 Jan 2025 12:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735819305; cv=none; b=qVI+9vQ8Nt45I24HshAJBsMuUOMaEX/0xQ3Eu1e18KTQVrLQNOBSB38uH/zlEJ5Qpm3ow4fsEn2dPeDrUwBdRH9ex0pma5azHBaGGtKjkjQBqJCLzxl1hs+APkBpkL00Kc8wal4Ay4QkYgUcXm+nC40avPVmT2BCk1jKIJatpnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735819305; c=relaxed/simple; bh=ZDExbkwJU/vM0+WXsyrHEHxxuUiUTAJ13SHngPCJR7c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Mu//biDboCRvYWtOJaTOp7qQ4YqfUab7xCkHKktMrlG9ihXH0v7iIg0yh+vyyYI5Ce84HO6SXVAZQ6xCk5aIDgzNu8Uc0ovbo7AQgCC1H1MslcQBjaZgKXPxx9J7LBmwAOA6r5toV8JpRqvW4BhZY434d0gYqZQ55HlBLczkmJo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=Pp511oI1; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Pp511oI1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1735819292; bh=ZDExbkwJU/vM0+WXsyrHEHxxuUiUTAJ13SHngPCJR7c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Pp511oI1goXY9yHUCRrYqFrW7X6GkIMaVKam38OikGSYDe/s89Jsic0I1Ko3gpGBc O7s2HZSyvx+fIbjP0eoU7oZ1KPTUNWQqJvB17fn8aIE7ISgO6BDn70z3iV3c3Al/ri ATGgQN1VmxavexBXef3xz1OD7GEx52kzdXE9H7jE= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 02 Jan 2025 13:01:33 +0100 Subject: [PATCH 3/4] block, bfq: constify sysfs attributes Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250102-sysfs-const-attr-elevator-v1-3-9837d2058c60@weissschuh.net> References: <20250102-sysfs-const-attr-elevator-v1-0-9837d2058c60@weissschuh.net> In-Reply-To: <20250102-sysfs-const-attr-elevator-v1-0-9837d2058c60@weissschuh.net> To: Jens Axboe , Yu Kuai Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735819292; l=911; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=ZDExbkwJU/vM0+WXsyrHEHxxuUiUTAJ13SHngPCJR7c=; b=yK3s4PGOX4H4wJYrhLf4c9WT45F06i3sGqI6Zv6NUz+aN72q64ZT3dqlKvYEq4PKzqJaoLl3i OniTp3Bed+zCSaKaRXYxS/2RQ7vnYEv2BbV2j7oN7NQlLCM9sZpWO1A X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The elevator core now allows instances of 'struct elv_fs_entry' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- block/bfq-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 95dd7b795935658b8709de7eab81b4730ece022d..068c63e957382e41de2454efabbab50b06d1ffd2 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -7614,7 +7614,7 @@ static ssize_t bfq_low_latency_store(struct elevator_queue *e, #define BFQ_ATTR(name) \ __ATTR(name, 0644, bfq_##name##_show, bfq_##name##_store) -static struct elv_fs_entry bfq_attrs[] = { +static const struct elv_fs_entry bfq_attrs[] = { BFQ_ATTR(fifo_expire_sync), BFQ_ATTR(fifo_expire_async), BFQ_ATTR(back_seek_max), From patchwork Thu Jan 2 12:01:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13924448 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 0B968405F7; Thu, 2 Jan 2025 12:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735819304; cv=none; b=rZOWOI+/79JehMzS5TGphhafGKmhwrkK5ZL9I0o7AzgQ5rTFCBOefTl10E6Ce7FuQM3QyklDA74hGjsHG02F8muc9dlQNNeCwlZFr8Gz1crGVMhXhKk74cOGCxmoNvUaN7eV808EVbol21NmtAM5FNMdSZx4OtzctadYYZZWcHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735819304; c=relaxed/simple; bh=odFRxWYpeapXxCpd6HffuzlvvZGINR1nCzZoPhfea30=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B6hB0GDvgH5eM2vATWO8tjiL6Suf37zbpGH9S1goPY7h5WYy5T6+y0i9WCnAzzb0qWPdNAR3djJLd76yPFmHL8imCOeRRa5xE6g9rWJy9OUkepWjzFqGmH8hSUI/duxBg6OupC5nTLcKFoc5AStMkEl4a+sgby6LKzt9e+e/4VQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=TMjD8zum; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="TMjD8zum" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1735819292; bh=odFRxWYpeapXxCpd6HffuzlvvZGINR1nCzZoPhfea30=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=TMjD8zum1+bQUNqAxpo4U1Hu6HGZPdpD8E0kKFWZTNzrGzT8Rozboa7m+hGHr3U3m Zw+wEkq9az+JQlD3ZpGXlrhBgc2j767YUByhpJrFr7F6JS8EGWJNU7vNLh6Yz7QTy+ n5f9nDTYX1g9TfU4fRecd387br/g7Ny3xAC5vrRY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 02 Jan 2025 13:01:34 +0100 Subject: [PATCH 4/4] kyber: constify sysfs attributes Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250102-sysfs-const-attr-elevator-v1-4-9837d2058c60@weissschuh.net> References: <20250102-sysfs-const-attr-elevator-v1-0-9837d2058c60@weissschuh.net> In-Reply-To: <20250102-sysfs-const-attr-elevator-v1-0-9837d2058c60@weissschuh.net> To: Jens Axboe , Yu Kuai Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735819292; l=935; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=odFRxWYpeapXxCpd6HffuzlvvZGINR1nCzZoPhfea30=; b=h3Y7x1T+4rvepCyaWUhQksxThUJfGFsLhYd6343XJSyyjaVYYWfItvZ4rDnO/+k/Ta6TZRD0p WaRgJurXpzoBSlYzDu/0kAK2pFg/NeCn5v9vWEMNkljTsYMk5AkkonY X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The elevator core now allows instances of 'struct elv_fs_entry' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- block/kyber-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/kyber-iosched.c b/block/kyber-iosched.c index 4155594aefc657016d86bb25050b67544fefaf34..dc31f2dfa414f68f3475489d5d33ad07730393b5 100644 --- a/block/kyber-iosched.c +++ b/block/kyber-iosched.c @@ -889,7 +889,7 @@ KYBER_LAT_SHOW_STORE(KYBER_WRITE, write); #undef KYBER_LAT_SHOW_STORE #define KYBER_LAT_ATTR(op) __ATTR(op##_lat_nsec, 0644, kyber_##op##_lat_show, kyber_##op##_lat_store) -static struct elv_fs_entry kyber_sched_attrs[] = { +static const struct elv_fs_entry kyber_sched_attrs[] = { KYBER_LAT_ATTR(read), KYBER_LAT_ATTR(write), __ATTR_NULL