Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3470727rwa; Tue, 23 Aug 2022 05:25:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR68pKu47xVWcJSVOC+bkK1NLHVFO2R/uMtO6XziQcCIdB6BfECt9epYDf2qzQrW5FFzOtrz X-Received: by 2002:a63:5c4a:0:b0:41d:bd7d:6084 with SMTP id n10-20020a635c4a000000b0041dbd7d6084mr20386701pgm.411.1661257517292; Tue, 23 Aug 2022 05:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257517; cv=none; d=google.com; s=arc-20160816; b=h5nxP9JJUT47zIG60HcDt9iOe5rOPCdDVhGWASlKKgvTpp5A/UCVZz2swd14VJmmjA fS3pUEzUSINtRCc5TMC68dBKsWUE25dtNBSos5kxZzrRN2qr5YQpHmOruU3pJAyzov63 7C+HKQMJOxx/nDypMhj/NU8Iwk6tM4hOvt/W3HOM+vPTLTnO7mZa3QAQ/VM6qsO548QW AtSlwZLsoUHk/+nkJEutR4T+CIr/SM4uYNXp3gk7wsbRBVtE0apVrAOcyAdPRsZcfYfx ssORvLzQMNsQnFaBuqA0fTu094YOK9M+N6fzDO3d3z2VeuSE2Q6VBybFJeaCxHyf4CLL 7atA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=myCIKb/pn6op1H9jlUEmVoL0FbUEJMei1LS/2X5rxLU=; b=Nt+QalxrIizPMp3usQtynAzi5Ph5wWuj8+3hxw4mJaDKXMgA5kXOnJTD9SepfjhNxu XOWS15jB2kQIVtvkt6zc4S0ri5QGm6kmLTAZ0fV1j3KaI+gYNKUkmMyAMClLfafcuFKv kt/qO9jHMMUvPVCpdQb3RCy2FwBWr+WYciYyNlWuIjjikMp/f+S6MTRPcK7RpitNBdp9 KC6ycrhMo/cnOx2NpPAC+w2gp/L03CM8Aqlzr9rJnTSh0aEKHufOJ9BBNMYYGlCDu3zP IclSUWvkhlSWU4nGjHXQ/lIOBg5lv8ZfAE8TOY1j8weMIz6u1oKdCCeR6ql+uONkJPjt A0WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V3GdcWTK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t10-20020a63460a000000b0041b9a820023si15760329pga.264.2022.08.23.05.25.05; Tue, 23 Aug 2022 05:25:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=V3GdcWTK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355434AbiHWKcG (ORCPT + 99 others); Tue, 23 Aug 2022 06:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354039AbiHWKQh (ORCPT ); Tue, 23 Aug 2022 06:16:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EB297FFA8; Tue, 23 Aug 2022 02:01:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 679AF6156A; Tue, 23 Aug 2022 09:01:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F9C1C433C1; Tue, 23 Aug 2022 09:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245260; bh=38z5+1E7HVbT6HeQjqkDPqJFtUVE6OakjVGr/qrHk+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V3GdcWTKwTbNjYYhG1cdPfvVHw0ahOHPBjAx4EREqzKYWMmytjtyRpVI+QstbMiYb Ozg7l0s7zBIEnghQOTbkdjTPJywCMC8VmzYdASNh11nqCrxKNjyD8WKhEoYtObZJBO vmbKQmltiSxFuP/CWJZMSLPgKzDLMSAmkQYevSHY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Timur Tabi , Karol Herbst , Lyude Paul Subject: [PATCH 4.19 022/287] drm/nouveau: fix another off-by-one in nvbios_addr Date: Tue, 23 Aug 2022 10:23:11 +0200 Message-Id: <20220823080101.023606978@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-kernel@vger.kernel.org From: Timur Tabi commit c441d28945fb113220d48d6c86ebc0b090a2b677 upstream. This check determines whether a given address is part of image 0 or image 1. Image 1 starts at offset image0_size, so that address should be included. Fixes: 4d4e9907ff572 ("drm/nouveau/bios: guard against out-of-bounds accesses to image") Cc: # v4.8+ Signed-off-by: Timur Tabi Reviewed-by: Karol Herbst Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220511163716.3520591-1-ttabi@nvidia.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c @@ -33,7 +33,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 { u32 p = *addr; - if (*addr > bios->image0_size && bios->imaged_addr) { + if (*addr >= bios->image0_size && bios->imaged_addr) { *addr -= bios->image0_size; *addr += bios->imaged_addr; }