From patchwork Sun Aug 11 21:35:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 11089175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5FEA1398 for ; Sun, 11 Aug 2019 21:37:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6C1626E47 for ; Sun, 11 Aug 2019 21:37:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B35927F2B; Sun, 11 Aug 2019 21:37:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF88F26E47 for ; Sun, 11 Aug 2019 21:37:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726466AbfHKVhN (ORCPT ); Sun, 11 Aug 2019 17:37:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:33498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbfHKVhN (ORCPT ); Sun, 11 Aug 2019 17:37:13 -0400 Received: from sol.localdomain (c-24-5-143-220.hsd1.ca.comcast.net [24.5.143.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6B08F2085A; Sun, 11 Aug 2019 21:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565559432; bh=swoMgo/n2caW8yJE4pfd10ANnvVz7VhP4yS8JJAp8jA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jjl93+AdEy/Khgm0sMNr6vNO8vy8+xtaJ1FK03uu8Hf21CqlupuirV1lgPjpC3eNP j+mTgk8XFhCfbLOy7kGcp4S1eFQLrYp4GRpbcPes0lSBHhMTW696YwxCNtGfdaz31s NC8T+kUaShHNtQ9bCRN/9r60OPepWkiFcKwiowmo= From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 1/6] fs-verity: fix crash on read error in build_merkle_tree_level() Date: Sun, 11 Aug 2019 14:35:52 -0700 Message-Id: <20190811213557.1970-2-ebiggers@kernel.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190811213557.1970-1-ebiggers@kernel.org> References: <20190811213557.1970-1-ebiggers@kernel.org> MIME-Version: 1.0 Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers In build_merkle_tree_level(), use a separate fsverity_err() statement when failing to read a data page, rather than incorrectly reusing the one for failure to read a Merkle tree page and accessing level_start[] out of bounds due to 'params->level_start[level - 1]' when level == 0. Fixes: 248676649d53 ("fs-verity: implement FS_IOC_ENABLE_VERITY ioctl") Signed-off-by: Eric Biggers --- fs/verity/enable.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/fs/verity/enable.c b/fs/verity/enable.c index 3371d51563962..eabc6ac199064 100644 --- a/fs/verity/enable.c +++ b/fs/verity/enable.c @@ -43,19 +43,27 @@ static int build_merkle_tree_level(struct inode *inode, unsigned int level, pr_debug("Hashing block %llu of %llu for level %u\n", i + 1, num_blocks_to_hash, level); - if (level == 0) + if (level == 0) { /* Leaf: hashing a data block */ src_page = read_mapping_page(inode->i_mapping, i, NULL); - else + if (IS_ERR(src_page)) { + err = PTR_ERR(src_page); + fsverity_err(inode, + "Error %d reading data page %llu", + err, i); + return err; + } + } else { /* Non-leaf: hashing hash block from level below */ src_page = vops->read_merkle_tree_page(inode, params->level_start[level - 1] + i); - if (IS_ERR(src_page)) { - err = PTR_ERR(src_page); - fsverity_err(inode, - "Error %d reading Merkle tree page %llu", - err, params->level_start[level - 1] + i); - return err; + if (IS_ERR(src_page)) { + err = PTR_ERR(src_page); + fsverity_err(inode, + "Error %d reading Merkle tree page %llu", + err, params->level_start[level - 1] + i); + return err; + } } err = fsverity_hash_page(params, inode, req, src_page, From patchwork Sun Aug 11 21:35:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 11089179 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B22BF14F7 for ; Sun, 11 Aug 2019 21:37:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A06A627E71 for ; Sun, 11 Aug 2019 21:37:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8739B27F3E; Sun, 11 Aug 2019 21:37:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D44826E47 for ; Sun, 11 Aug 2019 21:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbfHKVhO (ORCPT ); Sun, 11 Aug 2019 17:37:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:33502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbfHKVhN (ORCPT ); Sun, 11 Aug 2019 17:37:13 -0400 Received: from sol.localdomain (c-24-5-143-220.hsd1.ca.comcast.net [24.5.143.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A8EEE2085B; Sun, 11 Aug 2019 21:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565559432; bh=jLSRndS90GZ1sS5nNH8viZnBJzvjYmn5wdaigS/eBOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zXNM5iORw1W3gqfwS4dRHQM5oTQW4JpvBOt9qx/RkXXhm/+qlhiuvoOMgKnPClO/F iu1M7eO0iSxh2ichFx9CUOQMUB7gmhmbSzVBOpx3WSxi7luktLQgJJIjpjP3ks/YuF plLF6RnO9ZoGWqRyhEbFBqZYpQCJz97ubZTca+RA= From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 2/6] ext4: skip truncate when verity in progress in ->write_begin() Date: Sun, 11 Aug 2019 14:35:53 -0700 Message-Id: <20190811213557.1970-3-ebiggers@kernel.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190811213557.1970-1-ebiggers@kernel.org> References: <20190811213557.1970-1-ebiggers@kernel.org> MIME-Version: 1.0 Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers When an error (e.g. ENOSPC) occurs during ext4_write_begin() when called from ext4_write_merkle_tree_block(), skip truncating the file. i_size is not meaningful in this case, and the truncation is handled by ext4_end_enable_verity() instead. Also, this was triggering the WARN_ON(!inode_is_locked(inode)) in ext4_truncate(). Fixes: ea54d7e4c0f8 ("ext4: add basic fs-verity support") Signed-off-by: Eric Biggers --- fs/ext4/inode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index b2c8d09acf652..cf0fce1173a4c 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1340,6 +1340,9 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping, } if (ret) { + bool extended = (pos + len > inode->i_size) && + !ext4_verity_in_progress(inode); + unlock_page(page); /* * __block_write_begin may have instantiated a few blocks @@ -1349,11 +1352,11 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping, * Add inode to orphan list in case we crash before * truncate finishes */ - if (pos + len > inode->i_size && ext4_can_truncate(inode)) + if (extended && ext4_can_truncate(inode)) ext4_orphan_add(handle, inode); ext4_journal_stop(handle); - if (pos + len > inode->i_size) { + if (extended) { ext4_truncate_failed_write(inode); /* * If truncate failed early the inode might From patchwork Sun Aug 11 21:35:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 11089183 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4654013B1 for ; Sun, 11 Aug 2019 21:37:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3731326E3C for ; Sun, 11 Aug 2019 21:37:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BC3727E71; Sun, 11 Aug 2019 21:37:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DC9626E3C for ; Sun, 11 Aug 2019 21:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbfHKVhO (ORCPT ); Sun, 11 Aug 2019 17:37:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:33506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726011AbfHKVhN (ORCPT ); Sun, 11 Aug 2019 17:37:13 -0400 Received: from sol.localdomain (c-24-5-143-220.hsd1.ca.comcast.net [24.5.143.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7DE4208C2; Sun, 11 Aug 2019 21:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565559433; bh=hfKkuGUJ1kiygfXldZQujeyj/c9gD3q/1k7tA5kqnRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0wlTph1uBlx9zoYfzKeX5qpWlntqWfJ1qt93hZQkqaXlU1RSgvNwwOiWoLvesgSRg JRW37GlYSQRTVezCPpP7o3yCpnxL1AE/qDE/D72IdEVwTS9KxbQ614EKWGLMhNffJq GOHlkkzHZWPwjEFriIHid8Y66YQ1Te1cFzkU/dhk= From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 3/6] f2fs: skip truncate when verity in progress in ->write_begin() Date: Sun, 11 Aug 2019 14:35:54 -0700 Message-Id: <20190811213557.1970-4-ebiggers@kernel.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190811213557.1970-1-ebiggers@kernel.org> References: <20190811213557.1970-1-ebiggers@kernel.org> MIME-Version: 1.0 Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers When an error (e.g. ENOSPC) occurs during f2fs_write_begin() when called from f2fs_write_merkle_tree_block(), skip truncating the file. i_size is not meaningful in this case, and the truncation is handled by f2fs_end_enable_verity() instead. Fixes: 60d7bf0f790f ("f2fs: add fs-verity support") Signed-off-by: Eric Biggers --- fs/f2fs/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 3f525f8a3a5fa..00b03fb87bd9b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2476,7 +2476,7 @@ static void f2fs_write_failed(struct address_space *mapping, loff_t to) struct inode *inode = mapping->host; loff_t i_size = i_size_read(inode); - if (to > i_size) { + if (to > i_size && !f2fs_verity_in_progress(inode)) { down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]); down_write(&F2FS_I(inode)->i_mmap_sem); From patchwork Sun Aug 11 21:35:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 11089181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B42A1890 for ; Sun, 11 Aug 2019 21:37:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F022A26E47 for ; Sun, 11 Aug 2019 21:37:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB85227F10; Sun, 11 Aug 2019 21:37:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EDBE26E47 for ; Sun, 11 Aug 2019 21:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726590AbfHKVhQ (ORCPT ); Sun, 11 Aug 2019 17:37:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:33510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbfHKVhO (ORCPT ); Sun, 11 Aug 2019 17:37:14 -0400 Received: from sol.localdomain (c-24-5-143-220.hsd1.ca.comcast.net [24.5.143.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 310002147A; Sun, 11 Aug 2019 21:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565559433; bh=ogxEiq2FStmpdB1nMQQucSgGithBLja/oR9v2LpPzGc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JjKGV8U4TfrNl4xq3zOAIX0wqsItLHGRMeqlb7G26JeK1ekkCb5ZB/ha1mvjDNMcH XGaJvYtNHn86tLponsPBakMNcE54w4kLU0WParAktwp5L6K7uRVuj1lmDmqq9kD2Q3 08W5HT7MXYRs0lrzhllxVQFpqPLuJnTkXGB8OKyI= From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 4/6] ext4: remove ext4_bio_encrypted() Date: Sun, 11 Aug 2019 14:35:55 -0700 Message-Id: <20190811213557.1970-5-ebiggers@kernel.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190811213557.1970-1-ebiggers@kernel.org> References: <20190811213557.1970-1-ebiggers@kernel.org> MIME-Version: 1.0 Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers ext4_bio_encrypted() is unused following commit 4e47a0d40dac ("ext4: add fs-verity read support"), so remove it. Signed-off-by: Eric Biggers --- fs/ext4/readpage.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c index ec8aeab3af65a..a30b203fa461c 100644 --- a/fs/ext4/readpage.c +++ b/fs/ext4/readpage.c @@ -52,15 +52,6 @@ static struct kmem_cache *bio_post_read_ctx_cache; static mempool_t *bio_post_read_ctx_pool; -static inline bool ext4_bio_encrypted(struct bio *bio) -{ -#ifdef CONFIG_FS_ENCRYPTION - return unlikely(bio->bi_private != NULL); -#else - return false; -#endif -} - /* postprocessing steps for read bios */ enum bio_post_read_step { STEP_INITIAL = 0, From patchwork Sun Aug 11 21:35:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 11089173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 210CA14F7 for ; Sun, 11 Aug 2019 21:37:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FE4E26E3C for ; Sun, 11 Aug 2019 21:37:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04A9427F10; Sun, 11 Aug 2019 21:37:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89B0527E71 for ; Sun, 11 Aug 2019 21:37:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726528AbfHKVhO (ORCPT ); Sun, 11 Aug 2019 17:37:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:33516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726527AbfHKVhO (ORCPT ); Sun, 11 Aug 2019 17:37:14 -0400 Received: from sol.localdomain (c-24-5-143-220.hsd1.ca.comcast.net [24.5.143.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E842216F4; Sun, 11 Aug 2019 21:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565559433; bh=p/SZRYcADvPD/FuvRi8uPfjTa+Ri4JfMVG7sxvqkbAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xzkZzx7MZETwgWv7D7aFx91csOHB28dyd6s+TrD52+T1/aASBZcbWvrg4J5chjSfr CUKVkJv1IaQYj7PXsiKRu2IpxBRYzEmPfdaQO6yA0mNU+XUJLEg9jvbGPH95m3DegH ZzFpHKz0y61SdzkGZTEyCxSofY5+xsab/e2wYfG8= From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 5/6] ext4: fix comment in ext4_end_enable_verity() Date: Sun, 11 Aug 2019 14:35:56 -0700 Message-Id: <20190811213557.1970-6-ebiggers@kernel.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190811213557.1970-1-ebiggers@kernel.org> References: <20190811213557.1970-1-ebiggers@kernel.org> MIME-Version: 1.0 Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers Signed-off-by: Eric Biggers --- fs/ext4/verity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c index bb0a3b8e6ea71..d0d8a9795dd62 100644 --- a/fs/ext4/verity.c +++ b/fs/ext4/verity.c @@ -196,7 +196,7 @@ static int ext4_end_enable_verity(struct file *filp, const void *desc, size_t desc_size, u64 merkle_tree_size) { struct inode *inode = file_inode(filp); - const int credits = 2; /* superblock and inode for ext4_orphan_add() */ + const int credits = 2; /* superblock and inode for ext4_orphan_del() */ handle_t *handle; int err = 0; int err2; From patchwork Sun Aug 11 21:35:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 11089177 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 923261398 for ; Sun, 11 Aug 2019 21:37:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8206C27E71 for ; Sun, 11 Aug 2019 21:37:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 766EB27F4B; Sun, 11 Aug 2019 21:37:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7705427E71 for ; Sun, 11 Aug 2019 21:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726011AbfHKVhP (ORCPT ); Sun, 11 Aug 2019 17:37:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:33520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbfHKVhO (ORCPT ); Sun, 11 Aug 2019 17:37:14 -0400 Received: from sol.localdomain (c-24-5-143-220.hsd1.ca.comcast.net [24.5.143.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B4C5E2173C; Sun, 11 Aug 2019 21:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565559433; bh=u8BxT9tQSHf5ZOVsehPoiYiYgC4+Zhfv2J2bExWNYqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q2oOqANPN/hXWIFA8+pGhszghBRjkfyAX2dae3QJMC1lP+6wiUBR5fv6sPW5uaCu1 b4ZkAGpYnIZ0R4diwtbEmI2QGLtphv/ht7O+e9ZEL8DSbWX6+5gBzQFVT+olcR/VYs 5Me/KYJFmTBNQWy0EYjfQLAEmouY1g4bmkI4wB2A= From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 6/6] f2fs: use EFSCORRUPTED in f2fs_get_verity_descriptor() Date: Sun, 11 Aug 2019 14:35:57 -0700 Message-Id: <20190811213557.1970-7-ebiggers@kernel.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190811213557.1970-1-ebiggers@kernel.org> References: <20190811213557.1970-1-ebiggers@kernel.org> MIME-Version: 1.0 Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers EFSCORRUPTED is now defined in f2fs.h, so use it instead of EUCLEAN. Signed-off-by: Eric Biggers Acked-by: Chao Yu --- fs/f2fs/verity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c index 6bc3470d99d00..a401ef72bc821 100644 --- a/fs/f2fs/verity.c +++ b/fs/f2fs/verity.c @@ -210,7 +210,7 @@ static int f2fs_get_verity_descriptor(struct inode *inode, void *buf, if (pos + size < pos || pos + size > inode->i_sb->s_maxbytes || pos < f2fs_verity_metadata_pos(inode) || size > INT_MAX) { f2fs_warn(F2FS_I_SB(inode), "invalid verity xattr"); - return -EUCLEAN; /* EFSCORRUPTED */ + return -EFSCORRUPTED; } if (buf_size) { if (size > buf_size)