From patchwork Wed Jul 22 13:03:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Gr=C3=BCnbacher?= X-Patchwork-Id: 6842981 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 446A59F380 for ; Wed, 22 Jul 2015 13:10:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A593206CC for ; Wed, 22 Jul 2015 13:10:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A50C7206B6 for ; Wed, 22 Jul 2015 13:10:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933931AbbGVNJK (ORCPT ); Wed, 22 Jul 2015 09:09:10 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:37314 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756999AbbGVNEs (ORCPT ); Wed, 22 Jul 2015 09:04:48 -0400 Received: by wibud3 with SMTP id ud3so171505712wib.0; Wed, 22 Jul 2015 06:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3GVIt76D/8gwJg3zktCt6d1FOfYvb9BYLM+9m9q4y0Y=; b=xiBJsxHe1yDAFdufmE7VYekm7mqLDE5veSer3lb8BVEXYCV9aUhEQqTg+BaPMG7LAj 17bRQO7nXvTMhaggtJZ29f1Of14QHT7nE0qnCvLtIo1Rx8xlmyaropepVm4MgE+IfBdG eqjAghI6vla2YLVdcq1X6QD4+3WufYgJGX7EgTrJOSFOCd9mIRTm1jxTQd+KO62X6Klt N65VfbId+zCraBttbFawPhNzb6JRIcy07SfL8VzouGv4S4KSgtXCLvEzs77CL1QqKJS5 pYhFb+eGinPL6to7omTqONBxO1al4k9Sa9EN8vCLiGh0KzLls8ZcQfH98IK3abtM1cEj 8rdA== X-Received: by 10.180.78.35 with SMTP id y3mr41841540wiw.62.1437570286050; Wed, 22 Jul 2015 06:04:46 -0700 (PDT) Received: from schleppi.home.com ([149.14.88.26]) by smtp.gmail.com with ESMTPSA id u7sm21992628wif.3.2015.07.22.06.04.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 06:04:45 -0700 (PDT) From: Andreas Gruenbacher To: linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-api@vger.kernel.org, samba-technical@lists.samba.org, linux-security-module@vger.kernel.org, Andreas Gruenbacher Subject: [PATCH v5 33/39] ext4: Don't allow unmapped identifiers in richacls Date: Wed, 22 Jul 2015 15:03:23 +0200 Message-Id: <1437570209-29832-34-git-send-email-andreas.gruenbacher@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1437570209-29832-1-git-send-email-andreas.gruenbacher@gmail.com> References: <1437570209-29832-1-git-send-email-andreas.gruenbacher@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andreas Gruenbacher Don't allow acls which contain unmapped identifiers: they are meaningful for remote file systems only. Signed-off-by: Andreas Gruenbacher --- fs/ext4/richacl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/ext4/richacl.c b/fs/ext4/richacl.c index 6ffb2ae..8aa539e 100644 --- a/fs/ext4/richacl.c +++ b/fs/ext4/richacl.c @@ -68,7 +68,13 @@ ext4_set_richacl(handle_t *handle, struct inode *inode, struct richacl *acl) int retval; if (acl) { - mode_t mode = inode->i_mode; + mode_t mode; + + /* Don't allow acls with unmapped identifiers. */ + if (richacl_has_unmapped_identifiers(acl)) + return -EINVAL; + + mode = inode->i_mode; if (richacl_equiv_mode(acl, &mode) == 0) { inode->i_mode = mode; ext4_mark_inode_dirty(handle, inode);