From nobody Tue Jan 27 17:38:29 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 4f0t170Ndzz6Q9Wn for ; Tue, 27 Jan 2026 17:38:35 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f0t166nXTz3VQP for ; Tue, 27 Jan 2026 17:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769535515; 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=6UD0cC8NDkHJrx7ml+aRw0tvhMPAPcLIkSh3pjjAkfw=; b=x/21GrDHeT3JHUw6uhsXugXyULjnDhCx5F2BGrjOrGRytVNG/WM8+AY8eTtA0vurxt1KF3 2x+Fwq+cb1XxXSPg0lV4c+NzO47uI/bJrJvK6TlJ2eq+3xmd8azjj+qEA/chZ2+JiV4L50 XccXUHveOwF0Q31k0GDafvGoUw3W5VnlEQCGye/HjnRaDVjMWErKcQoVzEdZKBd4D/9vkW hQewkQanHNgrgrgZT7Fd6cU+mUPbxLAIuGKIo5cLnhOScPtVFBOElVHxOJ+fcm2OGJ0y41 k6YiZcmFpa1Bg2qiEp3APIoednxxrPU8QYRa5tB+r67MTx64GM69T/4jnnHrsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769535515; 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=6UD0cC8NDkHJrx7ml+aRw0tvhMPAPcLIkSh3pjjAkfw=; b=MR+jnRPj9iaXzA5b6igEbTFwBMTQ23EWKua+il+QEuG3DpXE/UqY5w2tZ/8oTAc9ixoibv 6uox3FK/BfzN75iLpKuUiJsGMjrIIVwR2N58aKCLtVH2eLeVayz2GtGuFsiROnbByADZ4+ affBjVyfGsxtSUOhXnO+jqzra+IQzdowbJjPFkeGgisJEjr4yWmdGwtq4laea0Tm/2+y9d FHqEBH/M5rbYki9wZQE7dOs6u8zul9CNDYQ9WPU3yJ7lyuO2mpSjiHJpzV326gAIo6kShO VVCLJpm/tFdf8DTDJrjXBUNwSrGeDYWE3xsIGoFRh/6TnlLbHIrBzQCAfuuBZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769535515; a=rsa-sha256; cv=none; b=U7tnWFc4egpmx0dTtAGgv6LjzzeCOpGsUoV/ODAIkN+9yPJ/vj1vfHk07dhr5HIpZ3hipg HTlo1R7PHwcr20jEjHjuLW+w33/JT8ew3spKq12W2Fq4gIk5OsxKQyvI9pSJPKNzfzEJW6 kOzMkdEqB8hQFfvdnWLByRHUuQtyJtlpt72ggVkbnn5beAgUjhLUcaqi26ycbxCb9GhSBy 0BJKpj4hk4dcFf2+zXbxYNVvx54rAj1NbwVM9SzZW4orv68W/m5/nRX++wbEZp1NxunM0y 2tIeLekwdU++Y5H82XuIoF4qbbj+gTd/3ioJeCrw0ctoizdgA2eZ7kUn+oTkqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f0t1666Kmz269 for ; Tue, 27 Jan 2026 17:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8bf5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 27 Jan 2026 17:38:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d8a78048a246 - main - ipfw: don't recurse on the upper half lock in ipfw_iface_ref() 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8a78048a24662dc9310bfd4e4498d278fe00f0a Auto-Submitted: auto-generated Date: Tue, 27 Jan 2026 17:38:29 +0000 Message-Id: <6978f815.8bf5.6ae5b6b0@gitrepo.freebsd.org> The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d8a78048a24662dc9310bfd4e4498d278fe00f0a commit d8a78048a24662dc9310bfd4e4498d278fe00f0a Author: Gleb Smirnoff AuthorDate: 2026-01-27 17:30:13 +0000 Commit: Gleb Smirnoff CommitDate: 2026-01-27 17:38:20 +0000 ipfw: don't recurse on the upper half lock in ipfw_iface_ref() Fixes: e3caa360d5d0a73af0de1d293d5b8ff6e900ceb4 --- sys/netpfil/ipfw/ip_fw_iface.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_iface.c b/sys/netpfil/ipfw/ip_fw_iface.c index 7aa4a7bfbf7d..731587adef21 100644 --- a/sys/netpfil/ipfw/ip_fw_iface.c +++ b/sys/netpfil/ipfw/ip_fw_iface.c @@ -246,13 +246,13 @@ vnet_ipfw_iface_init(struct ip_fw_chain *ch) { struct namedobj_instance *ii; + IPFW_UH_WLOCK_ASSERT(ch); + ii = ipfw_objhash_create(DEFAULT_IFACES, DEFAULT_OBJHASH_SIZE); - IPFW_UH_WLOCK(ch); if (ch->ifcfg == NULL) { ch->ifcfg = ii; ii = NULL; } - IPFW_UH_WUNLOCK(ch); if (ii != NULL) { /* Already initialized. Free namehash. */ @@ -296,9 +296,7 @@ vnet_ipfw_iface_destroy(struct ip_fw_chain *ch) /* * Notify the subsystem that we are interested in tracking - * interface @name. This function has to be called without - * holding any locks to permit allocating the necessary states - * for proper interface tracking. + * interface @name. * * Returns 0 on success. */ @@ -309,11 +307,11 @@ ipfw_iface_ref(struct ip_fw_chain *ch, char *name, struct namedobj_instance *ii; struct ipfw_iface *iif, *tmp; + IPFW_UH_WLOCK_ASSERT(ch); + if (strlen(name) >= sizeof(iif->ifname)) return (EINVAL); - IPFW_UH_WLOCK(ch); - ii = CHAIN_TO_II(ch); if (ii == NULL) { /* @@ -329,7 +327,6 @@ ipfw_iface_ref(struct ip_fw_chain *ch, char *name, if (iif != NULL) { iif->no.refcnt++; ic->iface = iif; - IPFW_UH_WUNLOCK(ch); return (0); } @@ -352,7 +349,6 @@ ipfw_iface_ref(struct ip_fw_chain *ch, char *name, /* Interface has been created since unlock. Ref and return */ tmp->no.refcnt++; ic->iface = tmp; - IPFW_UH_WUNLOCK(ch); free(iif, M_IPFW); return (0); } @@ -364,8 +360,6 @@ ipfw_iface_ref(struct ip_fw_chain *ch, char *name, ipfw_objhash_add(ii, &iif->no); ic->iface = iif; - IPFW_UH_WUNLOCK(ch); - return (0); }