From nobody Wed May 3 00:29:44 2023 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 4Q9yWX4RQcz48NSZ; Wed, 3 May 2023 00:29:44 +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 4Q9yWX41YDz3mYf; Wed, 3 May 2023 00:29:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073784; 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=QanEIgiWnMCpwZFxFFmgd05PMnp/JCF5WrWiyQsJ8dA=; b=Dpa7B35CcNiWGfCKdSS3rYST/26Sn7JLlaHQtfDb0IZtYMvLwAjQjcsYGFKq4FVfkdkhwt LNbB+s8twKhOdCyWatxjceoX5lhMiIdUGHAzmaIGJKeqEmjL4Y1/JGx2Bgs7rWIH0cj/0D 0km3iqGyqmoFcHyEPw0Actm4U8A7SNflUHQGf4mfWkL0NeC4ZMC84aGKUgfHi+A1KerBCx bu4L2zzK94i6yq+R77NjlnHIYbjrRPOqMZRggdkNqUmf4CkHpBJXMuCdx8aFeO/LBGtY/e UCiAiJfI+HoorJ49r1IfP7FQknxqefSt63B+m08PVCqX3gTsZjhlDhnwV9K+XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073784; 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=QanEIgiWnMCpwZFxFFmgd05PMnp/JCF5WrWiyQsJ8dA=; b=TS2SObuYVk9aqJaiuVcoKzHceEXfx+2zIr3vjXLPBU0SXeEqlQLCWjAvPHCHsOhivBLsVK aVKAl0fy08d8zxAnfpdDf3l64ExbqiG2014oAYot6ZzPTJuyBSGbe5Iw3EpcNwE09o4nI3 vOhUV4RDOFettw5FYvXpiEWPPvXOuUhgd6G6IgvfoHDD3hWJh6/U2lSED0BXurwWYhxJA5 MWBYVuskjl9UiVFyxSELfQuY9SjKOm4qe8vIR0EKRluaKy78lGxE6HV9mSQX33FSgCFvYg XShwfnuOgmhhkhp9USuInfS+F16Fj5qErLeZlMMTp7VnWwTkQX2QySQw17CrWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073784; a=rsa-sha256; cv=none; b=BDhDj4TycjYCBwFtE33HyoJxKMIF9gvm8jyZ6Z9wJIXbZlQnFXFRboVe6bPbSmyIonL48S IswTgBpx+2nmr36ejnWz1rYCvG1TLCWzKPTa5X25vbu2HyviU21VMGqdVSG47Yy/ycG/ek jsYpu5RADFblqR8tNN1Ds31HiSPXcWT5JEw5BXrDYJvLTVH+sTQoIOltAisjVZ+op/VC6N +ZX+iMLC1upjqAFqhdrVNkNzRxVSrqpUSv5yG1ImA+d6LkvFXB3YuwZ5j6HLsrGsh4haBH zsE9OgCYVEPkDUqjsmZ78K+WUoypHa9NRQpml+7Y4t7DD2ghfccK9h7S3Jvyow== 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 4Q9yWX2zV5z17Zn; Wed, 3 May 2023 00:29:44 +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 3430TiRt072087; Wed, 3 May 2023 00:29:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430Ti2e072086; Wed, 3 May 2023 00:29:44 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:44 GMT Message-Id: <202305030029.3430Ti2e072086@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: 256b5d40e550 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 256b5d40e5502323dddffd5a8db2ab431e9eea61 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=256b5d40e5502323dddffd5a8db2ab431e9eea61 commit 256b5d40e5502323dddffd5a8db2ab431e9eea61 Author: John Baldwin AuthorDate: 2022-12-21 18:45:26 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:12:37 +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 (cherry picked from commit 9f0c0e6eede6aedb60e12888fc9751c40b364dc9) --- 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 73c2ae2b0e2b..669147a89bcb 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -4012,6 +4012,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 "