| 2ccdefee | 19-Mar-2026 |
Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> |
drm/amd/ras: Add input pointer validation in ras core helpers
Add NULL checks for helper input/output pointers that are directly dereferenced, such as tm, seqno, dev_info and init_config.
Cc: Tao Z
drm/amd/ras: Add input pointer validation in ras core helpers
Add NULL checks for helper input/output pointers that are directly dereferenced, such as tm, seqno, dev_info and init_config.
Cc: Tao Zhou <tao.zhou1@amd.com> Cc: YiPeng Chai <YiPeng.Chai@amd.com> Cc: Dan Carpenter <dan.carpenter@linaro.org> Cc: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Reviewed-by: YiPeng Chai <YiPeng.Chai@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| 2b8101cc | 15-Mar-2026 |
Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> |
drm/amd/ras: Fix NULL deref in ras_core_get_utc_second_timestamp()
ras_core_get_utc_second_timestamp() retrieves the current UTC timestamp (in seconds since the Unix epoch) through a platform-specif
drm/amd/ras: Fix NULL deref in ras_core_get_utc_second_timestamp()
ras_core_get_utc_second_timestamp() retrieves the current UTC timestamp (in seconds since the Unix epoch) through a platform-specific RAS system callback and is used for timestamping RAS error events.
The function checks ras_core in the conditional statement before calling the sys_fn callback. However, when the condition fails, the function prints an error message using ras_core->dev.
If ras_core is NULL, this can lead to a potential NULL pointer dereference when accessing ras_core->dev.
Add an early NULL check for ras_core at the beginning of the function and return 0 when the pointer is not valid. This prevents the dereference and makes the control flow clearer.
Fixes: 13c91b5b4378 ("drm/amd/ras: Add rascore unified interface function") Cc: YiPeng Chai <YiPeng.Chai@amd.com> Cc: Dan Carpenter <dan.carpenter@linaro.org> Cc: Tao Zhou <tao.zhou1@amd.com> Cc: Hawking Zhang <Hawking.Zhang@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Reviewed-by: YiPeng Chai <YiPeng.Chai@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| a4f87a1c | 16-Dec-2025 |
Gangliang Xie <ganglxie@amd.com> |
drm/amd/ras: adapt sync info func for pmfw eeprom
adapt sync info func for pmfw eeprom
Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex
drm/amd/ras: adapt sync info func for pmfw eeprom
adapt sync info func for pmfw eeprom
Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| 89b814a3 | 15-Dec-2025 |
Gangliang Xie <ganglxie@amd.com> |
drm/amd/ras: add initialization func for pmfw eeprom
add initialization func for pmfw eeprom
Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by:
drm/amd/ras: add initialization func for pmfw eeprom
add initialization func for pmfw eeprom
Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| 72289903 | 15-Dec-2025 |
Gangliang Xie <ganglxie@amd.com> |
drm/amd/ras: adapt page retirement process for pmfw eeprom
read bad page data from pmfw eeprom when retirement is triggered, use timestamp read from eeprom
Signed-off-by: Gangliang Xie <ganglxie@am
drm/amd/ras: adapt page retirement process for pmfw eeprom
read bad page data from pmfw eeprom when retirement is triggered, use timestamp read from eeprom
Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| 42c46be2 | 15-Dec-2025 |
Gangliang Xie <ganglxie@amd.com> |
drm/amd/ras: add read func for pmfw eeprom
add read func for pmfw eeprom, and adapt address converting for bad pages loaded from pmfw eeprom
v2: change label 'Out' to 'out'
Signed-off-by: Tao Zhou
drm/amd/ras: add read func for pmfw eeprom
add read func for pmfw eeprom, and adapt address converting for bad pages loaded from pmfw eeprom
v2: change label 'Out' to 'out'
Signed-off-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| 3972f41b | 15-Dec-2025 |
Tao Zhou <tao.zhou1@amd.com> |
drm/amd/ras: make MCA IPID parse global
add a new IPID parse interface for umc, so we can implement it for each ASIC, and so we can call it in other blocks
Signed-off-by: Tao Zhou <tao.zhou1@amd.co
drm/amd/ras: make MCA IPID parse global
add a new IPID parse interface for umc, so we can implement it for each ASIC, and so we can call it in other blocks
Signed-off-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| b18475fb | 15-Dec-2025 |
Gangliang Xie <ganglxie@amd.com> |
drm/amd/ras: add append func for pmfw eeprom
add append func for pmfw eeprom
Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <a
drm/amd/ras: add append func for pmfw eeprom
add append func for pmfw eeprom
Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| 0d21084c | 12-Dec-2025 |
Gangliang Xie <ganglxie@amd.com> |
drm/amd/ras: add wrapper funcs for pmfw eeprom
add wrapper funcs for pmfw eeprom interface to make them easier to be called
Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <ta
drm/amd/ras: add wrapper funcs for pmfw eeprom
add wrapper funcs for pmfw eeprom interface to make them easier to be called
Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| 12f4d448 | 12-Dec-2025 |
Gangliang Xie <ganglxie@amd.com> |
drm/amd/ras: add uniras smu feature flag init func
add flag to indicate if pmfw eeprom is supported or not, and initialize it
v2: change copyright from 2025 to 2026
Signed-off-by: Gangliang Xie <g
drm/amd/ras: add uniras smu feature flag init func
add flag to indicate if pmfw eeprom is supported or not, and initialize it
v2: change copyright from 2025 to 2026
Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| 74c2689e | 26-Feb-2026 |
Yujie Liu <yujie.liu@intel.com> |
drm/amd/ras: fix kernel-doc warning for ras_eeprom_append()
Warning: drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_eeprom.c:845 function parameter 'ras_core' not described in 'ras_eeprom_append' War
drm/amd/ras: fix kernel-doc warning for ras_eeprom_append()
Warning: drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_eeprom.c:845 function parameter 'ras_core' not described in 'ras_eeprom_append' Warning: drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_eeprom.c:845 expecting prototype for ras_core_eeprom_append(). Prototype was for ras_eeprom_append() instead
Fixes: 5c3be5defc92 ("drm/amd/ras: Add eeprom ras functions") Signed-off-by: Yujie Liu <yujie.liu@intel.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| 9f3d543a | 25-Feb-2026 |
Kees Cook <kees@kernel.org> |
drm/amd/ras: Fix type size of remainder argument
Forcing an int to be dereferenced at uint64_t for div64_u64_rem() runs the risk of endian confusion and stack overflowing writes. Seen while preparin
drm/amd/ras: Fix type size of remainder argument
Forcing an int to be dereferenced at uint64_t for div64_u64_rem() runs the risk of endian confusion and stack overflowing writes. Seen while preparing to enable -Warray-bounds globally:
In file included from ../arch/x86/include/asm/processor.h:35, from ../include/linux/sched.h:13, from ../include/linux/ratelimit.h:6, from ../include/linux/dev_printk.h:16, from ../drivers/gpu/drm/amd/amdgpu/../ras/ras_mgr/ras_sys.h:29, from ../drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras.h:27, from ../drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_core.c:24: In function 'div64_u64_rem', inlined from 'ras_core_convert_timestamp_to_time' at ../drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_core.c:72:9: ../include/linux/math64.h:56:20: error: array subscript 'u64 {aka long long unsigned int}[0]' is partly outside array bounds of 'int[1]' [-Werror=array-bounds=] 56 | *remainder = dividend % divisor; | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ ../drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_core.c: In function 'ras_core_convert_timestamp_to_time': ../drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_core.c:70:19: note: object 'remaining_seconds' of size 4 70 | int days, remaining_seconds; | ^~~~~~~~~~~~~~~~~
Use a 64-bit type for the remainder calculation, but leave remaining_seconds as 32-bit to avoid 64-bit division later. The value of remainder will always be less than seconds_per_day, so there's no truncation risk.
Fixes: ace232eff50e ("drm/amdgpu: Add ras module files into amdgpu") Signed-off-by: Kees Cook <kees@kernel.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|
| 186eb92a | 09-Feb-2026 |
Jinzhou Su <jinzhou.su@amd.com> |
drm/amd/ras: Add convert retired address structure
Add convert retired address command and structure for uniras.
Signed-off-by: Jinzhou Su <jinzhou.su@amd.com> Reviewed-by: YiPeng Chai <YiPeng.Chai
drm/amd/ras: Add convert retired address structure
Add convert retired address command and structure for uniras.
Signed-off-by: Jinzhou Su <jinzhou.su@amd.com> Reviewed-by: YiPeng Chai <YiPeng.Chai@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
show more ...
|