From nobody Tue Aug 09 20:00:24 2022 X-Original-To: dev-commits-src-branches@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 4M2P7X6zPtz3j8Cp; Tue, 9 Aug 2022 20:00: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 4M2P7X6Slwz3jlQ; Tue, 9 Aug 2022 20:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660075224; 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=W/pI0hoVD1e4jnsQqwFzFtV+uNQny9+sNU0XsJCtkwk=; b=O7AKpR4Zc2V4h5q/aEiMLqiyCERcnAY0kJGlDIWWiHdASh8oE4aQHBRnoE0CVEj4c7Pjq/ MQCuz5H+G2bWcg0+25xui6g6VOoWuRSEGsSWEDBRSoHNCorgbIuNz2hKdUqJhPxaqyEuqf me/S/4eoQBXI0nb+uUH34B9ZafmvaQWcRzJsG++IVhwDIFku8aLyF7X+83+ePOfAEu+bj4 Gf7f1koklOjUSnDF6itNrafSy30Hb6r2lBNwMb7qPNWLlRfFPRMZxxkjtpXYEwUBmUM0MJ zRqpp6t2wa8wNKix2yxpMwwB6z3gj2+33hjsNu+oDR65dkfMWj4Gj2T9lC1agA== 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 4M2P7X5Wt2zkjD; Tue, 9 Aug 2022 20:00: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 279K0OJq030910; Tue, 9 Aug 2022 20:00:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 279K0O6f030909; Tue, 9 Aug 2022 20:00:24 GMT (envelope-from git) Date: Tue, 9 Aug 2022 20:00:24 GMT Message-Id: <202208092000.279K0O6f030909@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: c864c8cf08a9 - releng/13.0 - aio_aqueue(): avoid ucred leak on failure path List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: c864c8cf08a9dc197612d5ffffd239aa72de7c97 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660075224; 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=W/pI0hoVD1e4jnsQqwFzFtV+uNQny9+sNU0XsJCtkwk=; b=rTzs0YmOOcULKgvw137WFd5bBY8OVVbd2pQ7U7h4K6VmPrFciRBIGGAv/7z6rA3Rgzfw2L THEbZLdBfaXKOFOxHqNGGxep1dTuR2D+H361JrLTLNRWFx9slo+2EKKtJY5pasH8xs2AeE b1OlYXK9zlPlEBWKlqu9/zxfzMR/DaLb2SQQuG4qopajwGnYGXYZUGzY98B+yii06DFcuw epYX1cYh2qYmNr1JWTUcncJexgMJaGuUuUkbxhVyZxl+sJyALSfavNcRiDx5RDKpE97RGf Svv0L2BMv+oyigvUTux7wrqo7GGF6pfg4nqCiHY9KY4R2Ddy2YoBLNr2YQQ/bQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660075224; a=rsa-sha256; cv=none; b=IW95oPRBmoryORu/hEcSXynzu7suFBIfNFuciVQ8DWHkrUrEFuP8xolK+t0K+IEEed1W4/ To++VdIqssNgrMEDDCpEMohkBYOu5gRJbGucNZZA4fiSAPyWizkZTwPho4tT9p4hDVgwZZ tKtuHGg3ClX7/Zy3SduF45wHwCGpzkqzI3nDry7BhklauySqUF+EAsqrjVtDp9fYjnU+Im qTxAu+XqdIFF8p6B9fyoSAwhnrx11SqKLzZb1pz2rRdyaipIlNjFksSzbl+Wt4KvHV65bU KDeL8H5KJ37DnnSP1sc8mTcO+vH2c4rCHJtD8f7drR448eAEEuVKkf+P2J4jZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c864c8cf08a9dc197612d5ffffd239aa72de7c97 commit c864c8cf08a9dc197612d5ffffd239aa72de7c97 Author: Konstantin Belousov AuthorDate: 2021-09-24 00:14:56 +0000 Commit: Mark Johnston CommitDate: 2022-07-25 20:01:25 +0000 aio_aqueue(): avoid ucred leak on failure path Approved by: so Security: FreeBSD-SA-22:10.aio PR: 258698 (cherry picked from commit 45c2c7c484de7747014492b17ff89e323ee66496) (cherry picked from commit 9499d3c1e40dfeb1f63f61af7cdf25ee27f9a2ec) --- sys/kern/vfs_aio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 9b45a06c5f9f..80b7c3ac94e9 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1698,7 +1698,7 @@ no_kqueue: else error = fo_aio_queue(fp, job); if (error) - goto err3; + goto err4; AIO_LOCK(ki); job->jobflags &= ~KAIOCB_QUEUEING; @@ -1719,6 +1719,8 @@ no_kqueue: AIO_UNLOCK(ki); return (0); +err4: + crfree(job->cred); err3: if (fp) fdrop(fp, td);