From patchwork Fri Mar 23 19:23:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10305505 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 C8AD960386 for ; Fri, 23 Mar 2018 19:31:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8EA02912B for ; Fri, 23 Mar 2018 19:31:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADC0D2912D; Fri, 23 Mar 2018 19:31:37 +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 61B3C2912B for ; Fri, 23 Mar 2018 19:31:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbeCWTbT (ORCPT ); Fri, 23 Mar 2018 15:31:19 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:44708 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752378AbeCWTbR (ORCPT ); Fri, 23 Mar 2018 15:31:17 -0400 Received: by mail-pf0-f193.google.com with SMTP id m68so5105052pfm.11; Fri, 23 Mar 2018 12:31:16 -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=Va95w6fmA9Co1/uxsgf3HdEVuaibFN6JiufFqrpPhyg=; b=mCsfDTv2BQr+iM2ySyRRJuFV+F7CmXUPwv+K5gQgkH1HjY0qFwJ/YEfa1it7sU+p5C vREvdUtFHb6s0O6xN4SCIaibM9/eoZXDaMfx429tRy5jaxIcksjcWy8IcMc8dsZMhTcX 20tbpk++H5j5azRgn7SBqHi3EjUNuZffS/QAkOFWlnWev4ek9bpeo6IiX0vOw1PBr1Uc ToHLsqD4+8C10GulCh3PBbnweMrGqOfrLiSYkNYErfUoknmWnjaV4CfPavYdAD9EmAjk 05NjG+ywq75K9jsU1LZGLvdFeKGxis34qL4o5g5WVxIbEwu1AisuNCgh17Z7XPGH3uHt pmjA== 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=Va95w6fmA9Co1/uxsgf3HdEVuaibFN6JiufFqrpPhyg=; b=jS6Xiik+BC3qfBdv+V21WKgSjvd3XyfMoQHOvRqMF5Ef8fkJMcCHoOKOf7cAoU3VWI g30RK7bfZDVyOWgCmg0+MdT34WCSatuZid30sTrvHMTBjGvgjdcpoCgkXTb96VdxaGn4 jLXofJsn/rgSiMOosC2vuOsuw43vlFdIDBT32lsmZIrpIf1U63Sv7MUfgg56lJ/JXuca MMJkgMIzQ89++66+Wzmxu3s+YSPpwsQAOpiOeAmqBg6nP18ITLDm/2RiZ9iM4PKxk8oO giufFaE1N+4SYCoOYoJI2uevurObF/flSrC/VBZduOxsBRhmA6ShAhMeexAdD6BBC4OS u+xw== X-Gm-Message-State: AElRT7HySY2umF4fbJlYeTxe0FFZG1eo8wRHO9ufrhD+r8Qb20UIwYcH d/Z68CBwtp4Y86t/An3R5w7VbP2h X-Google-Smtp-Source: AG47ELt43g59Jcp+ZSUu4lwIeHQbCDZjBJjI/v3vDQe4XHohE/W7Y0sspE2urwV67BScCECYQlWX+A== X-Received: by 10.101.92.138 with SMTP id a10mr21915660pgt.129.1521833476278; Fri, 23 Mar 2018 12:31:16 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 12:31:15 -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 05/14] fscrypt: don't clear flags on crypto transform Date: Fri, 23 Mar 2018 12:23:49 -0700 Message-Id: <20180323192358.95691-6-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 fscrypt is clearing the flags on the crypto_skcipher it allocates for each inode. But, this is unnecessary and may cause problems in the future because it will even clear flags that are meant to be internal to the crypto API, e.g. CRYPTO_TFM_NEED_KEY. Remove the unnecessary flag clearing. Signed-off-by: Eric Biggers --- fs/crypto/keyinfo.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/crypto/keyinfo.c b/fs/crypto/keyinfo.c index 8099388f5581..1435a1c81010 100644 --- a/fs/crypto/keyinfo.c +++ b/fs/crypto/keyinfo.c @@ -327,7 +327,6 @@ int fscrypt_get_encryption_info(struct inode *inode) goto out; } crypt_info->ci_ctfm = ctfm; - crypto_skcipher_clear_flags(ctfm, ~0); crypto_skcipher_set_flags(ctfm, CRYPTO_TFM_REQ_WEAK_KEY); /* * if the provided key is longer than keysize, we use the first