From patchwork Tue Mar 21 16:43:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 72940 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1889389wrt; Tue, 21 Mar 2023 09:52:32 -0700 (PDT) X-Google-Smtp-Source: AK7set9OJjFX8k/cQXsyDIx046icCUTL09JRGVZnAbzOvblfIt+ysYNVc0NYaKnOTAg3+wZOXOIL X-Received: by 2002:a05:6a20:3aa7:b0:d9:9bc2:8904 with SMTP id d39-20020a056a203aa700b000d99bc28904mr2986948pzh.56.1679417551817; Tue, 21 Mar 2023 09:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679417551; cv=none; d=google.com; s=arc-20160816; b=y/h8QPNj1DZyAqSoq2BhhQg/HmGULKcYce6FKtyFDGwiqeiyvhahwiCx4aROfYoOfz lCAqWK4/z1aOW0mg8Pb4jn3+FpowBrm8d8UMTPGDHTZKWLtTBCNgMbqdL0VijVl9iic8 LlDo8npnKG2j9/WDHmYR5bwmd1SiXSGJ9zBHWnj/IzbGVvhjY3PbnpTHNraXj+Bo2cxY 3Zf3sQGRIIB1ldhdX5HAtQ36rzpgOvhOduQ18k9us3Xn/JHRI9RtsfVohsIilevhEZMI AHJ0E/sdKMJb+hcdx8+Z5cvgzlnqG4iKDC4aGAjakbkjPp15SHkWD3mKT5pPShNKqw7r 6zUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:from:organization :dkim-signature; bh=ni73P6iOwq/z06Tc9mCMwHkprsEWFzyatJbBnmGE7Q8=; b=qWWSFQpVSHLbHwXvZtOdT5n+36lPmlk1iGwSGT6m/SyviUz8LMg4CVviWUF0IOpyHO 9S3qh66UXByIGxayHEt97qzGyyEV4EN97aW3rDQGxUxPDDLiXzdz/Wd813wHDh/jhLEq hOi0WkCJXgvCqY5N+v0vUwAguKeiTiDuly4uX7v+89mqfoIDBKWy8koMG/H4jOCgHvpg pIW8CU3OkRDC0/2HmpixWlxJqYcx+DHzT3ryMeC4wUnsPWxGcaOmFxbOP5epDrN0t7RH f03x5RsOBoLKLIWf2tDSSXSuKqyQ+5Sg0ydZO09v0TWTnoeMO5KYAMGYprSHe/0jmbTH Vvcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eSiCHkXy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a631209000000b0050bfa82c24asi13350511pgl.647.2023.03.21.09.52.18; Tue, 21 Mar 2023 09:52:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eSiCHkXy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230218AbjCUQpG (ORCPT + 99 others); Tue, 21 Mar 2023 12:45:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbjCUQo7 (ORCPT ); Tue, 21 Mar 2023 12:44:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C991D52915 for ; Tue, 21 Mar 2023 09:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679417036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ni73P6iOwq/z06Tc9mCMwHkprsEWFzyatJbBnmGE7Q8=; b=eSiCHkXywRbPi/zBf0KpWiWawDXlLIAqeLbT+YgAMObRPvKRNP6mpDUiv+Hj+/srK1M31P RBZx+OG3cxdK4DTAAzPzhqdRBgwT/vXzD34euHutOwMWwyj7GYQIfY9lLkrPsSYN/wyDoF KkAef+wOASy4GFo1ptChgUCwgSvpW0g= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-462-qaZqdp-zNrahOBtwB2l9Lg-1; Tue, 21 Mar 2023 12:43:52 -0400 X-MC-Unique: qaZqdp-zNrahOBtwB2l9Lg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2F6FC101A54F; Tue, 21 Mar 2023 16:43:52 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 637B3492C13; Tue, 21 Mar 2023 16:43:50 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: torvalds@linux-foundation.org cc: dhowells@redhat.com, Jarkko Sakkinen , Bharath SM , Shyam Prasad N , Steve French , Robbie Harwood , Eric Biederman , Herbert Xu , keyrings@vger.kernel.org, linux-cifs@vger.kernel.org, linux-crypto@vger.kernel.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] keys: Miscellaneous fixes/changes MIME-Version: 1.0 Content-ID: <2851035.1679417029.1@warthog.procyon.org.uk> Date: Tue, 21 Mar 2023 16:43:49 +0000 Message-ID: <2851036.1679417029@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760996938598591421?= X-GMAIL-MSGID: =?utf-8?q?1760996938598591421?= Hi Linus, Could you pull these fixes/changes for keyrings? (1) Fix request_key() so that it doesn't cache a looked up key on the current thread if that thread is a kernel thread. The cache is cleared during notify_resume - but that doesn't happen in kernel threads. This is causing cifs DNS keys to be un-invalidateable. (2) Fix a wrapper check in verify_pefile() to not round up the length. (3) Change asymmetric_keys code to log errors to make it easier for users to work out why failures occurred. Thanks, David --- The following changes since commit fc89d7fb499b0162e081f434d45e8d1b47e82ece: Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost (2023-03-13 10:43:09 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git tags/keys-fixes-20230321 for you to fetch changes up to 3584c1dbfffdabf8e3dc1dd25748bb38dd01cd43: asymmetric_keys: log on fatal failures in PE/pkcs7 (2023-03-21 16:23:56 +0000) ---------------------------------------------------------------- keyrings fixes ---------------------------------------------------------------- David Howells (1): keys: Do not cache key in task struct if key is requested from kernel thread Robbie Harwood (2): verify_pefile: relax wrapper length check asymmetric_keys: log on fatal failures in PE/pkcs7 crypto/asymmetric_keys/pkcs7_verify.c | 10 +++++----- crypto/asymmetric_keys/verify_pefile.c | 32 ++++++++++++++++++-------------- security/keys/request_key.c | 9 ++++++--- 3 files changed, 29 insertions(+), 22 deletions(-)