[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190502165836.GX23075@ZenIV.linux.org.uk>
Date: Thu, 2 May 2019 17:58:36 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Mimi Zohar <zohar@...ux.ibm.com>
Cc: Prakhar Srivastava <prsriva02@...il.com>,
linux-integrity@...r.kernel.org,
linux-secuirty-module@...r.kernel.org,
linux-kernel@...r.kernel.org, ebiederm@...ssion.com,
vgoyal@...hat.com, nayna@...ux.ibm.com
Subject: Re: [PATCH v3 3/4] add kexec_cmdline used to ima
On Thu, May 02, 2019 at 12:52:35PM -0400, Mimi Zohar wrote:
> On Mon, 2019-04-29 at 14:47 -0700, Prakhar Srivastava wrote:
> > From: Prakhar Srivastava <prsriva02@...il.com>
> kexec doesn't really know or care about IMA. Other than the IMA call,
> itself, nothing should be added to kexec files. As mentioned in 1/4,
> the IMA hook would be named something like ima_kexec_cmdline().
> > + f = fdget(kernel_fd);
> > + if (!f.file)
> > + goto out;
> > +
> > + size = (f.file->f_path.dentry->d_name.len + cmdline_len - 1+
> > + ARRAY_SIZE(delimiter)) - 1;
> > +
> > + buf = kzalloc(size, GFP_KERNEL);
> > + if (!buf)
> > + goto out;
> > +
> > + memcpy(buf, f.file->f_path.dentry->d_name.name,
> > + f.file->f_path.dentry->d_name.len);
> > + memcpy(buf + f.file->f_path.dentry->d_name.len,
> > + delimiter, ARRAY_SIZE(delimiter) - 1);
> > + memcpy(buf + f.file->f_path.dentry->d_name.len +
> > + ARRAY_SIZE(delimiter) - 1,
> > + cmdline_ptr, cmdline_len - 1);
Another thing is that it's so obviously racy, it's not even funny.
Consider what rename(2) in parallel will do to that.
Powered by blists - more mailing lists