From nobody Fri Oct 07 14:04:41 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 4MkVRs5xd7z4dpxt; Fri, 7 Oct 2022 14:04:41 +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 4MkVRs4ZB3z3s07; Fri, 7 Oct 2022 14:04:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665151481; 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=oBQs+5Nbss1RJYV7UIqxZrZ2RDu1+jaWvoRWdtGn5jc=; b=Co7p7y+3qyJD4sT+mbNXE9zzREnb0Meus4TN4SQx7zpgSq+zffiLWx1WJvKzCqHH+z67ai RXAVLoskxYofM7TTdE/cvqTt9RJUX6FTJA3JK6RyuKMgK/Z8YF1bmBXG2xVMxA2ShdKJ2k CGlEe3gFW6D+gZaxdHsLw9Hn26E4Q24KIffsQJ8qOvuPi3YnFq8XTPkTm00gW+zgu4QOED /AutGqi1f6nsRG7W8WCrhhDOsBNYd/dm9kqzMAn0VW9mhk7rzce1xIjx58MVU55n0ksbUs uGMB/EUQqvJmo5nPccQ3/6y0CWZ0hC3Z7kCW9mi1cT6SxuMj53czi+rl1a/hzA== 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 4MkVRs3dBkzd1F; Fri, 7 Oct 2022 14:04:41 +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 297E4fDc047924; Fri, 7 Oct 2022 14:04:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 297E4fGb047923; Fri, 7 Oct 2022 14:04:41 GMT (envelope-from git) Date: Fri, 7 Oct 2022 14:04:41 GMT Message-Id: <202210071404.297E4fGb047923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 1b2ab11a4a18 - stable/12 - ssh-keysign: fix double free in error path 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1b2ab11a4a18401dcfab19618de6181c0510c0be Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665151481; 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=oBQs+5Nbss1RJYV7UIqxZrZ2RDu1+jaWvoRWdtGn5jc=; b=lTcIzNATLzVrgk1Lr0PYWKW5Ia1kxxLY/2e/UL23o/YlLCTU0P6fE2qpQAABvNY9yLgK+Y rTsYScHl0xK9rQmIVVKALyR2p5yH9xqAjUfKxCac81OcqbDYobpteCilVmGKq8C3/thSqo MgZmA/AmlJp9ZjexnW5Rybf0KUZb0GRmgpTYKlUSj6eGs+hffu5zkZI3tH877mXFUqqXYt pkaemL2gtgIrlXqKot7hqcZ4egQv05CZ1hCnXA56Mm2HPJhWfn1nhuHma2erClbXulscJy V2lGUt03aLQRUDZUvj9GL22/j+PKO8ShqnrjnHnZ5QXPfz2L5unprMivunjN6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665151481; a=rsa-sha256; cv=none; b=CD27M/boV9epIZgegXKfC6uR5wwcwtf/0sVf8JmdAj0JWPF4u3JE8LFSRIN4XcZGJritPz aq7Mo3rVLFTva7WjRmAmV6CYQnOpd5A+mmBgwoPY0NfYFAmW1c8w6dtzy5bblsNiFu7Hjk XRvw0J/HRnqrnbv/VWJBgibc1zxpgWKTKRNiPlROyvCOUsRjK1JelKj76F1HcMCM84yca3 8Tyzd5/jB2lq1TOzxyCC8hSuPinvASO0tzg+1AAD/2ZfuTFcTya9Gc9e6s4p+CEcOCR5xA zBjG/ZbD+lrGJxkJwqKE/HWTi6sKg9ZqniiqfKQ3U6+mP6suaucfQop9o1Whow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1b2ab11a4a18401dcfab19618de6181c0510c0be commit 1b2ab11a4a18401dcfab19618de6181c0510c0be Author: Ed Maste AuthorDate: 2022-10-04 20:34:15 +0000 Commit: Ed Maste CommitDate: 2022-10-07 13:22:10 +0000 ssh-keysign: fix double free in error path From OpenSSH-portable commit 141535b904b6, OpenBSD commit 3d21aa127b1f. MFC after: 3 days (cherry picked from commit 963c7b084b8bf2397deced4f568b976a42611910) (cherry picked from commit 6dca51b9f32dd3f6a0dd58a0f1525db3d27f485d) --- crypto/openssh/ssh-keysign.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/ssh-keysign.c b/crypto/openssh/ssh-keysign.c index c52321e220e7..b989f5e941ad 100644 --- a/crypto/openssh/ssh-keysign.c +++ b/crypto/openssh/ssh-keysign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keysign.c,v 1.70 2022/01/06 22:00:18 djm Exp $ */ +/* $OpenBSD: ssh-keysign.c,v 1.71 2022/08/01 11:09:26 djm Exp $ */ /* * Copyright (c) 2002 Markus Friedl. All rights reserved. * @@ -155,9 +155,7 @@ valid_request(struct passwd *pw, char *host, struct sshkey **ret, char **pkalgp, debug3_f("fail %d", fail); - if (fail) - sshkey_free(key); - else { + if (!fail) { if (ret != NULL) { *ret = key; key = NULL;