drm/amd/ras: Fix memory corruption in ras_core_convert_timestamp_to_time()
Subsystems (3)
PATCH 1/1 drm/amd/ras: Fix memory corruption in ras_core_convert_timestamp_to_time()
The div64_u64_rem() function takes a u64 as a remainder. Passing an int pointer to it will result in memory corruption. Change "remaining_seconds" from int to u64.
--- drivers/gpu/drm/amd/ras/rascore/ras_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/ras/rascore/ras_core.c +3 -2
@@ -67,9 +67,10 @@ int ras_core_convert_timestamp_to_time(struct ras_core_context *ras_core,int seconds_per_day =24 *60 *60 ;int seconds_per_hour =60 *60 ;int seconds_per_minute =60 ; -int days, remaining_seconds; +uint64_t remaining_seconds; +int days; - days =div64_u64_rem (timestamp, seconds_per_day, (uint64_t *)&remaining_seconds); + days =div64_u64_rem (timestamp, seconds_per_day, &remaining_seconds);/* utc_timestamp follows the Unix epoch */ year =1970 ;
Signature · 1 line
2.51.0
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Dan,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20251022]
url: https://github.com/intel-lab-lkp/linux/commits/Dan-Carpenter/drm-amd-ras-Fix-memory-corruption-in-ras_core_convert_timestamp_to_time/20251022-190512 base: next-20251022 patch link: https://lore.kernel.org/r/aPi6I5z5oenppEuu%40stanley.mountain patch subject: [PATCH next] drm/amd/ras: Fix memory corruption in ras_core_convert_timestamp_to_time() config: arm-randconfig-003-20251023 (https://download.01.org/0day-ci/archive/20251023/[email protected]/config) compiler: arm-linux-gnueabi-gcc (GCC) 8.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251023/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>, old ones prefixed by <<):
WARNING: modpost: missing MODULE_DESCRIPTION() in arch/arm/probes/kprobes/test-kprobes.o
ERROR: modpost: "__aeabi_uldivmod" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
>> ERROR: modpost: "__aeabi_ldivmod" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Dan,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20251022]
url: https://github.com/intel-lab-lkp/linux/commits/Dan-Carpenter/drm-amd-ras-Fix-memory-corruption-in-ras_core_convert_timestamp_to_time/20251022-190512 base: next-20251022 patch link: https://lore.kernel.org/r/aPi6I5z5oenppEuu%40stanley.mountain patch subject: [PATCH next] drm/amd/ras: Fix memory corruption in ras_core_convert_timestamp_to_time() config: i386-randconfig-014-20251023 (https://download.01.org/0day-ci/archive/20251024/[email protected]/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251024/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: "__umoddi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! >> ERROR: modpost: "__udivmoddi4" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki