Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7480935rwd; Tue, 20 Jun 2023 01:40:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5b6kzF8aLyuRhUF87sOSbR73/iZ+QIa7u3/VKAX+rAKtJWQvRlbVPKGyLFTMxIaiOeBfms X-Received: by 2002:a05:6e02:c72:b0:340:ba06:b16a with SMTP id f18-20020a056e020c7200b00340ba06b16amr8372667ilj.3.1687250448572; Tue, 20 Jun 2023 01:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687250448; cv=none; d=google.com; s=arc-20160816; b=eU4GrQnSh+aKiu6OSPbDTFZUer03h0q8k/sws2+aqDdKd8K+GhOoiFx2CztfKt4HdR XUQZHcSdwJag2KdVH12GEDBQFDT+CrVvfL0QyBa+U6Mu5YZd5277Uv8pfv/RRuqXhkAJ W5O6jRATNREGxtXAPobmIfrRdruckQEEJZGvoEUKZVGGwrLpt3/eN8g8XTKQMBKqz/FL x7Riwq/+frpFhdpvuv9xef05tPwXGN+0hulttpfxVz/x17a697yZHguiQtDT80rWiX9g 5PQfKnOKhKgwlWVqfSNPgy1AYTBKMwTZcW3nikgJ1W5sxb5drN8fMAbKKtlShFeoafkC lntw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=bEZnxxsn5EvcBTlzoKditaVS+TB5fsKJyHE25Bn1gyA=; b=Gt646st+Io1fitUHJ3fCfW0xkVS1uh6ShrBT1cuXPNQis36Ma2gYBh0DQ8RXV8AMW7 2ERAFpNmmKm9RtOrPfRCu0K+IF0BOi4zuTHWTsqtUcEqOtorq0jc391O5Z20oEZu/3tO DWBZFD3EmRQjsVwtev4MahbeKIFVfNcPmAj8i1IL2gE9UfbkKPbJsQQBqcPC57rB6J03 Zzzahor9Adbk71bx9+57djbSLBSmAvdUvM61gJCHDcJlTFBnMvw+1trIyq7wP1HwENpt qH/Q5CrJVhZwb7UoaEi/e9oR6Ab6c2+NbfcUyvTDj9eqEbUnu5tltd9UViyQVUEqDC2+ q5JA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a638c44000000b0054ff7740abfsi1249187pgn.482.2023.06.20.01.40.25; Tue, 20 Jun 2023 01:40:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231264AbjFTIVP (ORCPT + 99 others); Tue, 20 Jun 2023 04:21:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbjFTIVP (ORCPT ); Tue, 20 Jun 2023 04:21:15 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B93619B; Tue, 20 Jun 2023 01:21:12 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qBWbX-0051BY-9M; Tue, 20 Jun 2023 16:20:48 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 20 Jun 2023 16:20:47 +0800 Date: Tue, 20 Jun 2023 16:20:47 +0800 From: Herbert Xu To: David Howells Cc: netdev@vger.kernel.org, syzbot+13a08c0bf4d212766c3c@syzkaller.appspotmail.com, syzbot+14234ccf6d0ef629ec1a@syzkaller.appspotmail.com, syzbot+4e2e47f32607d0f72d43@syzkaller.appspotmail.com, syzbot+472626bb5e7c59fb768f@syzkaller.appspotmail.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jens Axboe , Matthew Wilcox , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2] crypto: af_alg/hash: Fix recvmsg() after sendmsg(MSG_MORE) Message-ID: References: <427646.1686913832@warthog.procyon.org.uk> <1220921.1687246935@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1220921.1687246935@warthog.procyon.org.uk> X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_00,HELO_DYNAMIC_IPADDR2, PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TVD_RCVD_IP, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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 On Tue, Jun 20, 2023 at 08:42:15AM +0100, David Howells wrote: > > Not so. hash_recvmsg() will call crypto_ahash_init() first because ctx->more > is false (hence why we came down this branch in hash_sendmsg()) and the result > was released on the previous line (which you're objecting to). If it goes to > the "done" label, it will skip setting ctx->more to true if MSG_MORE is > passed. I see, yes it should work. > However, given you want sendmsg() to do the init->digest cycle on zero length > data, I think we should revert to the previous version of the patch that makes > a pass of the loop even with no data. Let's get this fixed ASAP and we can refine it later. Acked-by: Herbert Xu Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt