Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2484177pxj; Mon, 10 May 2021 04:12:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg2McbapoTgmiABe9Np9zUQBsUlJWcCWI2dWfI79T52oWQ9p0ZSlGD8cDSW2fLA4pAon4y X-Received: by 2002:a05:6402:752:: with SMTP id p18mr29039932edy.127.1620645146445; Mon, 10 May 2021 04:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645146; cv=none; d=google.com; s=arc-20160816; b=BoL06hoL+suyVZZxYTWXR/MgdANViDU+UmsiNc74CccPssP/pfy2DjKphKAQcEQ7D3 ZIwkaiQpw4Tqt9CdR4Yh+pwVRCiZOMBgaXGN9EsT71b7MtN8K7jz9pmh2WtEoJ3XA4li KqyiSDZu479mYuvntzq6+Uo/4tbLpxz9HekVEvmvybn/cP+hVnGGYiY9U1el/pxTgPOT duKU7gGxX+WAK84LlQBab/LQkqx1CkW+rFc0IBThd/msAUvxaAJ4663L5z5pOTU0dwqS ZJ16gg40us5+1aR8bTgCOcDAcwGBkMYHAimP7Se+z8UzTiacqMwQzRe7SKvnoD14X5za UgBQ== 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=6+xMYflYMIRPkoLSFUG92X2IF6Q/WgwKdwdsdFS2UD4=; b=Wg0cWnYu2Wd1+JfbuplUgKl+iKFojXe5itju1i+TGDGxCWGZVyh7EhiblMYbYRdtBh D870No2kOPBtzcGlx/7HByQVkeZ1Y/kGwmG6UCBv02BDJrMD2lLOSvjOw07osI4OkTvd cM5Y/wQytIm0jqHaprNa/Ffi4fr0HThClCYx8BXipLLQENv75mQ9HvKQ2haMu0jnZIrX l/4LcOCsQOJm9arKGuKA/lSg4qH3yA/jeTTK1njoMlYyOAmIRtmOos6KayQu4aaqFQaF 5S53ZOYlaYf/Fdt3Ly7DzNHjXMpUaPKZTJyREkT7YmQWMPiWtAHFbIH+8ogZ3lvE6hMr 7Asg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aZVYUdB1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si13838136eds.79.2021.05.10.04.12.01; Mon, 10 May 2021 04:12:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aZVYUdB1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S235884AbhEJLGu (ORCPT + 99 others); Mon, 10 May 2021 07:06:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:59674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232585AbhEJKp6 (ORCPT ); Mon, 10 May 2021 06:45:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3E791619AA; Mon, 10 May 2021 10:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643020; bh=Kc3/jYjdXUV2vo541oiEx5cP/sIAfbsWjpGIBRrWKQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aZVYUdB1e8f945xpTDJIYIPmw4LO/FAZpMbJHjuEQirZHZ/7D+5CCqGI7HIS8691S C0/nGF1M1sDW3UZ7pja/fvLRrD3FaqiYG+ObxNkYJBOfviA238jNTFkT0NwSxSnvF5 rU9gR1nrCa9pQ3rqmQT7AXJ+IlsLWMsKpeSShcAs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Wheeler , Lyude Paul , Anson Jacob , Aurabindo Jayamohanan Pillai , Solomon Chiu , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 145/299] drm/amd/display: Fix UBSAN warning for not a valid value for type _Bool Date: Mon, 10 May 2021 12:19:02 +0200 Message-Id: <20210510102009.750814647@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anson Jacob [ Upstream commit 6a30a92997eee49554f72b462dce90abe54a496f ] [Why] dc_cursor_position do not initialise position.translate_by_source when crtc or plane->state->fb is NULL. UBSAN caught this error in dce110_set_cursor_position, as the value was garbage. [How] Initialise dc_cursor_position structure elements to 0 in handle_cursor_update before calling get_cursor_position. Tested-by: Daniel Wheeler Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1471 Reported-by: Lyude Paul Signed-off-by: Anson Jacob Reviewed-by: Aurabindo Jayamohanan Pillai Acked-by: Solomon Chiu Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 830d302be045..12a4f0675fb0 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6800,10 +6800,6 @@ static int get_cursor_position(struct drm_plane *plane, struct drm_crtc *crtc, int x, y; int xorigin = 0, yorigin = 0; - position->enable = false; - position->x = 0; - position->y = 0; - if (!crtc || !plane->state->fb) return 0; @@ -6850,7 +6846,7 @@ static void handle_cursor_update(struct drm_plane *plane, struct dm_crtc_state *crtc_state = crtc ? to_dm_crtc_state(crtc->state) : NULL; struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); uint64_t address = afb ? afb->address : 0; - struct dc_cursor_position position; + struct dc_cursor_position position = {0}; struct dc_cursor_attributes attributes; int ret; -- 2.30.2