powerpc/powernv: Make opal log only readable by root
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
@@ -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
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.
Signed-off-by Jordan Niethe <[email protected]>
Yeah, this is a really good idea.
Signature · 2 lines
Stewart Smith OPAL Architect, IBM.
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.
Signed-off-by Jordan Niethe <[email protected]>
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
Michael Ellerman
reviewerQuoted 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@@ -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
Michael Ellerman
AppliedQuoted 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.
Signed-off-by Jordan Niethe <[email protected]>Reviewed-by Stewart Smith <[email protected]>Reviewed-by Andrew Donnellan <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/7b62f9bd2246b7d3d086e571397c14ba
cheers