]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ptp: Add a upper bound on max_vclocks
authorI Viswanath <viswanathiyyappan@gmail.com>
Thu, 25 Sep 2025 15:59:08 +0000 (21:29 +0530)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Sep 2025 22:30:31 +0000 (15:30 -0700)
commite9f35294e18da82162004a2f35976e7031aaf7f9
treefbd12a819645b30acf0b9912df4149c1b4b4e021
parent958baf5eaee394e5fd976979b0791a875f14a179
ptp: Add a upper bound on max_vclocks

syzbot reported WARNING in max_vclocks_store.

This occurs when the argument max is too large for kcalloc to handle.

Extend the guard to guard against values that are too large for
kcalloc

Reported-by: syzbot+94d20db923b9f51be0df@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=94d20db923b9f51be0df
Tested-by: syzbot+94d20db923b9f51be0df@syzkaller.appspotmail.com
Fixes: 73f37068d540 ("ptp: support ptp physical/virtual clocks conversion")
Signed-off-by: I Viswanath <viswanathiyyappan@gmail.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Link: https://patch.msgid.link/20250925155908.5034-1-viswanathiyyappan@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_private.h
drivers/ptp/ptp_sysfs.c