Re: [PATCH v4 2/2] slab: Introduce kmalloc_obj() and family

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ Sorry, on mobile now, so html crud and no lists ]

On Sat, Mar 15, 2025, 08:56 Kees Cook <kees@xxxxxxxxxx> wrote:

What about making the redundant information the type/var itself instead
of just the size info of the existing API? For example:

        ptr = kmalloc_obj(ptr, GFP_KERNEL);


Yes, using "sizeof" and "typeof" on that first argument (for the malloc and then the final cast, respectively) sounds like a fine interface, and it's still obviously visually an assignment.

I think we already have some interfaces like this, I have no objections to that pattern. 

         Linus

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux