lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1322848025.3780.8.camel@lappy>
Date:	Fri, 02 Dec 2011 19:47:05 +0200
From:	Sasha Levin <levinsasha928@...il.com>
To:	Pekka Enberg <penberg@...nel.org>
Cc:	linux-kernel@...r.kernel.org,
	Alexander Viro <viro@...iv.linux.org.uk>,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v2] pipe: Fail cleanly when root tries F_SETPIPE_SZ with
 big size

Al, Ping?

On Sat, 2011-11-19 at 10:06 +0200, Pekka Enberg wrote:
> On Sat, Nov 19, 2011 at 9:34 AM, Sasha Levin <levinsasha928@...il.com> wrote:
> > When a user with the CAP_SYS_RESOURCE cap tries to F_SETPIPE_SZ a pipe with
> > size bigger than what kmalloc() can alloc it spits out an ugly warning:
> 
> [snip]
> 
> > Instead, make kcalloc() handle the overflow case and fail quietly.
> >
> > Cc: Alexander Viro <viro@...iv.linux.org.uk>
> > Cc: Pekka Enberg <penberg@...nel.org>
> > Cc: linux-fsdevel@...r.kernel.org
> > Signed-off-by: Sasha Levin <levinsasha928@...il.com>
> 
> Acked-by: Pekka Enberg <penberg@...nel.org>
> 
> > ---
> >  fs/pipe.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/fs/pipe.c b/fs/pipe.c
> > index 4065f07..3e38dc6 100644
> > --- a/fs/pipe.c
> > +++ b/fs/pipe.c
> > @@ -1137,7 +1137,7 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long nr_pages)
> >        if (nr_pages < pipe->nrbufs)
> >                return -EBUSY;
> >
> > -       bufs = kcalloc(nr_pages, sizeof(struct pipe_buffer), GFP_KERNEL);
> > +       bufs = kcalloc(nr_pages, sizeof(struct pipe_buffer), GFP_KERNEL | __GFP_NOWARN);
> >        if (unlikely(!bufs))
> >                return -ENOMEM;
> >
> > --
> > 1.7.8.rc1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@...r.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> >

-- 

Sasha.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ