From nobody Sun Jan 12 10:20:29 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 4YWBH13NQ8z5kQcj; Sun, 12 Jan 2025 10:20:29 +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 4YWBH12g2vz4LnB; Sun, 12 Jan 2025 10:20:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736677229; 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=FTrXUyQBSUomMi+7UJ4Qo4tUSQbCRuPGenUfUbF38Ek=; b=pcoCBHr5p3c2EpDZWBbPkoRITcXAG/rF0t9Yc3ubqpmLt903ZCoydI3ewoWnKCjeqb0KmU zZ/NNxdt4jZCsmMyaDgliQUjpBOiUNN6plasWW1tfncvNmUqKB9TT1TBy/uMUdUwrhexc2 HNSLoVcpq5uA6D/yHUvqozKZl9gl32TDview+/xM2ncjNww0U8d1CKUqN1nnIV0Xaz+V86 S7NSGE+RowPZPumtA8RS+DgN19j26FnP0PUcXTS4z9Pxtk0bjZCgPmBpoipKodyBa843nH Lc1GeZQ++AuVJPUEqx8r2W1HCtYQwQGbdpXgYRq96pIgLkAUH35s0y9wmlmbZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736677229; 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=FTrXUyQBSUomMi+7UJ4Qo4tUSQbCRuPGenUfUbF38Ek=; b=VVqNQ2HKCO4fG8QSRtB0jjP9knxrqGDFc57EsFpnXeG4wK40rUVjqzdlNAl6CxoKAi/Iao 66hBhmpbnSLoDcgIB7ZZd5dP4+2C/JJJB2a91UpWCaQqYiibuHmLFNw7zyAIw2iLjcR9Zc 3DQjxMAWzmITo1E3uA/Wyf9v0T4PkHp88+Z3yH4ujqXgZPRdoe6PREK2bqCbS7rgE9qddy 2byU5NbFURdxcZl+8xmWusWKZCM2C2h7Ye7clYlX5It7W0SxtZjPfJDt6vGgFBGPaSs62K Qx5sRtqR5Oj9Dp8WZyC7zeOLk+Yw7gSiR11xJdQhUe2ZDHVRRacQIk0imcp6Gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736677229; a=rsa-sha256; cv=none; b=QeVfcSg+wXyvhneds70u1eIXZoCebScwGtUAJW+S9u7epcigXr3OJhmDPmTeMr/HRJZID5 6kRSQZlkVmq53i8sViT7Go9XeCf5y2sUIhH7hr6+IF8oqtJsyJfo3a2M0zqMmjDlZNttAm xrcNb27fRBA7BkdZdKh822AjMs2iPRQORz+OAF/YzZ+QpD5164/A/BWwxtykuSw27urLt6 LoHCV2bbOuC2VY8eAYvo4pDKxfgQaw2FiqRldN8LfTKFeta0liyjy+NaUcN7sGFaSh7jZF jOHPglASHHSnRjmnZHich3TjCoDZ2aNRWYrXjA4qmXExEPTdUrpf+ahHxk2t2w== 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 4YWBH121X4zgV0; Sun, 12 Jan 2025 10:20:29 +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 50CAKTBl012630; Sun, 12 Jan 2025 10:20:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50CAKTET012627; Sun, 12 Jan 2025 10:20:29 GMT (envelope-from git) Date: Sun, 12 Jan 2025 10:20:29 GMT Message-Id: <202501121020.50CAKTET012627@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: 2e2c4e312ef1 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 2e2c4e312ef1adfc21f7f8264082b3027f7a1931 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2e2c4e312ef1adfc21f7f8264082b3027f7a1931 commit 2e2c4e312ef1adfc21f7f8264082b3027f7a1931 Author: Kristof Provost AuthorDate: 2025-01-05 16:09:08 +0000 Commit: Kristof Provost CommitDate: 2025-01-12 09:47:03 +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 0ba0876bfb1f..7cfe68730e7d 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -1739,6 +1739,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);