lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240924030533.34407-1-chentao@kylinos.cn>
Date: Tue, 24 Sep 2024 11:05:32 +0800
From: Kunwu Chan <chentao@...inos.cn>
To: gregkh@...uxfoundation.org,
	kunwu.chan@...ux.dev
Cc: linux-kernel@...r.kernel.org,
	Kunwu Chan <chentao@...inos.cn>
Subject: [PATCH] firmware: memmap: Constify memmap_ktype

This 'memmap_ktype' is not modified. It is only used in
firmware_map_add_entry().

Constifying this structure and moving it to a read-only section,
and this can increase over all security.

```
[Before]
   text    data     bss     dec     hex filename
   4345     596      12    4953    1359 drivers/firmware/memmap.o

[After]
   text    data     bss     dec     hex filename
   4393     548      12    4953    1359 drivers/firmware/memmap.o
```

Signed-off-by: Kunwu Chan <chentao@...inos.cn>
---
 drivers/firmware/memmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c
index 8e59be3782cb..55b9cfad8a04 100644
--- a/drivers/firmware/memmap.c
+++ b/drivers/firmware/memmap.c
@@ -116,7 +116,7 @@ static void __meminit release_firmware_map_entry(struct kobject *kobj)
 	kfree(entry);
 }
 
-static struct kobj_type __refdata memmap_ktype = {
+static const struct kobj_type memmap_ktype = {
 	.release	= release_firmware_map_entry,
 	.sysfs_ops	= &memmap_attr_ops,
 	.default_groups	= def_groups,
-- 
2.41.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ