diff options
| author | Umio Yasuno <[email protected]> | 2025-07-15 14:44:35 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2025-07-16 20:17:21 +0000 |
| commit | d524d40e3a6152a3ea1125af729f8cd8ca65efde (patch) | |
| tree | e7160e29b4a125fb6ffa77fd62c0f70f77725153 /drivers/gpu/drm/amd/pm/amdgpu_pm.c | |
| parent | drm/amdgpu/jpeg: clean up reset type handling (diff) | |
| download | kernel-d524d40e3a6152a3ea1125af729f8cd8ca65efde.tar.gz kernel-d524d40e3a6152a3ea1125af729f8cd8ca65efde.zip | |
drm/amd/pm: fix null pointer access
Writing a string without delimiters (' ', '\n', '\0') to the under
gpu_od/fan_ctrl sysfs or pp_power_profile_mode for the CUSTOM profile
will result in a null pointer dereference.
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4401
Signed-off-by: Umio Yasuno <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/amdgpu_pm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/pm/amdgpu_pm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index 4b151bbaffaa..4b64851fdb42 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -1398,6 +1398,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev, if (ret) return -EINVAL; parameter_size++; + if (!tmp_str) + break; while (isspace(*tmp_str)) tmp_str++; } @@ -3645,6 +3647,9 @@ static int parse_input_od_command_lines(const char *buf, return -EINVAL; parameter_size++; + if (!tmp_str) + break; + while (isspace(*tmp_str)) tmp_str++; } |
