tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: e33ed48bc600febcdca9e71e43cf224934dadc4f
commit: e0aed913079d6b30aafeb50318f26d49bfb3d95b [1231/1231] arm64/mpam: resctrl: Add rmid file in resctrl sysfs
config: arm64-randconfig-001-20241029 (https://download.01.org/0day-ci/archive/20241107/202411070826.nwr0luMf-lkp@…)
compiler: aarch64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241107/202411070826.nwr0luMf-lkp@…)
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(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411070826.nwr0luMf-lkp@intel.com/
All warnings (new ones prefixed by >>):
arch/arm64/kernel/mpam/mpam_resctrl.c:221:1: warning: conflicting types for 'mpam_get_raw_resctrl_resource' due to enum/integer mismatch; have 'struct raw_resctrl_resource *(enum resctrl_resource_level)' [-Wenum-int-mismatch]
221 | mpam_get_raw_resctrl_resource(enum resctrl_resource_level level)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from arch/arm64/kernel/mpam/mpam_resctrl.c:48:
arch/arm64/kernel/mpam/mpam_internal.h:327:1: note: previous declaration of 'mpam_get_raw_resctrl_resource' with type 'struct raw_resctrl_resource *(u32)' {aka 'struct raw_resctrl_resource *(unsigned int)'}
327 | mpam_get_raw_resctrl_resource(u32 level);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kernel/mpam/mpam_resctrl.c:525:5: warning: no previous prototype for 'closid_bitmap_init' [-Wmissing-prototypes]
525 | int closid_bitmap_init(void)
| ^~~~~~~~~~~~~~~~~~
arch/arm64/kernel/mpam/mpam_resctrl.c:1319:5: warning: no previous prototype for 'cpus_ctrl_write' [-Wmissing-prototypes]
1319 | int cpus_ctrl_write(struct rdtgroup *rdtgrp, cpumask_var_t newmask,
| ^~~~~~~~~~~~~~~
arch/arm64/kernel/mpam/mpam_resctrl.c:1374:5: warning: no previous prototype for 'cpus_mon_write' [-Wmissing-prototypes]
1374 | int cpus_mon_write(struct rdtgroup *rdtgrp, cpumask_var_t newmask,
| ^~~~~~~~~~~~~~
arch/arm64/kernel/mpam/mpam_resctrl.c: In function 'rdt_last_cmd_printf':
arch/arm64/kernel/mpam/mpam_resctrl.c:1554:9: warning: function 'rdt_last_cmd_printf' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
1554 | seq_buf_vprintf(&last_cmd_status, fmt, ap);
| ^~~~~~~~~~~~~~~
arch/arm64/kernel/mpam/mpam_resctrl.c: In function 'resctrl_group_rmid_show':
>> arch/arm64/kernel/mpam/mpam_resctrl.c:1741:19: warning: variable 'times' set but not used [-Wunused-but-set-variable]
1741 | u32 flag, times;
| ^~~~~
arch/arm64/kernel/mpam/mpam_resctrl.c: In function 'mpam_resctrl_update_component_cfg':
arch/arm64/kernel/mpam/mpam_resctrl.c:2083:25: warning: implicit conversion from 'enum resctrl_ctrl_type' to 'enum rdt_event_id' [-Wenum-conversion]
2083 | type, slave_mpam_cfg);
| ^~~~
arch/arm64/kernel/mpam/mpam_resctrl.c:570: warning: Function parameter or member 'cols' not described in 'rmid_transform'
vim +/times +1741 arch/arm64/kernel/mpam/mpam_resctrl.c
1735
1736 static int resctrl_group_rmid_show(struct kernfs_open_file *of,
1737 struct seq_file *s, void *v)
1738 {
1739 int ret = 0;
1740 struct rdtgroup *rdtgrp;
> 1741 u32 flag, times;
1742
1743 hw_alloc_times_validate(times, flag);
1744
1745 rdtgrp = resctrl_group_kn_lock_live(of->kn);
1746 if (rdtgrp) {
1747 if (flag)
1748 seq_printf(s, "%u-%u\n", rdtgrp->mon.rmid,
1749 rdtgrp->mon.rmid + 1);
1750 else
1751 seq_printf(s, "%u\n", rdtgrp->mon.rmid);
1752 } else
1753 ret = -ENOENT;
1754 resctrl_group_kn_unlock(of->kn);
1755
1756 return ret;
1757 }
1758
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
From: Srinivasan Shanmugam <srinivasan.shanmugam(a)amd.com>
stable inclusion
from stable-v6.6.55
commit 122e3a7a8c7bcbe3aacddd6103f67f9f36bed473
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYR9A
CVE: CVE-2024-49894
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit b7e99058eb2e86aabd7a10761e76cae33d22b49f ]
Fixes index out of bounds issue in
`cm_helper_translate_curve_to_degamma_hw_format` function. The issue
could occur when the index 'i' exceeds the number of transfer function
points (TRANSFER_FUNC_POINTS).
The fix adds a check to ensure 'i' is within bounds before accessing the
transfer function points. If 'i' is out of bounds the function returns
false to indicate an error.
Reported by smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:594 cm_helper_translate_curve_to_degamma_hw_format() error: buffer overflow 'output_tf->tf_pts.red' 1025 <= s32max
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:595 cm_helper_translate_curve_to_degamma_hw_format() error: buffer overflow 'output_tf->tf_pts.green' 1025 <= s32max
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:596 cm_helper_translate_curve_to_degamma_hw_format() error: buffer overflow 'output_tf->tf_pts.blue' 1025 <= s32max
Cc: Tom Chung <chiahsuan.chung(a)amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira(a)amd.com>
Cc: Roman Li <roman.li(a)amd.com>
Cc: Alex Hung <alex.hung(a)amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai(a)amd.com>
Cc: Harry Wentland <harry.wentland(a)amd.com>
Cc: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam(a)amd.com>
Reviewed-by: Tom Chung <chiahsuan.chung(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Signed-off-by: Liu Chuang <liuchuang40(a)huawei.com>
---
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c
index c0372aa4ec83..684e30f9cf89 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c
@@ -571,6 +571,8 @@ bool cm_helper_translate_curve_to_degamma_hw_format(
i += increment) {
if (j == hw_points - 1)
break;
+ if (i >= TRANSFER_FUNC_POINTS)
+ return false;
rgb_resulted[j].red = output_tf->tf_pts.red[i];
rgb_resulted[j].green = output_tf->tf_pts.green[i];
rgb_resulted[j].blue = output_tf->tf_pts.blue[i];
--
2.34.1