[PATCH] powerpc/powernv: Make opal log only readable by root

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE2719d

5 messages, 5 authors, 2019-02-28 · open the first message on its own page

[PATCH] powerpc/powernv: Make opal log only readable by root

From: Jordan Niethe <hidden>
Date: 2019-02-27 03:04:21

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.

Signed-off-by: Jordan Niethe <redacted>
---
 arch/powerpc/platforms/powernv/opal-msglog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/opal-msglog.c b/arch/powerpc/platforms/powernv/opal-msglog.c
index acd3206dfae3..06628c71cef6 100644
--- a/arch/powerpc/platforms/powernv/opal-msglog.c
+++ b/arch/powerpc/platforms/powernv/opal-msglog.c
@@ -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
 };
 
-- 
2.20.1

Re: [PATCH] powerpc/powernv: Make opal log only readable by root

From: Stewart Smith <hidden>
Date: 2019-02-27 04:01:26

Jordan Niethe [off-list ref] writes:
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.

Signed-off-by: Jordan Niethe <redacted>
Yeah, this is a really good idea.

Reviewed-by: Stewart Smith <redacted>

-- 
Stewart Smith
OPAL Architect, IBM.

Re: [PATCH] powerpc/powernv: Make opal log only readable by root

From: Andrew Donnellan <hidden>
Date: 2019-02-27 04:19:31

On 27/2/19 2:02 pm, Jordan Niethe wrote:
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.

Signed-off-by: Jordan Niethe <redacted>
Guess I'll have to get used to typing sudo more often. :(

Makes sense also given that we do the same thing for exports afaict.

Reviewed-by: Andrew Donnellan <redacted>

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited

Re: [PATCH] powerpc/powernv: Make opal log only readable by root

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2019-02-27 11:56:53

Jordan Niethe [off-list ref] writes:
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.
Yikes, thanks for fixing that.

I'll add a Fixes: tag and Cc stable.

I also see symbol_map is 0444, I think that should be fixed too.

cheers
quoted hunk
diff --git a/arch/powerpc/platforms/powernv/opal-msglog.c b/arch/powerpc/platforms/powernv/opal-msglog.c
index acd3206dfae3..06628c71cef6 100644
--- a/arch/powerpc/platforms/powernv/opal-msglog.c
+++ b/arch/powerpc/platforms/powernv/opal-msglog.c
@@ -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
 };
 
-- 
2.20.1

Re: powerpc/powernv: Make opal log only readable by root

From: Michael Ellerman <hidden>
Date: 2019-02-28 09:35:32

On Wed, 2019-02-27 at 03:02:29 UTC, Jordan Niethe wrote:
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.

Signed-off-by: Jordan Niethe <redacted>
Reviewed-by: Stewart Smith <redacted>
Reviewed-by: Andrew Donnellan <redacted>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/7b62f9bd2246b7d3d086e571397c14ba

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help