* [PATCH] efi/esrt: Allow ESRT access without CAP_SYS_ADMIN
@ 2023-05-12 19:43 Nicholas Bishop
2023-05-22 8:11 ` Ard Biesheuvel
0 siblings, 1 reply; 4+ messages in thread
From: Nicholas Bishop @ 2023-05-12 19:43 UTC (permalink / raw)
To: Ard Biesheuvel, linux-efi; +Cc: linux-kernel, Peter Jones, Nicholas Bishop
Access to the files in /sys/firmware/efi/esrt has been restricted to
CAP_SYS_ADMIN since support for ESRT was added, but this seems overly
restrictive given that the files are read-only and just provide
information about UEFI firmware updates.
Remove the CAP_SYS_ADMIN restriction so that a non-root process can read
the files, provided a suitably-privileged process changes the file
ownership first. The files are still read-only and still owned by root by
default.
Signed-off-by: Nicholas Bishop <nicholasbishop@google.com>
---
drivers/firmware/efi/esrt.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c
index d5915272141f..aab96ab64a1a 100644
--- a/drivers/firmware/efi/esrt.c
+++ b/drivers/firmware/efi/esrt.c
@@ -95,10 +95,6 @@ static ssize_t esre_attr_show(struct kobject *kobj,
struct esre_entry *entry = to_entry(kobj);
struct esre_attribute *attr = to_attr(_attr);
- /* Don't tell normal users what firmware versions we've got... */
- if (!capable(CAP_SYS_ADMIN))
- return -EACCES;
-
return attr->show(entry, buf);
}
--
2.40.1.606.ga4b1b128d6-goog
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] efi/esrt: Allow ESRT access without CAP_SYS_ADMIN
2023-05-12 19:43 [PATCH] efi/esrt: Allow ESRT access without CAP_SYS_ADMIN Nicholas Bishop
@ 2023-05-22 8:11 ` Ard Biesheuvel
2023-06-02 12:59 ` Ard Biesheuvel
2023-06-06 17:45 ` Peter Jones
0 siblings, 2 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2023-05-22 8:11 UTC (permalink / raw)
To: Nicholas Bishop, Peter Jones; +Cc: linux-efi, linux-kernel
On Fri, 12 May 2023 at 21:43, Nicholas Bishop <nicholasbishop@google.com> wrote:
>
> Access to the files in /sys/firmware/efi/esrt has been restricted to
> CAP_SYS_ADMIN since support for ESRT was added, but this seems overly
> restrictive given that the files are read-only and just provide
> information about UEFI firmware updates.
>
> Remove the CAP_SYS_ADMIN restriction so that a non-root process can read
> the files, provided a suitably-privileged process changes the file
> ownership first. The files are still read-only and still owned by root by
> default.
>
> Signed-off-by: Nicholas Bishop <nicholasbishop@google.com>
Seems reasonable to me. Peter?
> ---
> drivers/firmware/efi/esrt.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c
> index d5915272141f..aab96ab64a1a 100644
> --- a/drivers/firmware/efi/esrt.c
> +++ b/drivers/firmware/efi/esrt.c
> @@ -95,10 +95,6 @@ static ssize_t esre_attr_show(struct kobject *kobj,
> struct esre_entry *entry = to_entry(kobj);
> struct esre_attribute *attr = to_attr(_attr);
>
> - /* Don't tell normal users what firmware versions we've got... */
> - if (!capable(CAP_SYS_ADMIN))
> - return -EACCES;
> -
> return attr->show(entry, buf);
> }
>
> --
> 2.40.1.606.ga4b1b128d6-goog
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] efi/esrt: Allow ESRT access without CAP_SYS_ADMIN
2023-05-22 8:11 ` Ard Biesheuvel
@ 2023-06-02 12:59 ` Ard Biesheuvel
2023-06-06 17:45 ` Peter Jones
1 sibling, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2023-06-02 12:59 UTC (permalink / raw)
To: Nicholas Bishop, Peter Jones; +Cc: linux-efi, linux-kernel
On Mon, 22 May 2023 at 10:11, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Fri, 12 May 2023 at 21:43, Nicholas Bishop <nicholasbishop@google.com> wrote:
> >
> > Access to the files in /sys/firmware/efi/esrt has been restricted to
> > CAP_SYS_ADMIN since support for ESRT was added, but this seems overly
> > restrictive given that the files are read-only and just provide
> > information about UEFI firmware updates.
> >
> > Remove the CAP_SYS_ADMIN restriction so that a non-root process can read
> > the files, provided a suitably-privileged process changes the file
> > ownership first. The files are still read-only and still owned by root by
> > default.
> >
> > Signed-off-by: Nicholas Bishop <nicholasbishop@google.com>
>
> Seems reasonable to me. Peter?
>
I've queued this up now.
> > ---
> > drivers/firmware/efi/esrt.c | 4 ----
> > 1 file changed, 4 deletions(-)
> >
> > diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c
> > index d5915272141f..aab96ab64a1a 100644
> > --- a/drivers/firmware/efi/esrt.c
> > +++ b/drivers/firmware/efi/esrt.c
> > @@ -95,10 +95,6 @@ static ssize_t esre_attr_show(struct kobject *kobj,
> > struct esre_entry *entry = to_entry(kobj);
> > struct esre_attribute *attr = to_attr(_attr);
> >
> > - /* Don't tell normal users what firmware versions we've got... */
> > - if (!capable(CAP_SYS_ADMIN))
> > - return -EACCES;
> > -
> > return attr->show(entry, buf);
> > }
> >
> > --
> > 2.40.1.606.ga4b1b128d6-goog
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] efi/esrt: Allow ESRT access without CAP_SYS_ADMIN
2023-05-22 8:11 ` Ard Biesheuvel
2023-06-02 12:59 ` Ard Biesheuvel
@ 2023-06-06 17:45 ` Peter Jones
1 sibling, 0 replies; 4+ messages in thread
From: Peter Jones @ 2023-06-06 17:45 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: Nicholas Bishop, linux-efi, linux-kernel
On Mon, May 22, 2023 at 4:11 AM Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Fri, 12 May 2023 at 21:43, Nicholas Bishop <nicholasbishop@google.com> wrote:
> >
> > Access to the files in /sys/firmware/efi/esrt has been restricted to
> > CAP_SYS_ADMIN since support for ESRT was added, but this seems overly
> > restrictive given that the files are read-only and just provide
> > information about UEFI firmware updates.
> >
> > Remove the CAP_SYS_ADMIN restriction so that a non-root process can read
> > the files, provided a suitably-privileged process changes the file
> > ownership first. The files are still read-only and still owned by root by
> > default.
> >
> > Signed-off-by: Nicholas Bishop <nicholasbishop@google.com>
>
> Seems reasonable to me. Peter?
Yeah, I don't think we had any specific reason to limit it.
-- Peter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-06-06 17:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 19:43 [PATCH] efi/esrt: Allow ESRT access without CAP_SYS_ADMIN Nicholas Bishop
2023-05-22 8:11 ` Ard Biesheuvel
2023-06-02 12:59 ` Ard Biesheuvel
2023-06-06 17:45 ` Peter Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®