From nobody Wed Oct 19 18:37:45 2022 X-Original-To: dev-commits-src-main@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 4MszxP3ktXz4gd5y; Wed, 19 Oct 2022 18:37:45 +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 4MszxP3Bclz43qB; Wed, 19 Oct 2022 18:37:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666204665; 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=9GhQeGDTs0N6JmAOSIaNWunl1lCcT3IRG65lQbOLWOk=; b=ITgc+vrdMoCDY1rnLis3iGtzuuCJ3zCs0+7r74LktJNC/mVEaIre9+N0CQB6L+oMjn7tus Ewx+gshNf3ri8ikOeoLZ2/PgkvvwSc2GTHRoW0y+5y5XmkfMw8xoyJWhxeRJxkwylHV+hn uPOyzRZzybpIEESzXV7sDeMMdIw1giGxA5xHu3naGxsej4W42ldO7O52JXGS+1kUHrrl/L PyLLI/KsN2SD/Qbfw9voJUffpNzKcqOoclppX1Os8jZPx+q4RYy81UNrA9LS0IFckWRWk/ sdN2UEb3eej5yBPSZROgbzvMkfhmOKz4SKispDvmo/UVrP7ZXa0T6Wt/S7j5tw== 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 4MszxP1zpvzcgV; Wed, 19 Oct 2022 18:37:45 +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 29JIbjvl061555; Wed, 19 Oct 2022 18:37:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29JIbjvv061554; Wed, 19 Oct 2022 18:37:45 GMT (envelope-from git) Date: Wed, 19 Oct 2022 18:37:45 GMT Message-Id: <202210191837.29JIbjvv061554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2dba2288aa36 - main - uma: Never pass cache zones to memguard List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 2dba2288aa364c36c756770ac77590816b15d954 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666204665; 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=9GhQeGDTs0N6JmAOSIaNWunl1lCcT3IRG65lQbOLWOk=; b=nJXwNm2f0VsJCnirddmvSpkZsHx4xZ7yVEi076zgc9LY4PQyQeODqbmnDlmcs20ZMA4/us KkTH/axP7wWBfLx2betmYFUnKN5p0x0dbhTsDAUiEbXbyhYGy+DkkSeVg5clT6RLjxOPK7 nJGP3G23SkmcEaHk/caOTBF3uevxpfmcdrqMT1M09EOypupp+mUdrAo+fpiSYNphpaaMPP iVkFk3SnroPDprQ5XjcVjnW8H4znlvGKwaGFExgH3LYal+OA8NAtzAwBbVNx4RKcDEZWda lNmIqnxIIQSKjS3o5Hgvw3kr7weJ4DUeMm59Yo0qs4ZaztGTajIpx80UpfjJUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666204665; a=rsa-sha256; cv=none; b=KGnPleAjm0Q0NHrTrYbyNKg9SMTIcnVzjLCMboHR6N6XoWptmtrB3y+dMEjuTDNxwLUBWO cIFVlJ23O9Q2p0VJHbt6/X38cQdekhfTX3+SQ4R+k3sHPDo4WJxuWg2lWpmNHGvePEJdlZ Tf0Znk1Vt6gu2dQhhQ3fQnQIsm6rdDqWGs3M+pRAVJVr6EANlbPgpnSemb10jMyDTWM78s HE3D4Cf7+s92LyI4YdrlRKvWZo7QKz8k8iIOaG2LWenMerSCCDIcPH/xIw+hm5tNHJ3g8A zstRoqDz7Oc8moCECb3roS+O8LGDZSAtKuANnKolHrgGCNBYvj0Lkv6JZFNJ2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2dba2288aa364c36c756770ac77590816b15d954 commit 2dba2288aa364c36c756770ac77590816b15d954 Author: Mark Johnston AuthorDate: 2022-10-19 18:27:49 +0000 Commit: Mark Johnston CommitDate: 2022-10-19 18:36:36 +0000 uma: Never pass cache zones to memguard Items allocated from cache zones cannot usefully be protected by memguard. PR: 267151 Reported and tested by: pho MFC after: 1 week --- sys/vm/uma_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index daa14cc3e3b3..ae34d8bf0997 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -3561,7 +3561,8 @@ uma_zalloc_debug(uma_zone_t zone, void **itemp, void *udata, int flags) #endif #ifdef DEBUG_MEMGUARD - if ((zone->uz_flags & UMA_ZONE_SMR) == 0 && memguard_cmp_zone(zone)) { + if ((zone->uz_flags & (UMA_ZONE_SMR | UMA_ZFLAG_CACHE)) == 0 && + memguard_cmp_zone(zone)) { void *item; item = memguard_alloc(zone->uz_size, flags); if (item != NULL) { @@ -3596,7 +3597,8 @@ uma_zfree_debug(uma_zone_t zone, void *item, void *udata) ("uma_zfree_debug: called with spinlock or critical section held")); #ifdef DEBUG_MEMGUARD - if ((zone->uz_flags & UMA_ZONE_SMR) == 0 && is_memguard_addr(item)) { + if ((zone->uz_flags & (UMA_ZONE_SMR | UMA_ZFLAG_CACHE)) == 0 && + is_memguard_addr(item)) { if (zone->uz_dtor != NULL) zone->uz_dtor(item, zone->uz_size, udata); if (zone->uz_fini != NULL)