Received: by 10.213.65.68 with SMTP id h4csp1799878imn; Sun, 8 Apr 2018 11:43:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/v4nqIxXd7lUFjpw9wwQOCIzRIIehnVn7sRS3TYfKCtN1tHqjtDv2otRKGay904WgkaQrs X-Received: by 10.101.96.200 with SMTP id r8mr23083711pgv.152.1523213028173; Sun, 08 Apr 2018 11:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523213028; cv=none; d=google.com; s=arc-20160816; b=jbnG8a14yWKn59x6r8SWUtgrEAomlZK/+xmL8vxh7at/eWumwISDJe8OsM9jsniH9/ KmY2Q/RZn70/htq+pdnHmQVhFXocBy8oVZ5dzUXED0wcwYuGjIsLdNHsZlryRz5GsAS3 X/bJjkCOzB0+F/fVqX4g94icYE62YX6+1RE7KY56VHaHEdatBvi/jejqiy0xnkYNWcmn +/ehB+vJCt+1xXhZQqj1LQmLwHKK1Z0ynL3V/eaEy2RNLy3po6UgHa697lXcsUOzlULc PVIiGLz7KJbHfuSzSV9I7N0V1iD71vlthJbvbM+rHF01+TEJ5DugSmShPRELct76QMPv TQrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=GTi9+KI92pW6Eu0UVeJ0IDAWRaTJwOlktNHZzr5H4Y8=; b=H1bX83vHb2ovwFPHkI3HAZSuLwAWI1iLTy0ctemI6ay57o5rLQbwxC3lUgvNr7LVB/ 7f6xu5CIrAeKkNzMD5K8vORLV3N5PVMyoZwwGqQ5vQoTTZb3fc7zpVnhZoy9TEp3NPIE 4gdDs+95ArXPf60DptzpfDCVOh6oDFoFpY0amtokiwg6Y0qZViOcIbUj4PDMSEAb6Ehv DVhIQKcHZcUL0mvTGqxihH8kVyRD764uywonfW2jL7Zu63WSGoiMKhmL7yM0SLdnzwRJ 9sa4cXScpmfb292bwUJc+xLMQK3Kobfokdt7ucXZlTmjl6dPk636PeX/TAYuwKbLNyow d4bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@chronox.de header.s=strato-dkim-0002 header.b=TKehlcpt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19-v6si3024066pls.334.2018.04.08.11.43.11; Sun, 08 Apr 2018 11:43:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@chronox.de header.s=strato-dkim-0002 header.b=TKehlcpt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbeDHSDe (ORCPT + 99 others); Sun, 8 Apr 2018 14:03:34 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.161]:26679 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbeDHSDd (ORCPT ); Sun, 8 Apr 2018 14:03:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1523210612; s=strato-dkim-0002; d=chronox.de; h=Content-Type:Content-Transfer-Encoding:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=GTi9+KI92pW6Eu0UVeJ0IDAWRaTJwOlktNHZzr5H4Y8=; b=TKehlcptUiteVm9Wmh0qQmsOXhJ1FVuYtnQouysXdA9tgT3TY9U27EKsacPP4axd3q 3txyDiCCE0TToGSF06rxENfNq//qI9hlKUMxgd3RPZmGm1KYyBiBTNgvy38d17BxEp9O wh+n+tQ7yRY0xpxF+oqXUdwvlSZBXiARxsyVQdG35R3xmmx3FBgdLyDZ7cZyTDkjymA/ +FhKufLGDIvGlDex2BDpAey4lDXave3R1kYYTk/0YipKuXA93zmSXh64D5zrA0Kz4D1i bbI/IKA2smig94hsBg6cT1waJEKsQnNp5W4zlP7Co8kAgUzXEN9w4YKCeFOU+gtTfvAW UpvA== X-RZG-AUTH: :P2ERcEykfu11Y98lp/T7+hdri+uKZK8TKWEqNyiHySGSa9k9x2YdNp5Oujd5kpkCUA== X-RZG-CLASS-ID: mo00 Received: from positron.chronox.de ([88.128.81.87]) by smtp.strato.de (RZmta 43.1 DYNA|AUTH) with ESMTPSA id L0213fu38HvD6jz (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 8 Apr 2018 19:57:13 +0200 (CEST) From: Stephan =?ISO-8859-1?Q?M=FCller?= To: syzbot Cc: davem@davemloft.net, herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: [PATCH] AF_ALG: register completely initialized request in list Date: Sun, 08 Apr 2018 19:57:12 +0200 Message-ID: <3337259.MW9pfDCdka@positron.chronox.de> In-Reply-To: <00000000000092ad87056950ef9e@google.com> References: <00000000000092ad87056950ef9e@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, May I ask to check whether this patch fixes the issue? I cannot re-create the issue with the reproducter. Yet, as far as I understand, you try to induce errors which shall validate whether the error code paths are correct. The fix below should ensure this now. Thanks a lot. ---8<--- From 8f083e7b0684a9f91c186d7b46eec34e439689c3 Mon Sep 17 00:00:00 2001 From: Stephan Mueller Date: Sun, 8 Apr 2018 19:53:59 +0200 Subject: [PATCH] AF_ALG: Initialize sg_num_bytes in error code path The RX SGL in processing is already registered with the RX SGL tracking list to support proper cleanup. The cleanup code path uses the sg_num_bytes variable which must therefore be always initialized, even in the error code path. Signed-off-by: Stephan Mueller Reported-by: syzbot+9c251bdd09f83b92ba95@syzkaller.appspotmail.com --- crypto/af_alg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/af_alg.c b/crypto/af_alg.c index c49766b03165..0d555c072669 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c @@ -1156,8 +1156,10 @@ int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags, /* make one iovec available as scatterlist */ err = af_alg_make_sg(&rsgl->sgl, &msg->msg_iter, seglen); - if (err < 0) + if (err < 0) { + rsgl->sg_num_bytes = 0; return err; + } /* chain the new scatterlist with previous one */ if (areq->last_rsgl) -- 2.14.3