From nobody Wed Jan 19 06:46:46 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 A80F91969BEC; Wed, 19 Jan 2022 06:46:46 +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 4Jdx524LJyz3NZR; Wed, 19 Jan 2022 06:46:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642574806; 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=1+YSmRtdaqvx9RPGYxDcOXVVtGutZ27YVdFAnp9ZYrQ=; b=dKQ5PUJWTRuOGk8J0jEsy5YVbDAko0s5Mb7nAJTreAVoVsjag+AI5gpLKWq6cGKun69Jzj wqlVs6uIVDXo9rWEBz0C7X1S6CWMPooWIDGY813/6owOLzkIn49KCQngYnTkpO/8pRXwyH Bo51gZn7zDSZ/yzSB1h3tgjlwjNef6n6CpX0p26qqftP6VVAD46czWBQlcDmK5rUJCftk1 SULu3aVOqjP6ex8a/fqkeN/ty+U7LaHDGkwtJ5gH90FDWfZ5ZfuQbYD1Dj+UoNic4yKRUT 2nJj/q3eligbHTVOSkxlzcwoTwSvKeKa8pLFLx3ueUFEQv+Fs2s+/2nBI+u93w== 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 707EC106C9; Wed, 19 Jan 2022 06:46:46 +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 20J6kkpq094828; Wed, 19 Jan 2022 06:46:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20J6kkFv094827; Wed, 19 Jan 2022 06:46:46 GMT (envelope-from git) Date: Wed, 19 Jan 2022 06:46:46 GMT Message-Id: <202201190646.20J6kkFv094827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 0ce7909cd0ba - main - vm_phys: add essential segment bounds check 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ce7909cd0ba35148bddd8309534cb96e9e20f48 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642574806; 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=1+YSmRtdaqvx9RPGYxDcOXVVtGutZ27YVdFAnp9ZYrQ=; b=KrV9U4ENfGN1lqBCPHTMcjbCJKFJobL5FvZbTqTnOQarJIezy2hzb/2W1OGdxbU1KMFU66 hdji9V57i+WJuLKbfcTFoHZqk/ZLkwPbg6SeqNpLo9Osg2Z01T6FB/iApuQQ3vPvmA9u1N 3I5ZjQM4BCpmGTPu00mtZm0sFyFEaGoDgNckrpzY5ViMcYSTQnJzO8aJJFjLwvfGd2DWYv Y3rQaADdivFu5/isljFmJCDaRv1M6iJDCTxbkpZXeK8LzKGkn3rvWRaws1nHH6cUL9GXPB H6pHabjGC3Zt6eQJUsdJPoM9bHDReiJDNpEhJfHzYP+8CxXBUNqG7DJ2uh0TRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642574806; a=rsa-sha256; cv=none; b=t30/KqHVH/BhmKd37QpKN3RY8CNQoD+Qt72VBIWmGgIreO8lcSeYFytSQDAD1UIhkO9iRA Z0tev0XG72OcPbg3jsd6CVkvcSAkpbCdUG8tyg+nTjRMIZV8pMfzj8pl3BslNn67VyYUep i46DBob/s7Lk8PPwFZcJ+oa3AHmJ8Ir0t8S8XXezh8uvfKn5DAuP5JPAF/sr1iWIDe4tqI bH85SI3u1tfMuWImKIlQia4KjEuqwNP8ll5JOL5RtRWcO4FBHX8KANDD6c+wNAE40NQZNG RPMkRUTJzQ8heK0Ljq/m/lLNCfQDg2zDbKfFGVVum9IAyBkA6JE2okRRy88nLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=0ce7909cd0ba35148bddd8309534cb96e9e20f48 commit 0ce7909cd0ba35148bddd8309534cb96e9e20f48 Author: Doug Moore AuthorDate: 2022-01-19 06:42:39 +0000 Commit: Doug Moore CommitDate: 2022-01-19 06:42:39 +0000 vm_phys: add essential segment bounds check A lower-bound segment check is necessary in vm_phys_alloc_seg_contig. Add one. Reported by: jenkins Reviewed by: alc Fixes: da92ecbc0d8f vm_phys: fix seg->end test in alloc_seg_contig MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33945 --- sys/vm/vm_phys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index a880b7abd324..7ca3f5fbc0c5 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -1451,7 +1451,8 @@ vm_phys_alloc_seg_contig(struct vm_phys_seg *seg, u_long npages, * (without overflow in pa_end calculation) * and fits within the segment. */ - if (pa_end < pa || pa_end > seg->end) + if (pa_end < pa || + pa < seg->start || seg->end < pa_end) continue; /*