Received: by 2002:a05:7412:a9a8:b0:f9:92ae:e617 with SMTP id o40csp95889rdh; Wed, 20 Dec 2023 17:32:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1aaPfZOb8qpST4+LsZO2GgFUHBGlaRGxT5GMzTXv0oWouzvpPs9sbzmedI/jsifnB6iK/ X-Received: by 2002:a05:6214:1302:b0:67a:a721:b191 with SMTP id pn2-20020a056214130200b0067aa721b191mr28811445qvb.76.1703122368146; Wed, 20 Dec 2023 17:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703122368; cv=none; d=google.com; s=arc-20160816; b=HdO9BISBoix3vCNapQX4CROiLuGhl9T4aH05hueFSJlE6HXX0NTUYPet1GM3BdA3Sj TkiSHIEOgsXi5vtu+3NucbQ5UNn4OV+QTLyTz1TeiPk0jDosWteFvjCMDuniotCVa9JJ oc42wsKP5W/CJTmzwTgWVXf8ehML0aLtmOwSEUcGaXY0QuuKVldTGhdPf56bsvyimGrO 5WyakftPq9b2zhzsmwEJ1VNV7oprsal3uXucsidfQwPMbVTKkha026IzQ09I1WIh8d15 vazqw9X9avaaLEdGAfrmqXuVG/OcVRY45slYalonRJ9+befKWQwzepkjkRaj8zakQRLZ 2Lew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=VvlqbeS12hElKyGH0eI0S3co5cXdQ2N/4ifqBeL+jxs=; fh=MZvDjxMD6daA6DQ7bZNdBfqrCDpAiw0s2VhTe2mfZCE=; b=lzXNTtSf+3cOd4nofiLHjplTIqMwleX9axL2ePJ4kxK/uIGB0W5GIhXnPpDXAN6qUJ ty2jZElLhJco1/keAVb+WvamAVBbV3fYzXq+79WTrSou3jx2iadLDkuFgygCk2Z/Vbfe DnEHS00H8mCFP+U3eKr0UwGMlVaS7FDPjENiFzWUNC177RzJzrgKgbVUdV1zREVxKQXe wAdAmHGMDw3DZX7SdFWc5lb+kv+vgpSnEv7NnApjwMt8/VQe37l7CBm9Y9ndiJT35mD2 lXQYDJMgJBzuivWu083ZLChNVXZZ37TqLdQG1ZEtyjtERI0zRVjgxHtFbSdTClep4cOr Mxag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto+bounces-946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-946-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z12-20020a0cda8c000000b0067f74f4aa5asi1167014qvj.532.2023.12.20.17.32.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 17:32:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto+bounces-946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-946-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E40F11C235E5 for ; Thu, 21 Dec 2023 01:32:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BFDA441C; Thu, 21 Dec 2023 01:32:44 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD7834416; Thu, 21 Dec 2023 01:32:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gondor.apana.org.au 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 1rG7vJ-00DG0a-Mf; Thu, 21 Dec 2023 09:32:30 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Thu, 21 Dec 2023 09:32:40 +0800 Date: Thu, 21 Dec 2023 09:32:40 +0800 From: Herbert Xu To: Edward Adam Davis Cc: syzbot+8ffb0839a24e9c6bfa76@syzkaller.appspotmail.com, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [PATCH next] crypto: fix oob Read in arc4_crypt Message-ID: References: <000000000000d52e14060cc9c551@google.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Dec 20, 2023 at 11:53:55PM +0800, Edward Adam Davis wrote: > The space allocated to areq is not sufficient to access the member __ctx of > struct skcipher_request, as the space occupied by struct arc4_ctx for reading > is 1032 bytes, while the requested memory size in skcipher_recvmsg() is: > sizeof(struct af_alg_async_req) + crypto_skcipher_reqsize(tfm) = 736 bytes, > which does not include the memory required for __ctx of struct skcipher_request. > > Reported-by: syzbot+8ffb0839a24e9c6bfa76@syzkaller.appspotmail.com > Signed-off-by: Edward Adam Davis > --- > crypto/algif_skcipher.c | 10 +++++++--- > crypto/skcipher.c | 1 - > include/crypto/internal/skcipher.h | 1 + > 3 files changed, 8 insertions(+), 4 deletions(-) I see where the real bug is. The statesize is not being passed along by ecb so that's why we end up with no memory. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt