Re: [RFC PATCH] mm/slab: Add size validation in kmalloc_array_* functions
From: Matthew Wilcox
Date: Mon Sep 22 2025 - 17:36:26 EST
On Mon, Sep 22, 2025 at 10:33:57PM +0530, I Viswanath wrote:
> This occurs when the size argument fits into a u32 but is too large
> to allocate, i.e., when it's between KMALLOC_MAX_SIZE + 1
> and UINT_MAX (both limits included)
Is it really a good idea to support 2^28 vclocks? Surely there's a
limit that makes sense to the PTP driver.
Beyond that, this should probably be using kvmalloc_array rather than
kcalloc_array().