* [PATCH v3 5/8] fs: use new capable_any functionality
[not found] ` <20220615152623.311223-1-cgzones@googlemail.com>
@ 2022-06-15 15:26 ` Christian Göttsche
2022-06-28 12:56 ` Christian Brauner
0 siblings, 1 reply; 3+ messages in thread
From: Christian Göttsche @ 2022-06-15 15:26 UTC (permalink / raw)
To: selinux
Cc: Alexander Viro, Serge Hallyn, linux-fsdevel, linux-kernel,
linux-security-module
Use the new added capable_any function in appropriate cases, where a
task is required to have any of two capabilities.
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
v3:
rename to capable_any()
---
fs/pipe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/pipe.c b/fs/pipe.c
index 74ae9fafd25a..18ab3baeec44 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -776,7 +776,7 @@ bool too_many_pipe_buffers_hard(unsigned long user_bufs)
bool pipe_is_unprivileged_user(void)
{
- return !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN);
+ return !capable_any(CAP_SYS_RESOURCE, CAP_SYS_ADMIN);
}
struct pipe_inode_info *alloc_pipe_info(void)
--
2.36.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3 5/8] fs: use new capable_any functionality
2022-06-15 15:26 ` [PATCH v3 5/8] fs: use new capable_any functionality Christian Göttsche
@ 2022-06-28 12:56 ` Christian Brauner
2022-06-28 14:11 ` Christian Göttsche
0 siblings, 1 reply; 3+ messages in thread
From: Christian Brauner @ 2022-06-28 12:56 UTC (permalink / raw)
To: Christian Göttsche
Cc: selinux, Alexander Viro, Serge Hallyn, linux-fsdevel,
linux-kernel, linux-security-module
On Wed, Jun 15, 2022 at 05:26:19PM +0200, Christian Göttsche wrote:
> Use the new added capable_any function in appropriate cases, where a
> task is required to have any of two capabilities.
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
> ---
Not seeing the whole patch series so it's a bit difficult to judge but
in general we've needed something like this for quite some time.
> v3:
> rename to capable_any()
> ---
> fs/pipe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/pipe.c b/fs/pipe.c
> index 74ae9fafd25a..18ab3baeec44 100644
> --- a/fs/pipe.c
> +++ b/fs/pipe.c
> @@ -776,7 +776,7 @@ bool too_many_pipe_buffers_hard(unsigned long user_bufs)
>
> bool pipe_is_unprivileged_user(void)
> {
> - return !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN);
> + return !capable_any(CAP_SYS_RESOURCE, CAP_SYS_ADMIN);
> }
>
> struct pipe_inode_info *alloc_pipe_info(void)
> --
> 2.36.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3 5/8] fs: use new capable_any functionality
2022-06-28 12:56 ` Christian Brauner
@ 2022-06-28 14:11 ` Christian Göttsche
0 siblings, 0 replies; 3+ messages in thread
From: Christian Göttsche @ 2022-06-28 14:11 UTC (permalink / raw)
To: Christian Brauner
Cc: SElinux list, Alexander Viro, Serge Hallyn, linux-fsdevel,
Linux kernel mailing list, linux-security-module
On Tue, 28 Jun 2022 at 14:57, Christian Brauner <brauner@kernel.org> wrote:
>
> On Wed, Jun 15, 2022 at 05:26:19PM +0200, Christian Göttsche wrote:
> > Use the new added capable_any function in appropriate cases, where a
> > task is required to have any of two capabilities.
> >
> > Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
> > ---
>
> Not seeing the whole patch series so it's a bit difficult to judge but
> in general we've needed something like this for quite some time.
Full patch series:
https://patchwork.kernel.org/project/selinux/list/?series=650662
or
https://lore.kernel.org/lkml/20220615152623.311223-8-cgzones@googlemail.com/
> > v3:
> > rename to capable_any()
> > ---
> > fs/pipe.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/pipe.c b/fs/pipe.c
> > index 74ae9fafd25a..18ab3baeec44 100644
> > --- a/fs/pipe.c
> > +++ b/fs/pipe.c
> > @@ -776,7 +776,7 @@ bool too_many_pipe_buffers_hard(unsigned long user_bufs)
> >
> > bool pipe_is_unprivileged_user(void)
> > {
> > - return !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN);
> > + return !capable_any(CAP_SYS_RESOURCE, CAP_SYS_ADMIN);
> > }
> >
> > struct pipe_inode_info *alloc_pipe_info(void)
> > --
> > 2.36.1
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-28 14:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220502160030.131168-8-cgzones@googlemail.com>
[not found] ` <20220615152623.311223-1-cgzones@googlemail.com>
2022-06-15 15:26 ` [PATCH v3 5/8] fs: use new capable_any functionality Christian Göttsche
2022-06-28 12:56 ` Christian Brauner
2022-06-28 14:11 ` Christian Göttsche
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).