linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: Make opal log only readable by root
@ 2019-02-27  3:02 Jordan Niethe
  2019-02-27  3:59 ` Stewart Smith
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jordan Niethe @ 2019-02-27  3:02 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: 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 <jniethe5@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/powernv: Make opal log only readable by root
  2019-02-27  3:02 [PATCH] powerpc/powernv: Make opal log only readable by root Jordan Niethe
@ 2019-02-27  3:59 ` Stewart Smith
  2019-02-27  4:17 ` Andrew Donnellan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stewart Smith @ 2019-02-27  3:59 UTC (permalink / raw)
  To: Jordan Niethe, linuxppc-dev; +Cc: Jordan Niethe

Jordan Niethe <jniethe5@gmail.com> 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 <jniethe5@gmail.com>

Yeah, this is a really good idea.

Reviewed-by: Stewart Smith <stewart@linux.ibm.com>

-- 
Stewart Smith
OPAL Architect, IBM.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/powernv: Make opal log only readable by root
  2019-02-27  3:02 [PATCH] powerpc/powernv: Make opal log only readable by root Jordan Niethe
  2019-02-27  3:59 ` Stewart Smith
@ 2019-02-27  4:17 ` Andrew Donnellan
  2019-02-27 11:54 ` Michael Ellerman
  2019-02-28  9:21 ` Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Donnellan @ 2019-02-27  4:17 UTC (permalink / raw)
  To: Jordan Niethe, linuxppc-dev

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 <jniethe5@gmail.com>

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 <andrew.donnellan@au1.ibm.com>

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/powernv: Make opal log only readable by root
  2019-02-27  3:02 [PATCH] powerpc/powernv: Make opal log only readable by root Jordan Niethe
  2019-02-27  3:59 ` Stewart Smith
  2019-02-27  4:17 ` Andrew Donnellan
@ 2019-02-27 11:54 ` Michael Ellerman
  2019-02-28  9:21 ` Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2019-02-27 11:54 UTC (permalink / raw)
  To: Jordan Niethe, linuxppc-dev; +Cc: Jordan Niethe, Stewart Smith

Jordan Niethe <jniethe5@gmail.com> 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

> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: powerpc/powernv: Make opal log only readable by root
  2019-02-27  3:02 [PATCH] powerpc/powernv: Make opal log only readable by root Jordan Niethe
                   ` (2 preceding siblings ...)
  2019-02-27 11:54 ` Michael Ellerman
@ 2019-02-28  9:21 ` Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2019-02-28  9:21 UTC (permalink / raw)
  To: Jordan Niethe, linuxppc-dev; +Cc: Jordan Niethe

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 <jniethe5@gmail.com>
> Reviewed-by: Stewart Smith <stewart@linux.ibm.com>
> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

Applied to powerpc next, thanks.

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

cheers

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-28  9:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-27  3:02 [PATCH] powerpc/powernv: Make opal log only readable by root Jordan Niethe
2019-02-27  3:59 ` Stewart Smith
2019-02-27  4:17 ` Andrew Donnellan
2019-02-27 11:54 ` Michael Ellerman
2019-02-28  9:21 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).