Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1806463rdh; Tue, 26 Sep 2023 04:20:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3E3FXj0W2ibiRNRiKNmQf76Qeg+lDFtmyJkiLXKnU8Gx6/lZ8Yupf3SMX8PxGRnN+qNpj X-Received: by 2002:a05:6808:bc3:b0:3ae:52f3:ba05 with SMTP id o3-20020a0568080bc300b003ae52f3ba05mr2663962oik.28.1695727228719; Tue, 26 Sep 2023 04:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695727228; cv=none; d=google.com; s=arc-20160816; b=GPGaUJBArkEWSz/ixAyonyEEGSPkx3eBMi3uuy2XnaSx2mi1rMmk67LgTdkdMYcS90 niLu9hnPppeDLZFfl6J2DE3ebzPlwDL9imewK1YtWq62muaTv2AWNXvxwL+LEikv3NPo wRsTcX53bWdNUWfZiXbl17qthoSlCCx4kdFpY9X7s0heiY5UZHW8q3HFl/kPU2Iyd1RX rO5ic2kYFXfKhHfCcys+j2QNhI0SdK1Op+EvUEDRRScDNvxN8vUAR+ue08Rp7vNgInb7 4ITM/g8ttFygcue0VcuWfMh11fxSPAP2WFJwtq2haGG/TK8X5SXBF8vC2pGTXjHtSuD+ 1aDg== 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:dkim-signature; bh=1x74dddL2DLLrp8YnhqX3F8fMC0YOVO/PaT5Z6OTL+4=; fh=Ag05z+DW9j0n/4lFupFuEILJNMi2ZOipiWtNCBJArmY=; b=SzZ7p9mPcMJBWlUDr97cigcp/iBH5i1oHE6KpQc0+xwLsXprSFKqcRrG4pIaKdLcHa CnlEcNMRbGFzlezaTq3s4vlgUzBSCSIUJgf8S0nSQh6bn9TkIF3PnBN1oX/jSZRTOYes bVRoDEC2d7RhF7wWqwa03640MuY5/jr6anifUxO0BTPZZs7od6caGZawPGs1/1dIi1/h 5XhYr9qG53oLc7IJ4Ko2rOH+VnJfOuU75JYsYTzZ3CIgPNwZaH8nqClRaLOgMCRg6ABf VvlMkQmKUjYhCZ1eOdKUZUJB8XH95W7OMGT9PUKjIAN/iTAaLCsIXeVMLTDigB2FibEt Pdgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PnSQ4fEY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id f1-20020a056a00228100b0068ffa414ea1si13227398pfe.298.2023.09.26.04.20.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 04:20:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PnSQ4fEY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 6A06681DD24C; Tue, 26 Sep 2023 04:13:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbjIZLM5 (ORCPT + 99 others); Tue, 26 Sep 2023 07:12:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbjIZLM4 (ORCPT ); Tue, 26 Sep 2023 07:12:56 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0664FE5; Tue, 26 Sep 2023 04:12:50 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A136C433C8; Tue, 26 Sep 2023 11:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695726769; bh=RCT3ksFfxXJUFEFoooNTpXtMGpORVm3wt6SDo0yzwmE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PnSQ4fEY9EzdNCHhk5QjY7a7Lr6P7QiEj7kurskRLU+lPsoG8n2MMxSPQuWYUfus/ 6JfLmXgWJinhzUbLWYvfRgn9PGR3JOc76sxGakLjyXP9cPSSK71LGuZ/Atco6Nq5DE SJJBmHOiqR4C1E6XlOebea00znq68BFinA5mj+gC11ziLIwtl02ECX1Ye76uabp/SH hbppwmjIlZ/tMX6DPMbqPfO6rf7AntkbdRujTam9AO/Mcn1SzGi2ItClO+iSI0sDmU fy+pF5ntNp/g5rRWMSgXeVzQsNUxTgfV3JKY/tYhqAJf/K5kxJl7i0rV4j5n/xX1mJ 3TojyEDcyRcDg== Date: Tue, 26 Sep 2023 12:12:45 +0100 From: Conor Dooley To: Edward AD Cc: syzbot+8d2757d62d403b2d9275@syzkaller.appspotmail.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [PATCH] riscv: fix out of bounds in walk_stackframe Message-ID: <20230926-shorter-acetone-25a93d7ab27c@spud> References: <0000000000000170df0605ccf91a@google.com> <20230926105949.1025995-2-twuufnxlz@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MisKy8cQA+A+qNEs" Content-Disposition: inline In-Reply-To: <20230926105949.1025995-2-twuufnxlz@gmail.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 26 Sep 2023 04:13:05 -0700 (PDT) --MisKy8cQA+A+qNEs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Edward, Where did you come up with the CC list for this patch from? Please run get_maintainer.pl on your patches and CC the output. You've not CCed any relevant developers on this mail :( On Tue, Sep 26, 2023 at 06:59:50PM +0800, Edward AD wrote: > Increase the check on the frame after assigning its value. This is to pre= vent=20 > frame access from crossing boundaries. >=20 > Reported-and-tested-by: syzbot+8d2757d62d403b2d9275@syzkaller.appspotmail= =2Ecom Please also add a Fixes: tag & a Closes: tag with a link to the report when you do so. Thanks, Conor. > Signed-off-by: Edward AD > --- > arch/riscv/kernel/stacktrace.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrac= e.c > index 64a9c093aef9..53bd18672329 100644 > --- a/arch/riscv/kernel/stacktrace.c > +++ b/arch/riscv/kernel/stacktrace.c > @@ -54,6 +54,8 @@ void notrace walk_stackframe(struct task_struct *task, = struct pt_regs *regs, > break; > /* Unwind stack frame */ > frame =3D (struct stackframe *)fp - 1; > + if (!virt_addr_valid(frame)) > + break; > sp =3D fp; > if (regs && (regs->epc =3D=3D pc) && (frame->fp & 0x7)) { > fp =3D frame->ra; > --=20 > 2.25.1 >=20 --MisKy8cQA+A+qNEs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZRK8rQAKCRB4tDGHoIJi 0kqjAP90g4/G1TGVcQIXrpJ/IpCj6h9HaqBw4HfNIj6uQ/YO8gD/WqV+EnH6Ri0n 4R16KfJi3y1+MrAgywo2gRnpSYCSfQA= =OI2P -----END PGP SIGNATURE----- --MisKy8cQA+A+qNEs--