linux-stable/drivers/ptp
Dan Carpenter e1fccfb463 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-06-27 13:52:22 +02:00
..
Kconfig ptp: add FemtoClock3 Wireless as ptp hardware clock 2024-01-29 13:00:23 +00:00
Makefile ptp: add FemtoClock3 Wireless as ptp hardware clock 2024-01-29 13:00:23 +00:00
ptp_chardev.c ptp: Fix error message on failed pin verification 2024-06-21 14:40:07 +02:00
ptp_clock.c ptp: Move from simple ida to xarray 2024-03-11 16:03:15 -07:00
ptp_clockmatrix.c ptp: ptp_clockmatrix: Add .getmaxphase ptp_clock_info callback 2023-06-20 09:02:33 +01:00
ptp_clockmatrix.h ptp: ptp_clockmatrix: Add .getmaxphase ptp_clock_info callback 2023-06-20 09:02:33 +01:00
ptp_dfl_tod.c
ptp_dte.c
ptp_fc3.c ptp: fc3: Convert to platform remove callback returning void 2024-03-05 11:23:02 -08:00
ptp_fc3.h ptp: add FemtoClock3 Wireless as ptp hardware clock 2024-01-29 13:00:23 +00:00
ptp_idt82p33.c ptp: idt82p33: Add .getmaxphase ptp_clock_info callback 2023-06-20 09:02:33 +01:00
ptp_idt82p33.h ptp: idt82p33: Add .getmaxphase ptp_clock_info callback 2023-06-20 09:02:33 +01:00
ptp_ines.c net: Convert PHYs hwtstamp callback to use kernel_hwtstamp_config 2023-11-18 14:52:56 +00:00
ptp_kvm_arm.c treewide: Remove system_counterval_t.cs, which is never read 2024-02-07 17:05:21 +01:00
ptp_kvm_common.c treewide: Remove system_counterval_t.cs, which is never read 2024-02-07 17:05:21 +01:00
ptp_kvm_x86.c treewide: Remove system_counterval_t.cs, which is never read 2024-02-07 17:05:21 +01:00
ptp_mock.c net: ptp: create a mock-up PTP Hardware Clock driver 2023-08-09 15:59:21 -07:00
ptp_ocp.c ptp: ocp: fix DPLL functions 2024-05-30 09:44:35 +02:00
ptp_pch.c
ptp_private.h ptp: make ptp_class constant 2024-03-11 13:42:09 -07:00
ptp_qoriq.c ptp: Explicitly include correct DT includes 2023-07-18 11:27:49 +02:00
ptp_qoriq_debugfs.c
ptp_sysfs.c ptp: fix integer overflow in max_vclocks_store 2024-06-27 13:52:22 +02:00
ptp_vclock.c ptp: make ptp_class constant 2024-03-11 13:42:09 -07:00
ptp_vmw.c