lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <d02c033c6f4411be31a9439f33de2c593b51d8fc.camel@gmail.com>
Date: Wed, 4 Sep 2024 00:50:56 +0200
From: Filip Hejsek <filip.hejsek@...il.com>
To: Harry Wentland <harry.wentland@....com>,
    Leo Li <sunpeng.li@....com>,
    Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
    Alex Deucher <alexander.deucher@....com>,
    "Christian König" <christian.koenig@....com>,
    Xinhui Pan <Xinhui.Pan@....com>,
    David Airlie <airlied@...il.com>,
    Daniel Vetter <daniel@...ll.ch>,
    amd-gfx@...ts.freedesktop.org,
    dri-devel@...ts.freedesktop.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] drm/amd/display: Fix debugfs dmub_fw_state read

When the FW state is too large to fit in initial seq_file buffer,
seq_write returns -1, which is subsequently returned from
dmub_fw_state_show. This causes the read operation to fail.

Return instead always 0 and let the seq_file handling retry the read
with a larger buffer if the initial buffer overflows.

Fixes: 2364076772b1 ("drm/amd/display: Add DMUB firmware state debugfs")
Signed-off-by: Filip Hejsek <filip.hejsek@...il.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index db56b0aa545..ecda44789b4 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -958,7 +958,8 @@ static int dmub_fw_state_show(struct seq_file *m, void *data)
 
 	state_size = fb_info->fb[DMUB_WINDOW_6_FW_STATE].size;
 
-	return seq_write(m, state_base, state_size);
+	seq_write(m, state_base, state_size);
+	return 0;
 }
 
 /* replay_capability_show() - show eDP panel replay capability

base-commit: 96a5152075c0424e9bda551d00ab850c815e309c
-- 
2.46.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ