lkml.org 
[lkml]   [2019]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] fs/open: Fix most outstanding security bugs
On Mon, Apr 1, 2019 at 4:14 PM Nikolay Borisov <nborisov@suse.com> wrote:
> On 1.04.19 г. 12:01 ч., Johannes Thumshirn wrote:
> > Over the last 20 years, the Linux kernel has accumulated hundreds if not
> > thousands of security vulnerabilities.
> >
> > One common pattern in most of these security related reports is processes
> > called "syzkaller", "trinity" or "syz-executor" opening files and then
> > abuse kernel interfaces causing kernel crashes or even worse threats using
> > memory overwrites or by exploiting race conditions.
> >
> > Hunting down these bugs has become time consuming and very expensive, so
> > I've decided to put an end to it.
> >
> > If one of the above mentioned processes tries opening a file, return -EPERM
> > indicating this process does not have the permission to open files on Linux
> > anymore.
> >
> > Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
>
> Ack-by: Nikolay Borisov <nborisov@suse.com>

Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Cc: stable@vger.kernel.org # v1.0+

Do we want to extend this to other subsystems?
Should it be a default secomp filter?

> > ---
> > fs/open.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/fs/open.c b/fs/open.c
> > index f1c2f855fd43..3a3b460beccd 100644
> > --- a/fs/open.c
> > +++ b/fs/open.c
> > @@ -1056,6 +1056,20 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
> > struct open_flags op;
> > int fd = build_open_flags(flags, mode, &op);
> > struct filename *tmp;
> > + char comm[TASK_COMM_LEN];
> > + int i;
> > + static const char * const list[] = {
> > + "syzkaller",
> > + "syz-executor,"
> > + "trinity",
> > + NULL
> > + };
> > +
> > + get_task_comm(comm, current);
> > +
> > + for (i = 0; i < ARRAY_SIZE(list); i++)
> > + if (!strncmp(comm, list[i], strlen(list[i])))
> > + return -EPERM;
> >
> > if (fd)
> > return fd;
> >

\
 
 \ /
  Last update: 2019-04-01 19:52    [W:0.107 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site