From nobody Wed Dec 21 18:49:39 2022 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 4NcjD35gYTz1Gkxd; Wed, 21 Dec 2022 18:49:39 +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 4NcjD359QNz45sp; Wed, 21 Dec 2022 18:49:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671648579; 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=1w1UxnCm60Ae9y6luTh9Gq5YnAwjSH7uxIy1Q6mWP9I=; b=lxnap1eEG5RKTcDHZD6XfZBjDEVmUSK1SdHqMU/YX4BoiYrtRKd05XMl0VlPu2mVXTt0U6 oWJhph8kGNx0cmmgQ7lTlgxJXtx/pqMA5sgBcI4zOY9jdtolSFVJll3CcrigFQeqDoSg5X BxsSPr0bR8gG+nmPayF0cn/rZc4QcJwYVsFCeQWuAgU4F4QLSE2/zpGrqGRV0yzuNIi/LA RSrVIEPJQsJtHz0LuZY/I0ccMVGhUAjXgpARCeCqgnU0ebk33Xa0EPqvnU5r2oAo0wY/7o w/nlvx+FwNYbyyRj3cfXcgbmjHKKPJuTBlZkdwolBuD82Rj1eyTgkgTY5EyLQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671648579; 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=1w1UxnCm60Ae9y6luTh9Gq5YnAwjSH7uxIy1Q6mWP9I=; b=ImllNmvAgGXr1eAlG/zPF7SCowJxITziEKi+2O2Tz+ouXvdx9crqpTP7DUyhKSZbhiYBjm BUNJygERz4eEC89JVIzmnv6DiPL3GHF6b9EwQc3EMOcahkUnzCsmSfP/3ipFouZSTafFtG ezJ49Kh0K6kX2njQckj9lABEzkOY5dhtj/1965dzjCdBsfzwhkQu/OYqVq9fvX7yQzpYHA xIsjHSDcD9vszPu3le02RFPMLFno2E/r8i467p6KSr5wC+VzCHjNAfezCxlqGomqEi9DwR YVkLUF8tMBLHufXh+NW/EbaK0ts3WqGsgrUFhMu+uyWm6jCtiBRJG3K1xAo//A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671648579; a=rsa-sha256; cv=none; b=MvDaPQabFqvUq3WdmN/zOTmyMgQekSMqFYj+TBvunWcSKm8WJa/Pa8UxisxS6Wl9bKelJQ vAh2yN+Vd6bjLRFMNPGArD/w1d9SjLu+nGDgwZBUKHjIb3KzIEs/40iV/TXyrLr0nn4VWW FMxNEVKbK0HgdXGDTW6SHDuOWgAgcbMC3Myg4zcblzpYUhRIEZEe/qcYbprozp0Q7s/dWk 0TgN/HH5iA5dCq65HcEZlC3PJuHvBmqnMHyKLD3XaWtu8cOVhwI5VwdxhbLKAhE5oUqyq2 u8ptXayn1XcfPQ59wRtr1VQiH0HVnR8cx+g26i5B7b+1vjZG1D4FsFHFLh+VXw== 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 4NcjD34DjdzQNy; Wed, 21 Dec 2022 18:49:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BLIndut084508; Wed, 21 Dec 2022 18:49:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BLIndLY084507; Wed, 21 Dec 2022 18:49:39 GMT (envelope-from git) Date: Wed, 21 Dec 2022 18:49:39 GMT Message-Id: <202212211849.2BLIndLY084507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9f0c0e6eede6 - main - mrsas: Don't leak a stack pointer value in the softc. 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/main X-Git-Reftype: branch X-Git-Commit: 9f0c0e6eede6aedb60e12888fc9751c40b364dc9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9f0c0e6eede6aedb60e12888fc9751c40b364dc9 commit 9f0c0e6eede6aedb60e12888fc9751c40b364dc9 Author: John Baldwin AuthorDate: 2022-12-21 18:45:26 +0000 Commit: John Baldwin CommitDate: 2022-12-21 18:45:26 +0000 mrsas: Don't leak a stack pointer value in the softc. mrsas_issue_blocked_cmd stores a pointer to an on-stack variable in its softc so that the driver can call wakeup() on the correct pointer. Once the loop around tsleep() has finished however, the pointer is no longer needed and any further use would be invalid. Clear sc->chan to NULL after the loop. Reported by: GCC -Wdangling-pointer Differential Revision: https://reviews.freebsd.org/D37628 --- sys/dev/mrsas/mrsas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index 6247cc2b142c..2f531bb44674 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -3980,6 +3980,7 @@ mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) } } } + sc->chan = NULL; if (cmd->cmd_status == 0xFF) { device_printf(sc->mrsas_dev, "DCMD timed out after %d "