From patchwork Mon Apr 30 22:51:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10373019 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 A0A6D60234 for ; Mon, 30 Apr 2018 22:56:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DF011FF83 for ; Mon, 30 Apr 2018 22:56:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82818212DA; Mon, 30 Apr 2018 22:56:50 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, 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 2BB1E1FF83 for ; Mon, 30 Apr 2018 22:56:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755395AbeD3W4r (ORCPT ); Mon, 30 Apr 2018 18:56:47 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35401 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbeD3W4p (ORCPT ); Mon, 30 Apr 2018 18:56:45 -0400 Received: by mail-pf0-f194.google.com with SMTP id j5so7882842pfh.2; Mon, 30 Apr 2018 15:56:45 -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=LIu2AchSzLKPzwlM41IUmPiyaiNBI2IOG+t4D0uRSa8=; b=Z/ZHWp8VSosJCcQE+dFG1qDzNQANga8Vro8gTJ+46f/VAb4nuIz9Vat1ikpY77bvFI s3MS+hQRTxCMGc1hNfhVnlkLdckgfHGXGD4Kcs0FHeY4Cay012BnsWQ/zppkSe8kev5t BBt4G5TNFu3Ft4lP5WfGcrAg+Hw98Z3q6zPCKa/XTusSyVy46DpbrzetiAyzOtNbebvv C3mwqg0xK4WWauIMCW2AlOwvfK95hwh+noWFhB95vxWrEZ/1E7tmeZEOKdk2mFOetKbO 3HgT8hiSB/vLMDZRVFLTzocf/2TSbuJ9erkTUdeKkB8ZklI5JHuuaPUeoE8TyZaBJHgd eI+A== 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=LIu2AchSzLKPzwlM41IUmPiyaiNBI2IOG+t4D0uRSa8=; b=a9WCrJpNjElmrmBI9VB2GTVYQsWChzyszuH9lIzyM1y85192PkEL4a0IDiNmj72ecw ar/vCr9LvVYZxPSAR8xa6wfX0i2N8rlmZxpHZaf67tT2v65e7HFgJzQlL0LQ3loRde1w cWzr96JuTLyw2zxyvTAFrgao9xfZtcmgBHt9tZ7PrA7iV7Ky4FjRjkRJRqmCT3xjX5cm EkSKAosN3chJXu272Hz61tCpD14JICJjfbeXNmYbKLfPT4C3R2fLPk191sUG1Tm15k3e QgceHe42lx1l76eEX5aG7ez7/o3PK78iSZgDixdMfn3cEQYS241IPiIAe8+cPEFJgHDb Be1A== X-Gm-Message-State: ALQs6tDYYolei5zJHxFxWbds11HoD3VI5PsDdnajEthO67DcvRC3Kkg0 qdyVepsH+Tp+QUi6RBUoxTGRbKZH X-Google-Smtp-Source: AB8JxZoWYWCM5WxPElnrQjeOcXzNiheMuVbEKAMVJU/tXzyVD4yHtnhXIjYiJo5JVlLibxoT9OAoUg== X-Received: by 2002:a63:6445:: with SMTP id y66-v6mr11289992pgb.206.1525129004392; Mon, 30 Apr 2018 15:56:44 -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 b15sm12969305pfi.111.2018.04.30.15.56.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Apr 2018 15:56:43 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" Cc: Jaegeuk Kim , linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Eric Biggers Subject: [PATCH 06/15] fscrypt: don't clear flags on crypto transform Date: Mon, 30 Apr 2018 15:51:40 -0700 Message-Id: <20180430225149.183514-7-ebiggers3@gmail.com> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog In-Reply-To: <20180430225149.183514-1-ebiggers3@gmail.com> References: <20180430225149.183514-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 d09df8f751df..0f6a65c6483b 100644 --- a/fs/crypto/keyinfo.c +++ b/fs/crypto/keyinfo.c @@ -325,7 +325,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