From nobody Wed Apr 15 13:47:02 2026 X-Original-To: dev-commits-src-all@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 4fwjB42PT8z6ZtfL for ; Wed, 15 Apr 2026 13:47:08 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwjB375Vpz3mLy for ; Wed, 15 Apr 2026 13:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776260828; 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=cWlFT7Vuo74p54zN16KYUSkddWXWmakrBwfe6eIqsz4=; b=lnO1hxYCvTUOhmlAxLXhhOT7qgPMUEdyYeFYfYTOKgQE3vRcstVImxvb0UkC/OGMYciYkd zfiM5ZPBHPddvZMn0/J1RLMCWDaPD1udfCoBn+vY8TjIqLnQpc42cBewFkfjsF0FVJiKp2 dJ/2nROZ42w3HkxqhpKNA2pU96EJT3dLH8sgXnlQe9wmoec46czfo6dd1c/5FanmBU27AO 4zXzZi3oa8AW+DH0m3JhLPqYVW9MtR6+KJHgZGpr4QdrE+b2p8naHZmBiQT4QDIDZOQa81 wLFThNx7dRZnLHGGKGbgJ2p5k3I4HJ8L03F4+UuPrwqY4f1pANY/V+yun7ucIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776260828; a=rsa-sha256; cv=none; b=WWLJc84o/1Rg5/T0wih8ov+1NhnHHxXbeKUMOaocUTIVfydaKlJQDCWTIR7KYsw1W4qstk hFAHcW92BXkhBgByga7LnH09XTUPmUJwIIRXrmtWfN9Kv/KomL+IsTLOg5rbNugE09hFvD OHqHDqUuzTaS/RlkOFNArab5fg+QnlQwR3sUBn4l5CH3BVU9yWEHj/RluRqH8gA7aepaDl xmzZayWpPniffY550IyWNQKsl8xsYVaNvpPauWrg8mHQ50y0MwZpw/gqzdF6NsYN9oETqx 806f3m/+wG4/LETTkrFz/XUoXLgCJqCpbD5DfQwj/XJmnLPOCNHpncz5PO0Fbg== 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=1776260828; 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=cWlFT7Vuo74p54zN16KYUSkddWXWmakrBwfe6eIqsz4=; b=q5wtApp34ZifalubkaQEJAkFSp+tLc2AcxyZTWqdRie1w6X1Zjkk8Rx2RXpzJ/1RCh37cP YQ5Ak8UdpcmRQD+X7dZyZwFp/yILNafiLnmuoEsk0yfIvDnIeanoQIFanAwTxXuLeMTN4S Bv+jPzvbQlCdIIbhPBQvU7zu4EeK+TGARoAFNgEj4P2E70n0xB7jdwrBfSWNdWguej9zk+ c8LB4du5MjiMjSNwqttYHNRwe0qVhIt+xTlvGlCQmPY86AzegO+Q0e9Zh+ZULOpgGuRWZo Dg45d5rHSBy1ayL2NDhI0MMls+5op1bix8QYU/H7+32MvuJppZ0Ufm1icZrHrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwjB365kvz7g3 for ; Wed, 15 Apr 2026 13:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 432d6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 13:47:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 52d2fc702b85 - main - linuxkpi: Fix an off-by-one error in the kfifo implementation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52d2fc702b85d56b35f8828fe7efca3cde0d25b7 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 13:47:02 +0000 Message-Id: <69df96d6.432d6.17bbc698@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=52d2fc702b85d56b35f8828fe7efca3cde0d25b7 commit 52d2fc702b85d56b35f8828fe7efca3cde0d25b7 Author: Mark Johnston AuthorDate: 2026-04-15 13:33:04 +0000 Commit: Mark Johnston CommitDate: 2026-04-15 13:33:04 +0000 linuxkpi: Fix an off-by-one error in the kfifo implementation "total" is the number of slots in the array, so wraparound needs to be done when "first" or "last" is greater than or equal to the number of slots. Note that no consumers of the code are currently connected to the kernel build. Reported by: Stanislav Fort Reviewed by: bz, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56371 --- sys/compat/linuxkpi/common/include/linux/kfifo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kfifo.h b/sys/compat/linuxkpi/common/include/linux/kfifo.h index fbe16e22683e..b0d0c17f07e4 100644 --- a/sys/compat/linuxkpi/common/include/linux/kfifo.h +++ b/sys/compat/linuxkpi/common/include/linux/kfifo.h @@ -89,7 +89,7 @@ (_kf)->head[(_kf)->last] = (_e); \ (_kf)->count++; \ (_kf)->last++; \ - if ((_kf)->last > (_kf)->total) \ + if ((_kf)->last >= (_kf)->total) \ (_kf)->last = 0; \ _rc = true; \ } \ @@ -107,7 +107,7 @@ *(_e) = (_kf)->head[(_kf)->first]; \ (_kf)->count--; \ (_kf)->first++; \ - if ((_kf)->first > (_kf)->total) \ + if ((_kf)->first >= (_kf)->total) \ (_kf)->first = 0; \ _rc = true; \ } \