{"id":816591,"url":"http://patchwork.ozlabs.org/api/patches/816591/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/patch/20170920224605.22030-24-ebiggers3@gmail.com/","project":{"id":3,"url":"http://patchwork.ozlabs.org/api/projects/3/?format=json","name":"Linux MTD development","link_name":"linux-mtd","list_id":"linux-mtd.lists.infradead.org","list_email":"linux-mtd@lists.infradead.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170920224605.22030-24-ebiggers3@gmail.com>","list_archive_url":null,"date":"2017-09-20T22:46:03","name":"[23/25] ubifs: switch to fscrypt_prepare_rename()","commit_ref":null,"pull_url":null,"state":"deferred","archived":false,"hash":"3cf9b97e570a7f2470ce317baabb669113737cc8","submitter":{"id":65202,"url":"http://patchwork.ozlabs.org/api/people/65202/?format=json","name":"Eric Biggers","email":"ebiggers3@gmail.com"},"delegate":{"id":54851,"url":"http://patchwork.ozlabs.org/api/users/54851/?format=json","username":"rw","first_name":"Richard","last_name":"Weinberger","email":"richard@nod.at"},"mbox":"http://patchwork.ozlabs.org/project/linux-mtd/patch/20170920224605.22030-24-ebiggers3@gmail.com/mbox/","series":[{"id":4250,"url":"http://patchwork.ozlabs.org/api/series/4250/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/list/?series=4250","date":"2017-09-20T22:45:45","name":"fscrypt: add some higher-level helper functions","version":1,"mbox":"http://patchwork.ozlabs.org/series/4250/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/816591/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816591/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"DDLroncX\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=infradead.org header.i=@infradead.org\n\theader.b=\"P3T1FqAY\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Gw51A00T\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xyFsy5D93z9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 09:13:42 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1duoBT-0007tq-JK; Wed, 20 Sep 2017 23:13:35 +0000","from casper.infradead.org ([2001:8b0:10b:1236::1])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1duoAm-0006j8-8o\n\tfor linux-mtd@bombadil.infradead.org; Wed, 20 Sep 2017 23:12:52 +0000","from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242])\n\tby casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dunmJ-0004t9-E7\n\tfor linux-mtd@lists.infradead.org; Wed, 20 Sep 2017 22:47:37 +0000","by mail-pf0-x242.google.com with SMTP id e69so1716587pfg.4\n\tfor <linux-mtd@lists.infradead.org>;\n\tWed, 20 Sep 2017 15:47:17 -0700 (PDT)","from ebiggers-linuxstation.kir.corp.google.com ([100.66.174.81])\n\tby smtp.gmail.com with ESMTPSA id j2sm6249pgn.26.2017.09.20.15.47.15\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 20 Sep 2017 15:47:15 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:\n\tIn-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=6jRGkRb+W8UrvKTC1ZurWG1M7qa8gApSEcpeJZSBYZU=;\n\tb=DDLroncXRM9HKFp4/MRHT78W6g\n\tz8tGJlkJkGEA4PWWyTHXki06Zyw833KlcNggJJhuKzSB9gOLdCUu9aLOQOkpWHdWNU8tm7Nl3LIbG\n\tSRArVS4QiQTsLL1ZbtaW6ZvjRVnDk0H7LPAPgaTzxZwz/3tSeetDk3QIqk/RuKu6zb/GXIj6a5H2z\n\tQbkpgcPmcq9iei0QDD9IxkMgpW8fuLWbFaR7nXkRpdKHEX72BVhyG1atGomT6ElrjY8oFH0h0WsDC\n\tdIduUVyJeqUhRlMmnjyReFj1vbZf6TYooLjVGxnpAYcRT5sEwT099QRXrnIjvWVk8STIRLryus3Pa\n\tPYhwF83w==;","v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=casper.20170209;\n\th=References:In-Reply-To:Message-Id:Date:\n\tSubject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type:\n\tContent-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:\n\tResent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:\n\tList-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;\n\tbh=3FtVWARjoE+b9wG70tcBL/JSR+i6aA4xoM6RIVGGK1c=;\n\tb=P3T1FqAYvSGTND5TzHmoM/E39\n\t13QzGwhb2RUGpdPlqNavS0/OQtfQ/g1tAele6BO9X95xAhq38EN6xUfpzjAi6vn7BoTgbrAO3E1IS\n\tmkM68kef1Wfjk8MjICiLRQ1OUdOOk55SqbRrkWMef7gSaOrvC/zDpCw4Xj/oznlHpSVv6YpGfnJLS\n\tcd1OLBYmD6b/KFzfji5SlQLicBzBOUqs7Q3yP7xwE/WKFgn4/n2eN3aQyfwrRizrxJa073GTJV/Qz\n\tu6RmTbZntLra1RAI0sfJWUAZupHTsDJ6cnFuCoPLtdi9lDKPy2M6CijPiiyW/Kb7Kd/H8p+d5X5Z0\n\toluYYUdxw==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=3FtVWARjoE+b9wG70tcBL/JSR+i6aA4xoM6RIVGGK1c=;\n\tb=Gw51A00TXsjiFcRTh564XmjTuqqFIgHNOTs38pBmqhh2zO5eoZnxiKkMarGWUjk9eS\n\trBzqr8tLcNJltqglcqiLfeGvlqs7AFNxwC+yIOc3dIxYjvRvuOaBxe3cbT2khSJq4UjS\n\tP/cWQXjQhi7jku0ha3rmEBKzcekCocEt+TGaqAmZrOpLWHDgMx+tUv2gaBDLIERrYmXx\n\tXcal2RDOLO/hfTai9i5rj2GxrlOkqAl1cA6SRW6dQp7iGD+hx1r2PO3jpJSRw5xWmRt8\n\trbQbXJAnP1z2+4TnhI/y1j0iwAnG+09cK/4pYchBOI7oce57Uj8PBTmk6km3mj/1o961\n\tM7Wg=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=3FtVWARjoE+b9wG70tcBL/JSR+i6aA4xoM6RIVGGK1c=;\n\tb=Rq9wuTdo2QtkabmYdVeyMPAhO9T6Yh5ypXGpCViMApn54UHSjx98j7FC/vG7lrJ2us\n\t9ilOdQfxjc/OUFeDb+xJ4J98cYw2yWajYol74ylDYkkE0iV34mCD7PylG4qrvc2zAMlW\n\t8CzqznXHN3ofUkxGgrQ14Lp4sw1UVkVqGYx8RHKGh38X+3myBtm1IfPSx9C07QwmLwWR\n\ty/Rvo353igIlBg/lmtPf9EGmACZoOczrT6LqRMLnghgP7Sf/ESZefvr2YMsvfOD+vdSR\n\tgKocOIloJ5fl6n4A0ifpGc+OqOVKmrFFTwQKDtGhD7LziqXUatbCwJNhnmnwAUJg5dKJ\n\t7paA==","X-Gm-Message-State":"AHPjjUgFIic9/B+GUdDuvLUj5gmcpc4Ce1BkcCAlBQaYDQ+g2FCStaTW\n\tFP/M6BTWEyn4QDs6UeMg4VA=","X-Google-Smtp-Source":"AOwi7QBVFAr72WiXMUTnMq2EjjAxE/u45V4Psp3fIt86wyN/Nn7kMSJfPRxK0sxY2bOkyHo59SZW3Q==","X-Received":"by 10.84.210.45 with SMTP id z42mr3567308plh.178.1505947636051; \n\tWed, 20 Sep 2017 15:47:16 -0700 (PDT)","From":"Eric Biggers <ebiggers3@gmail.com>","To":"linux-fscrypt@vger.kernel.org","Subject":"[PATCH 23/25] ubifs: switch to fscrypt_prepare_rename()","Date":"Wed, 20 Sep 2017 15:46:03 -0700","Message-Id":"<20170920224605.22030-24-ebiggers3@gmail.com>","X-Mailer":"git-send-email 2.14.1.821.g8fa685d3b7-goog","In-Reply-To":"<20170920224605.22030-1-ebiggers3@gmail.com>","References":"<20170920224605.22030-1-ebiggers3@gmail.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170920_234735_776829_5CF63646 ","X-CRM114-Status":"GOOD (  12.47  )","X-Spam-Score":"-1.8 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on casper.infradead.org summary:\n\tContent analysis details:   (-1.8 points, 5.0 required)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2607:f8b0:400e:c00:0:0:0:242 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends\n\tin digit (ebiggers3[at]gmail.com)\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (ebiggers3[at]gmail.com)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-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 <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"\"Theodore Y . Ts'o\" <tytso@mit.edu>, Eric Biggers <ebiggers@google.com>, \n\tMichael Halcrow <mhalcrow@google.com>,\n\tlinux-f2fs-devel@lists.sourceforge.net, \n\tlinux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org,\n\tJaegeuk Kim <jaegeuk@kernel.org>, linux-ext4@vger.kernel.org","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"From: Eric Biggers <ebiggers@google.com>\n\nSigned-off-by: Eric Biggers <ebiggers@google.com>\n---\n fs/ubifs/dir.c | 20 +++++++-------------\n 1 file changed, 7 insertions(+), 13 deletions(-)","diff":"diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c\nindex 09e6c56b11bc..7bf847d79b4a 100644\n--- a/fs/ubifs/dir.c\n+++ b/fs/ubifs/dir.c\n@@ -1353,12 +1353,6 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry,\n \tif (unlink)\n \t\tubifs_assert(inode_is_locked(new_inode));\n \n-\tif (old_dir != new_dir) {\n-\t\tif (ubifs_crypt_is_encrypted(new_dir) &&\n-\t\t    !fscrypt_has_permitted_context(new_dir, old_inode))\n-\t\t\treturn -EPERM;\n-\t}\n-\n \tif (unlink && is_dir) {\n \t\terr = ubifs_check_dir_empty(new_inode);\n \t\tif (err)\n@@ -1573,13 +1567,6 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry,\n \n \tubifs_assert(fst_inode && snd_inode);\n \n-\tif ((ubifs_crypt_is_encrypted(old_dir) ||\n-\t    ubifs_crypt_is_encrypted(new_dir)) &&\n-\t    (old_dir != new_dir) &&\n-\t    (!fscrypt_has_permitted_context(new_dir, fst_inode) ||\n-\t     !fscrypt_has_permitted_context(old_dir, snd_inode)))\n-\t\treturn -EPERM;\n-\n \terr = fscrypt_setup_filename(old_dir, &old_dentry->d_name, 0, &fst_nm);\n \tif (err)\n \t\treturn err;\n@@ -1624,12 +1611,19 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,\n \t\t\tstruct inode *new_dir, struct dentry *new_dentry,\n \t\t\tunsigned int flags)\n {\n+\tint err;\n+\n \tif (flags & ~(RENAME_NOREPLACE | RENAME_WHITEOUT | RENAME_EXCHANGE))\n \t\treturn -EINVAL;\n \n \tubifs_assert(inode_is_locked(old_dir));\n \tubifs_assert(inode_is_locked(new_dir));\n \n+\terr = fscrypt_prepare_rename(old_dir, old_dentry, new_dir, new_dentry,\n+\t\t\t\t     flags);\n+\tif (err)\n+\t\treturn err;\n+\n \tif (flags & RENAME_EXCHANGE)\n \t\treturn ubifs_xrename(old_dir, old_dentry, new_dir, new_dentry);\n \n","prefixes":["23/25"]}