From nobody Sat Feb 19 13:11:16 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 A320819DFCD3; Sat, 19 Feb 2022 13:11:16 +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 4K188N3lbdz4Vkw; Sat, 19 Feb 2022 13:11:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645276276; 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=FStQnAj7OUr0coxgLawIVqJQLxGoUJvwB9gI4sDMrFA=; b=DtwIjTTUgIZGCW74PsPhMUrcfK9mA1LajfRcCijiIfQ6KSDfxYLf1qfdl2KjFDLcP0uB79 wt4c15CFmLsXB+Hr7pEEYVIqXvkn7KxqpyF+3GbZ2OgkUcX5O0MLW9XKsZpfc7AF4L6lt1 ysLbiLuMFZhhTaHn9YtwvdhlYklWj6d+o8tBRzD8dODiQ8Bgn6/nj2F/o34nlwxCS4xPAk WKh9bD+w5P4du5nA07XR4zDMdu3mR6liSbrErDgJShl/Nps5rpIvhb5VhcnyS3eCLQkZ0j sFpKZ1L2Dw39h2vUF4dDyl4Ado3TiRnOcWmd2oONxPwSBOTI9y20NMrR2EzTDw== 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 586E417D5; Sat, 19 Feb 2022 13:11:16 +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 21JDBGbC075320; Sat, 19 Feb 2022 13:11:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21JDBGAe075319; Sat, 19 Feb 2022 13:11:16 GMT (envelope-from git) Date: Sat, 19 Feb 2022 13:11:16 GMT Message-Id: <202202191311.21JDBGAe075319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 91c35dd76508 - main - ipsec: extend vnet coverage in esp_input/output_cb 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: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91c35dd765087622cb0f2a03874bef18bc39d850 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645276276; 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=FStQnAj7OUr0coxgLawIVqJQLxGoUJvwB9gI4sDMrFA=; b=cUY0VYTMk3+RJzez33u4euzolyuA6j+cC84tmXkka4ZqhVV69C4sdzJOm1BzYCxylnWjpn ibtlJvIdWfkuAj5yZDbOq+5ASuQ8asFnrgiGbwCojmUXnNPdtE376tGCDzr/QcBrxMTazg rTNBUJ6gbZCFZViIBkCecHNSB3Cc1E6TKvbLCVOXSGK55fiCJQO1I+20NMras0Cz34DOXo Hd5YdGTP0ZGngsHK2NHAeUG6kjljYs5ZAxkNmaF8NjgHZmvs78IS/ao+Wljz9drY7ASJH9 oJ8wwo6n5QdDN8ygQi4C2qTgP1Ts1I5XDD0xmOZiBoYHnEwVaiVUfL2pBVRFqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645276276; a=rsa-sha256; cv=none; b=peSsgVFGcuAXnNqNvhWiAcWpiPpTTfQTgzobtpQawnKqMMM2T4X3OxRet9j40hnP4mUPZk 2BgH8SztpGPrqeg+UuzgnYCDuZlp49D8C2MILYj5/7NYg4g5OX1ttJuobh7sUfyevXRVGR L/RTp/io7QqtxBk4s93pGGyfX493PNHD9lJ0oAQAvPNZPTl2q6HTNck48gnKPdoJRhbQgi R9Q1+E/zjLqhd2NUgOAo6oR8XjEYF63kqT/IG043km1wOg1UA0iT4AETFkOlM4kRf02LZo dVjCZ1D134DM1aSsa9JfmJMlKEtdpi64ChbjR3iL1YTD1mqkWpGEAQ2E+9Pe4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=91c35dd765087622cb0f2a03874bef18bc39d850 commit 91c35dd765087622cb0f2a03874bef18bc39d850 Author: Mateusz Guzik AuthorDate: 2022-02-17 16:50:13 +0000 Commit: Mateusz Guzik CommitDate: 2022-02-19 13:10:21 +0000 ipsec: extend vnet coverage in esp_input/output_cb key_delsav used to conditionally dereference vnet, leading to panics as it was getting unset too early. While the particular condition was removed, it makes sense to handle all operations of the sort with correct vnet set so change it. Reviewed by: ae Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D34313 --- sys/netipsec/xform_esp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c index 7d489b69e9c2..ee363a7c911a 100644 --- a/sys/netipsec/xform_esp.c +++ b/sys/netipsec/xform_esp.c @@ -657,7 +657,6 @@ esp_input_cb(struct cryptop *crp) CURVNET_RESTORE(); return error; bad: - CURVNET_RESTORE(); if (sav != NULL) key_freesav(&sav); if (m != NULL) @@ -668,6 +667,7 @@ bad: free(crp->crp_aad, M_ESP); crypto_freereq(crp); } + CURVNET_RESTORE(); return error; } /* @@ -1043,12 +1043,12 @@ esp_output_cb(struct cryptop *crp) CURVNET_RESTORE(); return (error); bad: - CURVNET_RESTORE(); free(xd, M_ESP); free(crp->crp_aad, M_ESP); crypto_freereq(crp); key_freesav(&sav); key_freesp(&sp); + CURVNET_RESTORE(); return (error); }