powerpc/powernv: Make opal log only readable by root
authorJordan Niethe <jniethe5@gmail.com>
Wed, 27 Feb 2019 03:02:29 +0000 (14:02 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 27 Feb 2019 11:11:31 +0000 (22:11 +1100)
Currently the opal log is globally readable. It is kernel policy to
limit the visibility of physical addresses / kernel pointers to root.
Given this and the fact the opal log may contain this information it
would be better to limit the readability to root.

Fixes: bfc36894a48b ("powerpc/powernv: Add OPAL message log interface")
Cc: stable@vger.kernel.org # v3.15+
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Reviewed-by: Stewart Smith <stewart@linux.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/opal-msglog.c

index acd3206dfae3477452f11c4a96dfc1638cafae00..06628c71cef6996119b90a59fb68d129072a61f5 100644 (file)
@@ -98,7 +98,7 @@ static ssize_t opal_msglog_read(struct file *file, struct kobject *kobj,
 }
 
 static struct bin_attribute opal_msglog_attr = {
-       .attr = {.name = "msglog", .mode = 0444},
+       .attr = {.name = "msglog", .mode = 0400},
        .read = opal_msglog_read
 };