Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2597353rwd; Wed, 14 Jun 2023 05:12:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61SdEBb5f6eSlxllEq1EsVn3Qv2GHqlBfHIUfZukowR6uvBNuXnD3PztctRpRkIB6LA2hJ X-Received: by 2002:a17:902:ec87:b0:1ae:4567:2737 with SMTP id x7-20020a170902ec8700b001ae45672737mr16712492plg.2.1686744773008; Wed, 14 Jun 2023 05:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686744772; cv=none; d=google.com; s=arc-20160816; b=JE/x77wWFYmcByjwalyMuQZhnmdX7XmpkVSTshdgu0T5qJOiTAy3aTPZAXUkJTOuGV RzvDDfMLbZ46SXCvdDD3RHaasG0w8B7ve2nHFNZAO4KYbGI1zhiNdQdzr965xsAIpWdC H8KpZinpQYVcprVk1G4Y+DVLhCrWcEkdUMkl3dBC2xeYdZfEmwF3crlaDLG8vUsPMMom IHlHfgPUZy7pvIB5M2SXPOHuvosnOylrh7klRytPNN3eeb4zJGvV3+hfVf4TF/+AU3YX UHVdPLfTnhELaHUA9Qhw/jV/LkhLZyxXtIhtMLBwgbuP6QMtIZtJQVbJYo1BhxnYaofE zooQ== 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-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=wOPn16B3XWpxkytpYHR3Z5EM60rOR3dmARKpzGwWozo=; b=SgoxNp8p/z8KUIZtFXbuisga7UazqHHitli2HKS5Mva9ZU890DIXqWjujju2ZqwGAQ eNCZ6JASZK4u8JUSlho9HSjy/QcNBW0YEhSqdQaZs4aBy7yn7UG3AqRN+YA1tOze4Hrl 5W127f2egWxtWqoAOyF/rBB7PdYJko5uoLiMhCcaSu1AZxgljYWBxziBVTVZVMkg7epA hOq6n1625LdvTXE+sxwNCd5WOGqXegT/RGWSUCff0jaykQoEQruSAa1N4cBgY6IUmQSa uXJpY4WMI9pkii+Fnd5EKo5Hdt/zeE1fBuYeTvrmy0ptngvdt9FlaXOJYZZkFOTcy0oE njhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XC8Q+ti2; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a170902f1d300b001afcbb10856si10726710plc.394.2023.06.14.05.12.38; Wed, 14 Jun 2023 05:12:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=XC8Q+ti2; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 S244412AbjFNMFh (ORCPT + 99 others); Wed, 14 Jun 2023 08:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244406AbjFNMFg (ORCPT ); Wed, 14 Jun 2023 08:05:36 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91AC31FD4 for ; Wed, 14 Jun 2023 05:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686744293; 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: in-reply-to:in-reply-to:references:references; bh=wOPn16B3XWpxkytpYHR3Z5EM60rOR3dmARKpzGwWozo=; b=XC8Q+ti2forU1f10uFgkqXEtrt61fZAePN3twdV97TX39TC++2n2pz+7GNdXBuQi4eIs0l L+thjKYIa2waSVqCkq4fL3/Vl7ncFyElrDpWFGAUdsxtOR5QJ18Y18uFy9X/JaPfb64lrv I7Ocgi7uL2tf7zoBuGb2YzGaGXVpCdA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-407-oSw5vEMcNhWtY8PAEacv1A-1; Wed, 14 Jun 2023 08:04:47 -0400 X-MC-Unique: oSw5vEMcNhWtY8PAEacv1A-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 710041C0E3D4; Wed, 14 Jun 2023 12:04:42 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B3BF492CA6; Wed, 14 Jun 2023 12:04:40 +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 In-Reply-To: References: <0000000000000cb2c305fdeb8e30@google.com> To: Herbert Xu Cc: dhowells@redhat.com, syzbot , davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [crypto?] general protection fault in cryptd_hash_export MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1521346.1686744278.1@warthog.procyon.org.uk> Date: Wed, 14 Jun 2023 13:04:38 +0100 Message-ID: <1521347.1686744278@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, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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-crypto@vger.kernel.org Herbert Xu wrote: > David, the logic for calling hash_alloc_result looks quite different > from that on whether you do the hash finalisation. I'd suggest that > you change them to use the same check, and also set use NULL instead > of ctx->result if you didn't call hash_alloc_result. I don't fully understand what the upstream hash_sendmsg() is doing. Take this bit for example: if (!ctx->more) { if ((msg->msg_flags & MSG_MORE)) hash_free_result(sk, ctx); Why is it freeing the old result only if MSG_MORE is now set, but wasn't set on the last sendmsg()? David