From nobody Sun Jan 05 18:21:02 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 4YR5Gk5hKFz5k419; Sun, 05 Jan 2025 18:21:02 +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 4YR5Gk4Ktcz4J7L; Sun, 5 Jan 2025 18:21:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736101262; 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=JTx5YzkXGf6OcOuXQeBeBLXP+nrmSG5DF4R8Oo/S7nk=; b=qrFQ35PuyIVX9KgQyYbhheDUCop7SjIo2EuePTynDY/eHfTnLVKXcQrQH8ayjfjhhYSVta dyha3+IQeCtc+/jrnhBYLmwhwn6VnouWwHmyRko8E+K1xfPiLM0AKFuuZZyVuazciN6sXJ cFybaIsCV6yIfxURTMyZYxg/5LANA4nVLzHOiLxsgc0ez1XyN1qwL+CkpWvk6aj1NnjdMx DGiDttbfak/pv3vzlw+AcxYBWRG2+t602UfZIsvFxgmtVt4oOsIpFMFruQPSrNnBiCXyvh LI6PXOb2l7rXsESmZhnmcwyptIUy2734FiBa+I2W72obDsiDuLz5+V8M/eWVVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736101262; 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=JTx5YzkXGf6OcOuXQeBeBLXP+nrmSG5DF4R8Oo/S7nk=; b=DrWTE1b6bF9UMeX2KARM5krJOtBs2BaWwPq65fas+XsDZ6H3js8oVv0j65yQra/dR9W4D4 A5ILi7CxuFcyNVqCKSYDs03ciDJBZ5o+Ij5C6yi/f9ZP/4a06gTNrKqK7eQF0uWWUpwRzk icIApI1UTQuFKOMuzMi+DPhxQ1BnbQf4t6zm7aXDYPKi51PvdrndI+up9S4ciw1exrJ+tA NBYkcv3XTrWgFqe8C9GHQ69RU+ZRPLedCXfiFKdllbftZKu0nZ5XN2FGXwux9AnuPIC/jZ PSW/P2DVxjt7Z6LWC86Q7TDSmBtt0/jc/lg1uEZyR+dxOecckH6pxoW2gSKDEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736101262; a=rsa-sha256; cv=none; b=sZqiwnIwfmC3zrcSSMeJGHyEQuA9pmtsLV2FkQuCg87iM0R9rwZAmhkXKG2pMGnRoBQ6XB SkLG2MOJn1Anne17M8GPIvgqXMkfHlM/mLZ8ozHPH0GUQy7Iejq7VvhmiGsSLbHIWubSgX kDZGaeH9froUe7S18XlypDjUQyjh3tFcm+k/uGy3hmnRwZalJUP7KMjsg5s0UMF8WVmD1C bTxZ7a1RjPRiDvSSUcrB7GFXmyNUn9j6nGYtyisk1GIuAjHmmmv7nit+jUNphKUkSmlmZH hlZZ2sGP4jVcifX+GuU7DDHhRYlemMM/ok5Yrel1WoLhtukCMxCHNEOgTwz06g== 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 4YR5Gk3xv0zpqc; Sun, 05 Jan 2025 18:21:02 +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 505IL2KE044056; Sun, 5 Jan 2025 18:21:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 505IL2EN044053; Sun, 5 Jan 2025 18:21:02 GMT (envelope-from git) Date: Sun, 5 Jan 2025 18:21:02 GMT Message-Id: <202501051821.505IL2EN044053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 50c1e179b584 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 50c1e179b584f43ba82e9afc91b25ec4831b58ef Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=50c1e179b584f43ba82e9afc91b25ec4831b58ef commit 50c1e179b584f43ba82e9afc91b25ec4831b58ef Author: Kristof Provost AuthorDate: 2025-01-05 16:09:08 +0000 Commit: Kristof Provost CommitDate: 2025-01-05 17:19:56 +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 --- 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 c4a820f41bc3..a9294c324cb4 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);