From patchwork Tue Aug 4 11:53:32 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: 6937121 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E93AAC05AC for ; Tue, 4 Aug 2015 11:59:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 253C52045E for ; Tue, 4 Aug 2015 11:59:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4725020452 for ; Tue, 4 Aug 2015 11:59:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933885AbbHDL7S (ORCPT ); Tue, 4 Aug 2015 07:59:18 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:33329 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933786AbbHDLzp (ORCPT ); Tue, 4 Aug 2015 07:55:45 -0400 Received: by wijp15 with SMTP id p15so2385640wij.0; Tue, 04 Aug 2015 04:55:43 -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=7R2J3vJqwCNFoCFKIrI1NJhz+Vs6I/sj9trB5nvPaM8=; b=ccq70PrERy4++FZ3o/WPyz18mF0A0zgpZ8zLOhU533hpPDaRZp7mlDzX79jZ3dYkqz 28MkDxDDwKWejquoJZE5ieaHZrM+dOanDuMfFUuMy9OFj1UcFNPLIlsdHF0DBbGZkOgM AGI1MbN3V/KLw2nr7jB2LmKNwZaslOPCYK5GAoGqcFtej+QIowgkkdar1yDEYXQBB9zg d3Eo8DaR3YKG2FMsHqWBMx2pIfDwE8JZStlWhOCzApeBQRL2H2K4yCV/R1cUQzSiUiw4 j5HulXuz77GZihOGKlnQcVxeCiByDAThUCe7fnT3JYERkI2by8YtRDDGcuhMvTz4P9vJ ls3g== X-Received: by 10.180.91.76 with SMTP id cc12mr45727975wib.67.1438689343634; Tue, 04 Aug 2015 04:55:43 -0700 (PDT) Received: from schleppi.home.com (p54980F84.dip0.t-ipconnect.de. [84.152.15.132]) by smtp.gmail.com with ESMTPSA id u7sm2018458wif.3.2015.08.04.04.55.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 04:55:42 -0700 (PDT) From: Andreas Gruenbacher X-Google-Original-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, linux-cifs@vger.kernel.org, linux-security-module@vger.kernel.org, Andreas Gruenbacher Subject: [RFC v6 34/40] ext4: Don't allow unmapped identifiers in richacls Date: Tue, 4 Aug 2015 13:53:32 +0200 Message-Id: <1438689218-6921-35-git-send-email-agruenba@redhat.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1438689218-6921-1-git-send-email-agruenba@redhat.com> References: <1438689218-6921-1-git-send-email-agruenba@redhat.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SUSPICIOUS_RECIPS, 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 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/ext4/richacl.c b/fs/ext4/richacl.c index 4385f6d..9d80299 100644 --- a/fs/ext4/richacl.c +++ b/fs/ext4/richacl.c @@ -68,8 +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);