From nobody Sat Nov 9 17:35:31 2024 X-Original-To: bugs@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 4Xm2yX3399z5cRjV for ; Sat, 09 Nov 2024 17:35:32 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm2yX1wwGz4Ppn for ; Sat, 9 Nov 2024 17:35:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173732; 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: in-reply-to:in-reply-to:references:references; bh=HwT8RM/HnWE0fpxJQuPNefxYE0nkB+cFU3NxeGNQ0xw=; b=dGe14gT/88GlKGm7aCMnKXK8YNNvXQGnmSqDpTUhynY9OGTJa1uBJ0qhcVkWCO8PgEY+V4 yW3ywnpsUqIeCCKYsnajiwPWRa5zXlrsdfvYxghx7OUPq5Y2LLoFpGSPzf6aTsoO84QE3H jnVuVeQxqWhLes1jmOitq445ISd/t2vPpeTF3TSVOVx5nyFLHmCtlSnc5WbtbycTYCKFh3 8axVFFJafj/Dq9cS/kE+wo1jJGhene+eSxXcurx3OFddxbB0DoVAdElXfrBBE1iA4+Ewtx jqwrlmAaKD2WuMhFP9vP0HLaLHqKUTv4xzsytq7/y3d/G3PiME78x0/2opt5Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731173732; a=rsa-sha256; cv=none; b=iRTBiVjvLhYQwt8PypkcjopQOh+QcgqnipavRJXt8+wsYxy1yfgxLVcGcV9ZcuYTAno5+k bu4TG1giAW3YWHQ47IMGDGOsfiTLEsSnYVGu2sKOEoL+BoXVjim4IgeSx26LC9KlRlzz/D mSEd+g8chhpnmKuqAtF5mhnFGluMKstXbm7OyS7BiEOYKMsyzw+cveoPnYXJ3C6kbVHXaG a5D7PMbmUC1+gYXZ4XObH1YQs56tRB8OanmV6hbpbHDO481inQtFMlh10jg4WArpn3qw83 ffEHAsIm1ARTP2Ut8KcENoBo3eqyqkkjRvxU2ZsXaxXSKxTaSPVT6NlE1vbQ/A== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4Xm2yX1YCkz1MlH for ; Sat, 9 Nov 2024 17:35:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 4A9HZWtC047053 for ; Sat, 9 Nov 2024 17:35:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4A9HZWPO047052 for bugs@FreeBSD.org; Sat, 9 Nov 2024 17:35:32 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 276770] Some potential NULL-pointer dereferences Date: Sat, 09 Nov 2024 17:35:31 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276770 --- Comment #9 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Df08746a7e3195a6e144e6f58003dc5c22= 1d15d02 commit f08746a7e3195a6e144e6f58003dc5c221d15d02 Author: Mark Johnston AuthorDate: 2024-11-09 17:34:12 +0000 Commit: Mark Johnston CommitDate: 2024-11-09 17:34:12 +0000 nvme: Pass malloc flags to request allocation functions There are some contexts where it is safe to sleep, so we should pass M_WAITOK to ensure that a null pointer dereference can't happen. A few places allocate with M_NOWAIT but have no way to signal an error. Flag those with an XXX comment. PR: 276770 Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47307 sys/dev/nvme/nvme_ctrlr.c | 22 ++++++++++++++-------- sys/dev/nvme/nvme_ctrlr_cmd.c | 29 +++++++++++++++++++---------- sys/dev/nvme/nvme_ns_cmd.c | 24 +++++++++--------------- sys/dev/nvme/nvme_private.h | 26 +++++++++++++++----------- sys/dev/nvme/nvme_sim.c | 11 ++++++----- 5 files changed, 63 insertions(+), 49 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=