From patchwork Wed Nov 29 20:43:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 842753 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lt2STAiO"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ftfN+AnE"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ynCGJ1NJgz9s72 for ; Thu, 30 Nov 2017 07:45:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=KWIoiSbFu8/jJtLeUNN7oAfbBiuvy2107M+/BYuEXkc=; b=lt2STAiOGTrA3zirn34W3tDbCQ FlcRteN/1mge8NXHT3wBiDQx/5p4fE3Cz3ujdf5PAtGLBmqccc3cdoqX/xYlxsXsvImsS0cScwdCQ ysEpJPFM1Cc7ghLpZ3qncf9kGdjpcOoDKuf3t4bgmOxshF/AIRkgDkQP4nESdqlnyTGS7sTPVgfjc G7EbVHqjQrbRUp6olYocfSwJTIwi0+JwobtUVmNyerrSugMOZykcZT6lp5YfSFtlePsxuqzJtZzFi PdMlM89TR+89OE7gHrts+Vh8yHEbNYkRem9qf5mPonbSobqlzL+YCwy+2gm20yiyYNu1HBNojqMfQ 4dmXuKdA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eK9E8-0003V1-I5; Wed, 29 Nov 2017 20:45:04 +0000 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eK9Di-0002vF-HB for linux-mtd@lists.infradead.org; Wed, 29 Nov 2017 20:44:41 +0000 Received: by mail-it0-x241.google.com with SMTP id r6so5771336itr.3 for ; Wed, 29 Nov 2017 12:44:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DC1Spcz6XibfSD3gTEIjLDTxs+1j3zVr9HN12XxNxNk=; b=ftfN+AnE+pyLzcrCnLkiLAv4G6nFeD15o+pi/tZIKkkvsuerRnZHTqLqCddacWSi/G ro2hjt4C3epHL259l13N/hSYfKCrMbMqUhnvYTGgUc3ezc4+ZMwHwUII65XkDfVcky33 ytcjD2tSkiL0QMqsfOeaYg4GeCCVf008kUZBCEp/fLvsquqdWZBYpRbnBso/wesl9qBZ aDuAinG7SWLN2vkTH8ab9FXzYiXA/r9vGExhlbevu0OS0Lx9FkM3FPeqQbEZNCb7ih6S 08Vv6PEBkmVHDu8dJJ2+B4AmWB4WK7EOGksfZ2Euwj7HctHA1/e01OBKQ+KW8WFrqyoR +71Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DC1Spcz6XibfSD3gTEIjLDTxs+1j3zVr9HN12XxNxNk=; b=VR9DTVnewN+b7LDlxcCNMAMJfvxNxcupaPehBqe8MfZLycsYWep4WJXNttFllDEP7X 9yXpfDd/6/g4mIfrRIKGr8C1J3YGuMn5jCGx71gm09/uLciw3kfzb/hRDNEhJzs23nm5 5AcJPS5fl5+bSwoNxatFG4KaxO74HCq7WCuWaMQQyUtPY3Xhjd7PcF9HtEuu6N5vNTdG CmcmqF8nsXbYnHj/q09ivQHCH/Df6LKBk6fvM+oeE1sdC7wCaueRbn84xz892JgP4h1U B2l24R1oAN50dWySpgOLH/L43xyGzeFhAt7NiGpT2d0JDqSneFtY+/D5Dj7HQ5JZLhO6 b1HQ== X-Gm-Message-State: AJaThX4zQM7QUEXclwGQpe0kOXv5g3F7Oidkm/F/pX5Kb27bIxihiy+P rYwyLCzBHdGadiPbu2gjEEIkOyHkKXE= X-Google-Smtp-Source: AGs4zMZX8dlRL04goJa1k3rOrMJe7/7D1DqjOxJvrg9nxYmQWG/h66yFl0qJnCfsRncISVOOUiTwJQ== X-Received: by 10.36.176.9 with SMTP id d9mr104174itf.125.1511988257216; Wed, 29 Nov 2017 12:44:17 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.175.88]) by smtp.gmail.com with ESMTPSA id l4sm1111112ioc.69.2017.11.29.12.44.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 12:44:16 -0800 (PST) From: Eric Biggers To: linux-mtd@lists.infradead.org, Richard Weinberger Subject: [PATCH v2 2/5] ubifs: switch to fscrypt_prepare_link() Date: Wed, 29 Nov 2017 12:43:14 -0800 Message-Id: <20171129204317.91205-3-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129204317.91205-1-ebiggers3@gmail.com> References: <20171129204317.91205-1-ebiggers3@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_124438_957893_E83F3B15 X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4001:c0b:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (ebiggers3[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ebiggers3[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fscrypt@vger.kernel.org, Eric Biggers , Adrian Hunter , Artem Bityutskiy MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Eric Biggers Signed-off-by: Eric Biggers --- fs/ubifs/dir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 417fe0b29f23..09e6c56b11bc 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -743,9 +743,9 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir, ubifs_assert(inode_is_locked(dir)); ubifs_assert(inode_is_locked(inode)); - if (ubifs_crypt_is_encrypted(dir) && - !fscrypt_has_permitted_context(dir, inode)) - return -EPERM; + err = fscrypt_prepare_link(old_dentry, dir, dentry); + if (err) + return err; err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm); if (err)