From nobody Sun Jan 12 10:20:30 2025 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 4YWBH23mXQz5kPtS; Sun, 12 Jan 2025 10:20:30 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWBH23Cm7z4LnD; Sun, 12 Jan 2025 10:20:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736677230; 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=UrUNP7yk3jOp1B1CMwlcAGC0TWHvRZBLDKG0mPnRsLg=; b=hgemcLPcatHUKOS4oAjkvODxJpBTg0lyQ2R3/we2PoRqheDs7A+VnO0XpzVFE7phfR0C0Z t40Nd6NB1rKdrwAR/v7vSvsQiwGYqiyJJLC33QWKCulaT2OlM8xs6VOOv5xdhcdncp11U3 Uqm6xjXZ+HRHjjAIB4De9UMhT1wMxn552rBI/4H/0A8fLPbJBc98lRdoowmiL1XWzCN2s8 xZwknuKI9OYASTfYqOzzrKXLRhdXd9vix0qTYfOACyzHjxrVppbpfTKqi2lqfuVxFyWqq7 zc9OHt1vwszAVWKvaiLwtawW0ou6FUn/EzHzP3WXKLXKoVqGiXNQTnLgFj2sTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736677230; 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=UrUNP7yk3jOp1B1CMwlcAGC0TWHvRZBLDKG0mPnRsLg=; b=iWymzRc/h3XoklqquXD3FOhd5MKyeajXK/D6f0Posq7J+kMJCaRey84c0YaxxbUno5YC98 ibKAirLUn+cgTcKW1W0Y5TRzKM+3aL8zL7FvQWb51YV6f8TuVpazQV8DJABcqUSabnwD00 tBknvqmb+Yxc2qPftyjwTl28Zw5Ugc/VYETBNyMzsdc+GWN+hyBSxVoiROYrQpZuixJUkv OMdZn5CQlO3YO+Bg+0B6ZjjY4gFcvLERDJgHJOpjD38/GA49yN4kxErYrr7Vj6t8lrLmO5 /xMU4OWVT3dHgHM3GygStHYIkurPRu+gl/P9adroElyMRUm5T7y/nvrDHDEa2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736677230; a=rsa-sha256; cv=none; b=SrcZXM8fIzU2x2avWZm9Yz7WP9ugvhrZ6GOBEhYQxGo07IgSlhG6b1xmK48m9cprKaC9ns y73guTvWywXOA21dppqbvxoWb5qi4TcrcytThhouyywo4NTcmLr8HiJtmdEe3vrQHYlbVi pibWn9RHny2ejSZfTke/FS/w4zuNKu+EXGz94fcwJ9G5PWoBq6XHXJdFpFRrD91snzCqsF BAsRRNlwOQcU5wa1JPsGeOxkprSrXd9Ukb6qJrmX6bbVr+n3qcubQI2Xc/1cv+e3g5PWOI 8ZD88yL48WksXhXSAOl5oqnn1/SydcEsmCbKsC56tcvol7vethrAVRVMyR3rQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YWBH22mSxzgxn; Sun, 12 Jan 2025 10:20:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50CAKUnn012766; Sun, 12 Jan 2025 10:20:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50CAKU81012763; Sun, 12 Jan 2025 10:20:30 GMT (envelope-from git) Date: Sun, 12 Jan 2025 10:20:30 GMT Message-Id: <202501121020.50CAKU81012763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: dfd9c9bc3f86 - stable/13 - umtx: handle allocation failire in umtx_pi_alloc() 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dfd9c9bc3f8627a15443f9bfc068a7eade2d688c Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dfd9c9bc3f8627a15443f9bfc068a7eade2d688c commit dfd9c9bc3f8627a15443f9bfc068a7eade2d688c Author: Kristof Provost AuthorDate: 2025-01-05 16:09:08 +0000 Commit: Kristof Provost CommitDate: 2025-01-12 09:46:31 +0000 umtx: handle allocation failire in umtx_pi_alloc() Don't assume that this allocation will succeed. We may have been passed M_NOWAIT. The calling code already handles allocation failures, but the function itself did not. PR: 283807 MFC after: 1 week (cherry picked from commit 50c1e179b584f43ba82e9afc91b25ec4831b58ef) --- sys/kern/kern_umtx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 61b86d0b62b1..5929a355f4a6 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -1740,6 +1740,9 @@ umtx_pi_alloc(int flags) struct umtx_pi *pi; pi = uma_zalloc(umtx_pi_zone, M_ZERO | flags); + if (pi == NULL) + return (NULL); + TAILQ_INIT(&pi->pi_blocked); atomic_add_int(&umtx_pi_allocated, 1); return (pi);