lkml.org 
[lkml]   [2017]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/9] VFS: Introduce a mount context
Date
Matthew Wilcox <willy@infradead.org> wrote:

> On Wed, May 03, 2017 at 11:26:38AM -0700, Joe Perches wrote:
> > On Wed, 2017-05-03 at 14:13 -0400, Jeff Layton wrote:
> > > On Wed, 2017-05-03 at 17:04 +0100, David Howells wrote:
> > > > + oo = kmalloc((opts->num_mnt_opts + 1) * sizeof(char *),
> > > > + GFP_KERNEL);
>
> If we're picking nits, then this should be kcalloc in case somebody
> passed in 2^31 in num_mnt_opts.

A few lines previously there is:

if (opts->num_mnt_opts > 3) {
mc->error = "SELinux: Too many options";
return -EINVAL;
}

David

\
 
 \ /
  Last update: 2017-05-03 23:18    [W:0.118 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site