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]
Date:   Sun,  1 Jan 2017 21:59:21 +0530
From:   Bhumika Goyal <bhumirks@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     julia.lawall@...6.fr, san@...gle.com, mikew@...gle.com,
        walken@...gle.com, Bhumika Goyal <bhumirks@...il.com>
Subject: [PATCH] firmware: google: add __ro_after_init to memconsole_bin_attr

The object memconsole_bin_attr of type bin_attribute structure is not
modified after getting initialized by memconsole_init. Apart from
getting referenced in init it is also passed as an argument to the
functions sysfs_{remove/create}_bin_file but both the arguments are of
type const struct bin_attribute *. Therefore add __ro_after_init to its
declaration.

Signed-off-by: Bhumika Goyal <bhumirks@...il.com>
---
 drivers/firmware/google/memconsole.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/google/memconsole.c b/drivers/firmware/google/memconsole.c
index 2f569aa..54fa5a3 100644
--- a/drivers/firmware/google/memconsole.c
+++ b/drivers/firmware/google/memconsole.c
@@ -63,7 +63,7 @@ static ssize_t memconsole_read(struct file *filp, struct kobject *kobp,
 	return ret;
 }
 
-static struct bin_attribute memconsole_bin_attr = {
+static struct bin_attribute memconsole_bin_attr __ro_after_init = {
 	.attr = {.name = "log", .mode = 0444},
 	.read = memconsole_read,
 };
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ