From nobody Wed Oct 19 17:24:20 2022 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 4MsyJh3s7Dz4gT24; Wed, 19 Oct 2022 17:24:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MsyJh3D65z3hTW; Wed, 19 Oct 2022 17:24:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666200260; 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=Jsu0j1oQpAnIznv3QUFxaXu3IfPyaotL7Y1nWaz//2k=; b=mwOxYLBxYyF2tCRkapiUBfCfTUWTRCCWNwAdZKi+euCIndJO9Vf1jo1GvI3+Y4binIfkig D7IlKAU/Npd5AjwTwHJhnutKqtDdspSDZr6pfN9ahs/0eMXUTnhI9jq4/Xb4wzLMumKM8Y 7CAxz6P2RxPYJdqY/m3bySAiglQ6JIWDxaGDZbfDXpeKct2tG+BmIOg5iBXG9m9EmF0Tut 1nl/okZkiE4Dh7S3GpRcz1c1sNymmhTUHSiWdjriJxx8sBP7Q6Y2FiMNDlFgC8iUQKyeam Awuqqi5wVTeK/lXH87iRiLH3sTCI4nsHV3SFs5jm0iqeFl/gGRyxBUXT2y76KQ== 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 4MsyJh2Kc4zbyg; Wed, 19 Oct 2022 17:24:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29JHOKn2073820; Wed, 19 Oct 2022 17:24:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29JHOKNK073819; Wed, 19 Oct 2022 17:24:20 GMT (envelope-from git) Date: Wed, 19 Oct 2022 17:24:20 GMT Message-Id: <202210191724.29JHOKNK073819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 33ce17883506 - main - vn_bmap_seekhole: check that passed offset is non-negative 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33ce1788350612f4143be6837b74f77e29329fd9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666200260; 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=Jsu0j1oQpAnIznv3QUFxaXu3IfPyaotL7Y1nWaz//2k=; b=RlHRntemPFVqtcjqbuEOUXIFO2uZn028BiRWBaV9KN3bQ1eRkDlOYy/NTaqhkn4Kvy/DKD wOnHrZLVhNEHTDWbrMWbHbiAZghLBXnkP58x8bbfydtaRUehoiuQbBT/vrtx/UZ68IsmxZ sZAE8lcSZjjIEPOBfyx0Qy5TLL7/Ka5WZnsAOkcolQ69fO3BY8nl6x0PSVaDjJeRprgVbR 1SSNr8bqGy4YBwjvvu32enT/VJacNfEbeFr3b1xLTY0vtG6wEHvjcKfRVsCy/72MRwd+px g5jRg5REaAKQ7ZUbvoteJUEJj7kqHbzrrzms9TcIL6C5NHpeOdH5Bu/gTUFY1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666200260; a=rsa-sha256; cv=none; b=HAbZ8XyFDkj7fJ+lik/NvVKo4Cldov46GJKaZXi2sXTTKOaK60W1Hqq7Afh1MXTI2nlVCg ltWai7NmPhXMg3SXvSFdVhxpfTlwE94aig9MhP2pY/pUEpgIaKxUoy7iaG7EBv6xCSX+g6 UkiZy+B/5O5sHgTKWZtN1lRpDX9HBJy7J/NS8An4NdRyyaeaLakHMfWr3j8vEM4LVyxDnT FzMtSYtBpOjYldgjkNsZtNzbA/+Xv7BA4+5ziPfhab7SVngNghf1F8VmSg4XsKTcLOdS1P CogUoYmKgrqm6C496IRLay0yOK0+cgcPWijSiRzHu0guoBM6phqBOeuoiK6pvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=33ce1788350612f4143be6837b74f77e29329fd9 commit 33ce1788350612f4143be6837b74f77e29329fd9 Author: Konstantin Belousov AuthorDate: 2022-10-17 15:29:38 +0000 Commit: Konstantin Belousov CommitDate: 2022-10-19 17:24:07 +0000 vn_bmap_seekhole: check that passed offset is non-negative Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D37024 --- sys/kern/vfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 1c7db3852776..8eaf23d91d4d 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2576,7 +2576,7 @@ vn_bmap_seekhole_locked(struct vnode *vp, u_long cmd, off_t *off, if (error != 0) goto out; noff = *off; - if (noff >= va.va_size) { + if (noff < 0 || noff >= va.va_size) { error = ENXIO; goto out; }