* [PATCH next] drm/amd/ras: Fix memory corruption in ras_core_convert_timestamp_to_time()
@ 2025-10-22 11:04 Dan Carpenter
2025-10-23 7:18 ` kernel test robot
2025-10-23 19:38 ` kernel test robot
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-10-22 11:04 UTC (permalink / raw)
To: YiPeng Chai
Cc: Alex Deucher, Christian König, David Airlie, Simona Vetter,
Tao Zhou, Hawking Zhang, amd-gfx, dri-devel, linux-kernel,
kernel-janitors
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.
Fixes: ace232eff50e ("drm/amdgpu: Add ras module files into amdgpu")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/gpu/drm/amd/ras/rascore/ras_core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_core.c b/drivers/gpu/drm/amd/ras/rascore/ras_core.c
index 01122b55c98a..d8a004878a64 100644
--- a/drivers/gpu/drm/amd/ras/rascore/ras_core.c
+++ b/drivers/gpu/drm/amd/ras/rascore/ras_core.c
@@ -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;
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH next] drm/amd/ras: Fix memory corruption in ras_core_convert_timestamp_to_time()
2025-10-22 11:04 [PATCH next] drm/amd/ras: Fix memory corruption in ras_core_convert_timestamp_to_time() Dan Carpenter
@ 2025-10-23 7:18 ` kernel test robot
2025-10-23 19:38 ` kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-10-23 7:18 UTC (permalink / raw)
To: Dan Carpenter, YiPeng Chai
Cc: oe-kbuild-all, Alex Deucher, Christian König, David Airlie,
Simona Vetter, Tao Zhou, Hawking Zhang, amd-gfx, dri-devel,
linux-kernel, kernel-janitors
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/202510231558.5UzBX0ox-lkp@intel.com/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/202510231558.5UzBX0ox-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510231558.5UzBX0ox-lkp@intel.com/
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!
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH next] drm/amd/ras: Fix memory corruption in ras_core_convert_timestamp_to_time()
2025-10-22 11:04 [PATCH next] drm/amd/ras: Fix memory corruption in ras_core_convert_timestamp_to_time() Dan Carpenter
2025-10-23 7:18 ` kernel test robot
@ 2025-10-23 19:38 ` kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-10-23 19:38 UTC (permalink / raw)
To: Dan Carpenter, YiPeng Chai
Cc: oe-kbuild-all, Alex Deucher, Christian König, David Airlie,
Simona Vetter, Tao Zhou, Hawking Zhang, amd-gfx, dri-devel,
linux-kernel, kernel-janitors
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/202510240310.WujwpVmw-lkp@intel.com/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/202510240310.WujwpVmw-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510240310.WujwpVmw-lkp@intel.com/
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!
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-23 19:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-22 11:04 [PATCH next] drm/amd/ras: Fix memory corruption in ras_core_convert_timestamp_to_time() Dan Carpenter
2025-10-23 7:18 ` kernel test robot
2025-10-23 19:38 ` kernel test robot
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).