From nobody Wed Oct 26 00:36:24 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 4MxqcS6B3Hz4gVbS; Wed, 26 Oct 2022 00:36:24 +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 4MxqcS5dbjz416r; Wed, 26 Oct 2022 00:36:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666744584; 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=2l9RyT6yBJ3bMdrCv1xnQenVnUfx9WYvFcHwYkIfyNg=; b=kZzW+azWPR9qOqBV+9ITdrnKk9gRcEGr5BXCwH9i/qu93fdop2AnCDgksPHDDiM3dtJqFG B+nRHmCD5aqhi/peOHWpSfMoUTcUzX1LCgqQupIZYUUiOUPi/eeR8Bnym3lrfwZYrM4GL+ jwtvSeMf/8RhvxgcBdxYl0IxCdTPS3nTdAWRqngRiDtKFT6b10QeweQnX/jxy+oAQKRW4h IorvLsGy1vu7K3Tfr7kTe812RTRkc+U9PWQhIcke/866suMJcX6bxPXLz4VIuYXvXwSPu7 TRcpQaB/R19+YDQb/IojdBdUThxjj14/DKKaXw8ALt0NKp9DOVu37zFj6CSKSQ== 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 4MxqcS4fP6zy5Q; Wed, 26 Oct 2022 00:36:24 +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 29Q0aO81015252; Wed, 26 Oct 2022 00:36:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29Q0aOcV015251; Wed, 26 Oct 2022 00:36:24 GMT (envelope-from git) Date: Wed, 26 Oct 2022 00:36:24 GMT Message-Id: <202210260036.29Q0aOcV015251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5019af2e8743 - stable/13 - uma: Never pass cache zones to memguard 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5019af2e87438bb51c8d345e496418841b680e88 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666744584; 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=2l9RyT6yBJ3bMdrCv1xnQenVnUfx9WYvFcHwYkIfyNg=; b=udVhHzGldyKH8cAS771nwdaJVE+HidTf1N8bw6/v7/LL7LPoPd4DZvlA6/tM6vxrORtHhH oBRKEIjGjHunTtG+s9yr7r531rsCLKaVxXxkFz/g9eR1dx/NIl77+Y9/FgmmmKHyFHhJTS nUovq7W03VUACkzAO9yDjZRkBexGN+TTKr74c9c6Kf2lofdNkQFbKi27lLsqeygmMLNcFb u/lv6YFRiTLaQv+LtUzUdlQyaDIkcluQrw/LCx0pbQiEKOzDRg/QJW4CfvGy3va0lfkbWn D8NPRJvO+8NLDxKHWcghPcZBziFVpe8P4g/m7wOQscInOBYqri/ZbgypuP2Gpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666744584; a=rsa-sha256; cv=none; b=PtaeZR2LZLPixipe0Cf7YKt4QUMIPZuCIcQnAe4ARKeKDEk4UHsBv6d6ewan07Kf54zZkl Ga9fP2yZuiOHMsc1aBxWUF8huJHV7TUNN6QF8psgavWoRvb2fAOJ/xlhCZCHbtEJdaRN6L yKChhYeQBvuU6jcBZKAFe+8kDJ3Vd1huAmJsJqQ6Hb5ievp9JcgJKGWn5ea8CRyO4HD+ie +VkF4vzypUMObbEEssD1OsKtgh/GgvU9ac6gzsG+Bro9Rh4maE6/9KeUSybn7GcJQTUIzG OfI/Ojv2QG6xCCzJGe30jZb6VeKY8N87xx7bq1yjTHOmxSiQjityNFkxroaG1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5019af2e87438bb51c8d345e496418841b680e88 commit 5019af2e87438bb51c8d345e496418841b680e88 Author: Mark Johnston AuthorDate: 2022-10-19 18:27:49 +0000 Commit: Mark Johnston CommitDate: 2022-10-26 00:35:31 +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 (cherry picked from commit 2dba2288aa364c36c756770ac77590816b15d954) --- 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 39946849d9ec..e78142294ac9 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -3471,7 +3471,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) { @@ -3506,7 +3507,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)