Page MenuHomeFreeBSD

linuxkpi: Add `krealloc_array()`
ClosedPublic

Authored by dumbbell on Oct 12 2022, 7:17 PM.
Tags
None
Referenced Files
F144966252: D36959.diff
Sat, Feb 14, 2:02 PM
F144927950: D36959.id112954.diff
Sat, Feb 14, 5:11 AM
F144927944: D36959.id112954.diff
Sat, Feb 14, 5:11 AM
Unknown Object (File)
Sun, Feb 8, 3:38 PM
Unknown Object (File)
Sat, Feb 7, 5:23 PM
Unknown Object (File)
Sat, Jan 31, 6:01 AM
Unknown Object (File)
Wed, Jan 28, 5:02 AM
Unknown Object (File)
Fri, Jan 16, 10:08 PM

Details

Summary

In FreeBSD, this is a wrapper on top of realloc().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 47807
Build 44694: arc lint + arc unit

Event Timeline

dumbbell added inline comments.
sys/compat/linuxkpi/common/include/linux/slab.h
184

In the original review (D36869), @hselasky said:

Are we missing any n * size overflow checks?

In a reply to his comment, I replied with the following questions:

What is the usual behavior to react to such overflow? Fail and return NULL? Panic?

If you know of an example in the kernel, could you please share it?

sys/compat/linuxkpi/common/include/linux/slab.h
184

Linux returns NULL on overflow.

Thank you @hselasky and @emaste! I updated the patch to check overflow.

This revision is now accepted and ready to land.Nov 5 2022, 5:19 PM
This revision was automatically updated to reflect the committed changes.