git: d684da076bbd - stable/14 - LinuxKPi: lkpi___kmalloc change a < into <= for proper boundry check
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 18 Apr 2025 14:36:53 UTC
The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d684da076bbd85dee7a942cbe5b71ec0c083dc35 commit d684da076bbd85dee7a942cbe5b71ec0c083dc35 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2025-03-29 14:30:26 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2025-04-18 14:35:57 +0000 LinuxKPi: lkpi___kmalloc change a < into <= for proper boundry check lkpi___kmalloc() would use contigmalloc if the requested size is exactly PAGE_SIZE. But we can still fullfill this request from malloc() without losing the guarantee of physical contiguous memory. Sponsored by: The FreeBSD Foundation Reported by: emaste (in D46656) Fixes: 19df0c5abcb9d Reviewed by: dumbbell, emaste Differential Revision: https://reviews.freebsd.org/D49570 (cherry picked from commit 19efc9e6320a30e230b0b40d5bae90142ec13aeb) --- sys/compat/linuxkpi/common/src/linux_slab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_slab.c b/sys/compat/linuxkpi/common/src/linux_slab.c index 5be4c1ec674c..bc780ab3f609 100644 --- a/sys/compat/linuxkpi/common/src/linux_slab.c +++ b/sys/compat/linuxkpi/common/src/linux_slab.c @@ -215,7 +215,7 @@ lkpi___kmalloc(size_t size, gfp_t flags) /* sizeof(struct llist_node) is used for kfree_async(). */ _s = MAX(size, sizeof(struct llist_node)); - if (_s < PAGE_SIZE) + if (_s <= PAGE_SIZE) return (malloc(_s, M_KMALLOC, linux_check_m_flags(flags))); else return (contigmalloc(_s, M_KMALLOC, linux_check_m_flags(flags),