From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:35305 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752441AbcIINr6 (ORCPT ); Fri, 9 Sep 2016 09:47:58 -0400 Subject: Patch "cred: Reject inodes with invalid ids in set_create_file_as()" has been added to the 4.7-stable tree To: seth.forshee@canonical.com, ebiederm@xmission.com, gregkh@linuxfoundation.org, serge.hallyn@canonical.com Cc: , From: Date: Fri, 09 Sep 2016 15:47:53 +0200 Message-ID: <14734288733450@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled cred: Reject inodes with invalid ids in set_create_file_as() to the 4.7-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: cred-reject-inodes-with-invalid-ids-in-set_create_file_as.patch and it can be found in the queue-4.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 5f65e5ca286126a60f62c8421b77c2018a482b8a Mon Sep 17 00:00:00 2001 From: Seth Forshee Date: Tue, 26 Apr 2016 14:36:24 -0500 Subject: cred: Reject inodes with invalid ids in set_create_file_as() From: Seth Forshee commit 5f65e5ca286126a60f62c8421b77c2018a482b8a upstream. Using INVALID_[UG]ID for the LSM file creation context doesn't make sense, so return an error if the inode passed to set_create_file_as() has an invalid id. Signed-off-by: Seth Forshee Acked-by: Serge Hallyn Signed-off-by: Eric W. Biederman Signed-off-by: Greg Kroah-Hartman --- kernel/cred.c | 2 ++ 1 file changed, 2 insertions(+) --- a/kernel/cred.c +++ b/kernel/cred.c @@ -689,6 +689,8 @@ EXPORT_SYMBOL(set_security_override_from */ int set_create_files_as(struct cred *new, struct inode *inode) { + if (!uid_valid(inode->i_uid) || !gid_valid(inode->i_gid)) + return -EINVAL; new->fsuid = inode->i_uid; new->fsgid = inode->i_gid; return security_kernel_create_files_as(new, inode); Patches currently in stable-queue which might be from seth.forshee@canonical.com are queue-4.7/cred-reject-inodes-with-invalid-ids-in-set_create_file_as.patch queue-4.7/fs-check-for-invalid-i_uid-in-may_follow_link.patch