From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aM2lD-00077C-2V for kexec@lists.infradead.org; Thu, 21 Jan 2016 00:05:59 +0000 Date: Thu, 21 Jan 2016 01:05:36 +0100 From: "Luis R. Rodriguez" Subject: Re: [RFC PATCH v2 09/11] ima: load policy using path Message-ID: <20160121000536.GO11277@wotan.suse.de> References: <1453129886-20192-1-git-send-email-zohar@linux.vnet.ibm.com> <1453129886-20192-10-git-send-email-zohar@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1453129886-20192-10-git-send-email-zohar@linux.vnet.ibm.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Mimi Zohar Cc: Dmitry Torokhov , Kees Cook , fsdevel@vger.kernel.org, Dmitry Kasatkin , Dmitry Kasatkin , kexec@lists.infradead.org, David Howells , linux-security-module@vger.kernel.org, David Woodhouse , linux-modules@vger.kernel.org On Mon, Jan 18, 2016 at 10:11:24AM -0500, Mimi Zohar wrote: > --- a/fs/exec.c > +++ b/fs/exec.c > @@ -903,6 +903,27 @@ out: > return ret; > } > > +int kernel_read_file_from_path(char *path, void **buf, loff_t *size, > + loff_t max_size, int policy_id) > +{ > + struct file *file; > + int ret; > + > + if (!path || !*path) > + return -EINVAL; > + > + file = filp_open(path, O_RDONLY, 0); > + if (IS_ERR(file)) { > + ret = PTR_ERR(file); > + pr_err("Unable to open file: %s (%d)", path, ret); > + return ret; > + } > + > + ret = kernel_read_file(file, buf, size, max_size, policy_id); > + fput(file); > + return ret; > +} > + EXPORT_SYMBOL_GPL() needed. Luis _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec