linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Anson Jacob <Anson.Jacob@amd.com>,
	Daniel Wheeler <daniel.wheeler@amd.com>,
	Lyude Paul <lyude@redhat.com>,
	Aurabindo Jayamohanan Pillai <Aurabindo.Pillai@amd.com>,
	Solomon Chiu <solomon.chiu@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Sasha Levin <sashal@kernel.org>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 5.11 046/115] drm/amd/display: Fix UBSAN warning for not a valid value for type '_Bool'
Date: Mon,  3 May 2021 12:35:50 -0400	[thread overview]
Message-ID: <20210503163700.2852194-46-sashal@kernel.org> (raw)
In-Reply-To: <20210503163700.2852194-1-sashal@kernel.org>

From: Anson Jacob <Anson.Jacob@amd.com>

[ 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 <daniel.wheeler@amd.com>
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1471
Reported-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Anson Jacob <Anson.Jacob@amd.com>
Reviewed-by: Aurabindo Jayamohanan Pillai <Aurabindo.Pillai@amd.com>
Acked-by: Solomon Chiu <solomon.chiu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 fc2763745ae1..2b957d60c7b5 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7250,10 +7250,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;
 
@@ -7300,7 +7296,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


  parent reply	other threads:[~2021-05-03 16:45 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 16:35 [PATCH AUTOSEL 5.11 001/115] drm: Added orientation quirk for OneGX1 Pro Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 002/115] drm/qxl: do not run release if qxl failed to init Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 003/115] drm/qxl: release shadow on shutdown Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 004/115] drm/ast: Fix invalid usage of AST_MAX_HWC_WIDTH in cursor atomic_check Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 005/115] drm/amd/display: changing sr exit latency Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 006/115] drm/amd/display: Fix MPC OGAM power on/off sequence Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 007/115] drm/ast: fix memory leak when unload the driver Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 008/115] drm/amd/display: Check for DSC support instead of ASIC revision Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 009/115] drm/amd/display: Don't optimize bandwidth before disabling planes Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 010/115] drm/amd/display: Return invalid state if GPINT times out Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 011/115] drm/amdgpu/display: buffer INTERRUPT_LOW_IRQ_CONTEXT interrupt work Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 012/115] drm/amd/display/dc/dce/dce_aux: Remove duplicate line causing 'field overwritten' issue Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 013/115] scsi: lpfc: Fix incorrect dbde assignment when building target abts wqe Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 014/115] scsi: lpfc: Fix pt2pt connection does not recover after LOGO Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 015/115] scsi: lpfc: Fix status returned in lpfc_els_retry() error exit path Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 016/115] scsi: lpfc: Fix PLOGI ACC to be transmit after REG_LOGIN Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 017/115] scsi: lpfc: Fix ADISC handling that never frees nodes Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 018/115] drm/amdgpu: Fix some unload driver issues Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 019/115] sched/pelt: Fix task util_est update filtering Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 020/115] sched/topology: fix the issue groups don't span domain->span for NUMA diameter > 2 Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 021/115] kvfree_rcu: Use same set of GFP flags as does single-argument Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 022/115] drm/virtio: fix possible leak/unlock virtio_gpu_object_array Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 023/115] scsi: target: pscsi: Fix warning in pscsi_complete_cmd() Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 024/115] media: ite-cir: check for receive overflow Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 025/115] media: drivers: media: pci: sta2x11: fix Kconfig dependency on GPIOLIB Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 026/115] media: drivers/media/usb: fix memory leak in zr364xx_probe Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 027/115] media: cx23885: add more quirks for reset DMA on some AMD IOMMU Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 028/115] media: imx: capture: Return -EPIPE from __capture_legacy_try_fmt() Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 029/115] atomisp: don't let it go past pipes array Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 030/115] power: supply: bq27xxx: fix power_avg for newer ICs Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 031/115] extcon: arizona: Fix some issues when HPDET IRQ fires after the jack has been unplugged Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 032/115] extcon: arizona: Fix various races on driver unbind Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 033/115] media: media/saa7164: fix saa7164_encoder_register() memory leak bugs Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 034/115] media: gspca/sq905.c: fix uninitialized variable Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 035/115] media: v4l2-ctrls.c: initialize flags field of p_fwht_params Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 036/115] media: pci: saa7164: Rudimentary spelling fixes in the file saa7164-types.h Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 037/115] power: supply: Use IRQF_ONESHOT Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 038/115] backlight: qcom-wled: Use sink_addr for sync toggle Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 039/115] backlight: qcom-wled: Fix FSC update issue for WLED5 Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 040/115] drm/bridge/analogix/anx78xx: Setup encoder before registering connector Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 041/115] drm/bridge/analogix/anx78xx: Cleanup on error in anx78xx_bridge_attach() Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 042/115] drm/amdgpu: mask the xgmi number of hops reported from psp to kfd Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 043/115] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 044/115] drm/amdgpu : Fix asic reset regression issue introduce by 8f211fe8ac7c4f Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 045/115] drm/amd/pm: fix workload mismatch on vega10 Sasha Levin
2021-05-03 16:35 ` Sasha Levin [this message]
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 047/115] drm/amd/display: DCHUB underflow counter increasing in some scenarios Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 048/115] drm/amd/display: fix dml prefetch validation Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 049/115] drm/amdgpu: Fix memory leak Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 050/115] scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats() Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 051/115] drm/vkms: fix misuse of WARN_ON Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 052/115] scsi: qla2xxx: Fix use after free in bsg Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 053/115] mmc: sdhci-esdhc-imx: validate pinctrl before use it Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 054/115] mmc: sdhci-pci: Add PCI IDs for Intel LKF Sasha Levin
2021-05-03 16:35 ` [PATCH AUTOSEL 5.11 055/115] mmc: sdhci-brcmstb: Remove CQE quirk Sasha Levin
2021-05-03 16:36 ` [PATCH AUTOSEL 5.11 056/115] ata: ahci: Disable SXS for Hisilicon Kunpeng920 Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210503163700.2852194-46-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Anson.Jacob@amd.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel.wheeler@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=solomon.chiu@amd.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).