Skip to contentSkip to conversation

powerpc/powernv: Make opal log only readable by root

PATCH Applied Jordan Niethe 5 participants 5 messages Feb 27, 2019 – Feb 28, 2019 PowerPC

lore
Share & tools
lore
#0 lore raw

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

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.

---
 arch/powerpc/platforms/powernv/opal-msglog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/powernv/opal-msglog.c +1 -1
index acd3206dfae3..06628c71cef6 100644
@@ -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
 };
 
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jordan Niethe

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.

Yeah, this is a really good idea.

Signature · 2 lines
Stewart Smith
OPAL Architect, IBM.
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jordan Niethe
Quoted 6 lines · Jordan Niethe

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.

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.

Signature · 2 lines
Andrew Donnellan              OzLabs, ADL Canberra
[email protected]  IBM Australia Limited
#3 lore raw
In reply to Jordan Niethe
Quoted 4 lines · Jordan Niethe

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 15 lines
arch/powerpc/platforms/powernv/opal-msglog.c +1 -1
index acd3206dfae3..06628c71cef6 100644
@@ -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
 };
 
Signature · 1 line
2.20.1
#4 lore raw
In reply to Jordan Niethe
Quoted 8 lines · Jordan Niethe

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.

Applied to powerpc next, thanks.

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

cheers