From nobody Fri Apr 18 14:36:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZfHQY6K6Vz5stbV; Fri, 18 Apr 2025 14:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZfHQY3MVbz3Jll; Fri, 18 Apr 2025 14:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744987013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vkQMNb9bxij/S6xrmhzEe6XCY18EZMkR0kg5qz6KurY=; b=os3wuYA0jz7mzFbaICOKSg0eGvuK+6zCrpAR6iBfhZX5/Gl1K5pjGpHZv7ohDuW3T0QL2I v1DzoWN3fh/5x4IqbUyWZr0b45/l48BpXG0L6TSlOBPqEDBY70rznfNnyyUDCcFdjUsPss b6Tbwvbp7QTWwCR+/JUQ7HWxKxPBN5NZVr7ssYx7rb4Tdc0aLJgXcwWzkez7wsN4rt6Jn5 G4dBXx9YNEaRme/hxJeUbACh7h3ECHMciyX12YIVRPLhyyRfCXXYdmD6slgpwHaakzn0zL vB+sHH4teewK572DbZLEIGOpZElDVH2dJIxiZSuPnawjTLPQEueMGJRx51d/Iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744987013; a=rsa-sha256; cv=none; b=SYdeQyQ8DCeLqKgLgjf1rCYUIMKzdCzS+VGwmI7ppEVBNWN4pF2z/J59SHp/yX8CXLf4XG KYLCigIfQ6iIwtBFTzK1CZrK0Cwjmul2xTI4ecgBmpG5qlKbWQpPRTGOOIPDRm1h75n1JT 6YKDfhNJeFWCdDP5W86UW5DtSPrRd1tzabvR7bp7MJ1eiKq8wUqASxZE1ZytjhzZvzLkCx xim50HNu8eZBKBZg2uQ/8RyeAdfv1c79ErgydGhkFwk+Z0h1tiGyo3WAoGXCgFPNCfRM/c TeHdl/RHlRJruavia1IXCiUUnfl7k60ZxVLhX9LifF2HTPMTob588QYBfl28/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744987013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vkQMNb9bxij/S6xrmhzEe6XCY18EZMkR0kg5qz6KurY=; b=jnz96jCCW5x0GI37ZGSme4bieH8Rmf3Q9EjMq+oYN75Ap/VIdsgSLIRH1eDBKDAVAyfhDY Lxpe3TqyKDrcePkG7o3E9BVuR0kldM17Jo3MlFcGu8oQBjGGHc+ntKWtk88Zttstwyqov8 lzZpj4lPioagjhm3R4J3/vVwtUjnpUeINfM3GTKkNrsqMsjVZh0Z/KzJjBFiLoa69Df64n eCtOKhmJhN9ceAHLpL+NviW4wnv5bf9X7QJuLXedKGGeEgRCFz9WYHF2TYa9eqedCuk9VZ hlsumc6lFyShTaCCbnySH+KevGZKnNMGuQ01F1RBtsggRKywX5ubSsRCjQwj2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZfHQY2tBCzdxr; Fri, 18 Apr 2025 14:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53IEarLD091143; Fri, 18 Apr 2025 14:36:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53IEar4d091140; Fri, 18 Apr 2025 14:36:53 GMT (envelope-from git) Date: Fri, 18 Apr 2025 14:36:53 GMT Message-Id: <202504181436.53IEar4d091140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d684da076bbd - stable/14 - LinuxKPi: lkpi___kmalloc change a < into <= for proper boundry check List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d684da076bbd85dee7a942cbe5b71ec0c083dc35 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d684da076bbd85dee7a942cbe5b71ec0c083dc35 commit d684da076bbd85dee7a942cbe5b71ec0c083dc35 Author: Bjoern A. Zeeb AuthorDate: 2025-03-29 14:30:26 +0000 Commit: Bjoern A. Zeeb 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),