Re: [PATCH] sched_ext: reject oversized exit_dump_len
From: Sechang Lim
Date: Tue Nov 24 2026 - 11:11:28 EST
On Tue, Nov 24, 2026 at 04:05:29AM -1000, Tejun Heo wrote:
Hello, Sechang.
On Tue, Nov 24, 2026 at 10:05:03AM +0000, Sechang Lim wrote:
case offsetof(struct sched_ext_ops, exit_dump_len):
+ if (*(u32 *)(udata + moff) > INT_MAX)
+ return -E2BIG;
ops->exit_dump_len =
*(u32 *)(udata + moff) ?: SCX_EXIT_DUMP_DFL_LEN;
Maybe read the field once into a local and test that?
case offsetof(struct sched_ext_ops, exit_dump_len): {
u32 dump_len = *(u32 *)(udata + moff);
if (dump_len > INT_MAX)
return -E2BIG;
ops->exit_dump_len = dump_len ?: SCX_EXIT_DUMP_DFL_LEN;
return 1;
}
Sure, will do in v2.
Thanks,
Sechang