From nobody Mon Apr 08 19:04:29 2024 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 4VCz6Q27ZDz5HYlT; Mon, 8 Apr 2024 19:04: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VCz6P5xHBz4gHv; Mon, 8 Apr 2024 19:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603069; 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=08l9zkbuA6gioykNTlYafNkjXyQyzgTn+WOAXOoxrHA=; b=H/ggri8XUXfZcmK9btiNYlZPqN8C4Ymixd5xtAkAja2VE8XsyyIIoZOWiu9s0vV1MKDMxe 3hzLC4ztsFpfm1vfeDu2lcLqgbOptUMGpx6noDnHUS/4top0ftRZCaNSb3+NDNqrUpLAvt uE1St8hkEy7NRuD7K8cEnI5auJlCfRCzFWgoTVxGtn0Y6luf69UIfbHhA9ETcdsx7fyVw9 ooPxK3ghZR8D76hOTTDkAKK51hJvU+h0rg6KpiA2awMF3pyb/QRXGYyQg/bzpeVV9SjTlM lwHAT/uMBckP/LKlfrAphq3hTjK4yBN3AjNnIaEbRvtC18hBFLBMj6ylf9TowQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603069; a=rsa-sha256; cv=none; b=MLE13TJN4S119RJTWBbhBOa94eO7aRwl80dJta5ts4MwQNtJ5SQynY6OfM3mcnah0Nb12j ZL1+QC+qvElHbcsM1wD+WhyVtrxDffdh60du7kQlXApax6w17N2qfxpsZzMWDcJaHqZrp/ hMdPPx8t8A60mp5S2vuxDIuR2PNAY1nuqdSNxvFCryb8ij/oNttkYGpEejin18rpxw/PC6 axWtuVA5Ry1eB3NsYdFYhlBQQOxm4tGp0hDUW14Hvn7c4CwBMCUdCpNv2gULtMDK4Ey6xx XdPXI35uosrBXe+MbeefhqI4n2W+MrHYIWRRJbFQc+dvO71wMmfhL+3RboYPBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603069; 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=08l9zkbuA6gioykNTlYafNkjXyQyzgTn+WOAXOoxrHA=; b=hZwCxAqrbQUSxylgA6v5EuhNZaZpayuQ5lO8AeCh4URSRJuZxWNXe05Kro4gZzrQ+dSpN5 klpheCHMl6qahSsvmOCB+u9oZ7Wsr/M2mQgnyhu4LXKjADDChBkp/aZF5mggngBuni35s1 QqxsQd1I4/Ujhj7ZdgCM1ESlhIKLmhPHkfuYJvbQmVvcuF/KkSt/qE4s6Kg9L7Ka61H7xc Y5+c06y2uRKi8JjjWbpjEfUvEOVdiQXJiU9kFKp1KH9N+efWEl1C4M31hjxFXb36cZE0tp n+rmUjfH4kuvKoAjrq98l394E2gxVe2K4O2mB1qxMcH+VrXzlbBwnpL0RmkPlA== 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 4VCz6P5WRDzNSm; Mon, 8 Apr 2024 19:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 438J4T9O094295; Mon, 8 Apr 2024 19:04:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4T3h094292; Mon, 8 Apr 2024 19:04:29 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:29 GMT Message-Id: <202404081904.438J4T3h094292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7d763eadd36e - stable/14 - cam: Check if cam_simq_alloc fails for the xpt bus during module init 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7d763eadd36e9b9419379756add71f5383f40af0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7d763eadd36e9b9419379756add71f5383f40af0 commit 7d763eadd36e9b9419379756add71f5383f40af0 Author: John Baldwin AuthorDate: 2024-02-09 19:53:43 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:53:43 +0000 cam: Check if cam_simq_alloc fails for the xpt bus during module init This is very unlikely to fail (and if it does, CAM isn't going to work regardless), but fail with an error rather than a gauranteed panic via NULL pointer dereference. PR: 276770 Reported by: Qiushi (cherry picked from commit eb86c6c5b462c996e44c45ba496937b75ef22da3) --- sys/cam/cam_xpt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 6eac81c18160..3aa2f8a091a6 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -911,6 +911,8 @@ xpt_init(void *dummy) * perform other XPT functions. */ devq = cam_simq_alloc(16); + if (devq == NULL) + return (ENOMEM); xpt_sim = cam_sim_alloc(xptaction, xptpoll, "xpt",