From patchwork Fri Mar 23 19:23:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10305483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1DC87600CC for ; Fri, 23 Mar 2018 19:31:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F0F82912B for ; Fri, 23 Mar 2018 19:31:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0392D2912D; Fri, 23 Mar 2018 19:31:19 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 7C1D42912B for ; Fri, 23 Mar 2018 19:31:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752169AbeCWTbR (ORCPT ); Fri, 23 Mar 2018 15:31:17 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:39473 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752527AbeCWTbP (ORCPT ); Fri, 23 Mar 2018 15:31:15 -0400 Received: by mail-pf0-f196.google.com with SMTP id u5so5107170pfh.6; Fri, 23 Mar 2018 12:31:15 -0700 (PDT) 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=Pn31iKo5bdUwZ7Mo55qbnWvCVFkKjitsfJYQf968F+8=; b=hCLyTR/H/vGUwZ6FsD8PP/c4q9Lfo6b+ePRn95tVK9ZYz6bcEswx+FRPBezUYjA+AL G48nDh/8lRqMykE/5X+IpEiTLxMms7RxK/aRaso+3YIQ80NK3/HXEBr/81+uYGwu2XfW giDQWUQuSsg20JdmiFK/0Zg8hCXtUnLG/Q4EKbow1nGc90Grw0mIzJQDhAbs1KxUswcB yPOkFQDC1PFeTNlRq5BLHaH7E8OumwSJ0nCux/87qWlF//8c1tDvw3xMNG80/oUyomIQ ok9Dec4ZFfDbehFNsTE1Z87b62XwgNSRz7rtbzUFgoumM9tpOG0SZAJHIUBHdaK6vS4f 71Bg== 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=Pn31iKo5bdUwZ7Mo55qbnWvCVFkKjitsfJYQf968F+8=; b=kbGDztqhBrNGBdCsK9Xv7faSRG4ocq0eyRVSVnJBaY6738XgeHN5+254935RIkPtj0 tBqMzp7PiZ3Ejbg5LLnHo2H8R4eD6Q9cnscA61aY9UpyPLz4YrDnfIwulEnEWegcJOFH nLwRicIZB+maea/FXKhhG6IcU0h1BG5ChjvoXYKeiNCvuiEpPJajBAcTALppgg/wDObn +DIJkvPASeLQWJzIReqNqWbjxEvKhLd/W2khr2aV3vQv2rxTF05L57F0Fq+HjMsiRzmZ nTY2Xy1Hnl//X7/e9iIb1MZc1Z08gOoHk9eug6rOrqcxorWroBlkR2PPqX8j+E3tuD8y ozMQ== X-Gm-Message-State: AElRT7FW8TdpGndsrLQbfzfL4S4JmFxVVNj/oylC85l8Yck5YLNKdBFk N5CDj7+O5yzoacmqUtjNNbrWGd9h X-Google-Smtp-Source: AG47ELu3ibsOrWnKZYUNgDs374Fi+BWY+pVOXROIc9rEIlAzhpE/+KJ6bnGnYJzEIzWpl4lZeXzJDQ== X-Received: by 10.99.136.194 with SMTP id l185mr22234844pgd.419.1521833474519; Fri, 23 Mar 2018 12:31:14 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id x1sm20924545pfk.144.2018.03.23.12.31.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 12:31:13 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Jaegeuk Kim , Eric Biggers Subject: [PATCH 03/14] fscrypt: remove WARN_ON_ONCE() when decryption fails Date: Fri, 23 Mar 2018 12:23:47 -0700 Message-Id: <20180323192358.95691-4-ebiggers3@gmail.com> X-Mailer: git-send-email 2.17.0.rc0.231.g781580f067-goog In-Reply-To: <20180323192358.95691-1-ebiggers3@gmail.com> References: <20180323192358.95691-1-ebiggers3@gmail.com> 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 If decrypting a block fails, fscrypt did a WARN_ON_ONCE(). But WARN is meant for kernel bugs, which this isn't; this could be hit by fuzzers using fault injection, for example. Also, there is already a proper warning message logged in fscrypt_do_page_crypto(), so the WARN doesn't add much. Just remove the unnessary WARN. Signed-off-by: Eric Biggers --- fs/crypto/bio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index 0d5e6a569d58..771c8684826b 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -43,12 +43,10 @@ static void completion_pages(struct work_struct *work) int ret = fscrypt_decrypt_page(page->mapping->host, page, PAGE_SIZE, 0, page->index); - if (ret) { - WARN_ON_ONCE(1); + if (ret) SetPageError(page); - } else { + else SetPageUptodate(page); - } unlock_page(page); } fscrypt_release_ctx(ctx);