linux/drivers/ptp
Dan Carpenter 4b03da87d0 ptp: fix integer overflow in max_vclocks_store
[ Upstream commit 81d23d2a24 ]

On 32bit systems, the "4 * max" multiply can overflow.  Use kcalloc()
to do the allocation to prevent this.

Fixes: 44c494c8e3 ("ptp: track available ptp vclocks information")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Heng Qi <hengqi@linux.alibaba.com>
Link: https://lore.kernel.org/r/ee8110ed-6619-4bd7-9024-28c1f2ac24f4@moroto.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-05 09:14:31 +02:00
..
idt8a340_reg.h
Kconfig
Makefile
ptp_chardev.c ptp: Fix error message on failed pin verification 2024-07-05 09:14:07 +02:00
ptp_clock.c ptp: annotate data-race around q->head and q->tail 2023-11-28 16:56:23 +00:00
ptp_clockmatrix.c
ptp_clockmatrix.h
ptp_dte.c
ptp_idt82p33.c
ptp_idt82p33.h
ptp_ines.c
ptp_kvm_arm.c
ptp_kvm_common.c
ptp_kvm_x86.c
ptp_ocp.c
ptp_pch.c
ptp_private.h ptp: annotate data-race around q->head and q->tail 2023-11-28 16:56:23 +00:00
ptp_qoriq_debugfs.c
ptp_qoriq.c
ptp_sysfs.c ptp: fix integer overflow in max_vclocks_store 2024-07-05 09:14:31 +02:00
ptp_vclock.c
ptp_vmw.c