From nobody Tue Aug 09 20:00:26 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 4M2P7b3dVNz3j8MT; Tue, 9 Aug 2022 20:00:27 +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 4M2P7b2bM9z3jm8; Tue, 9 Aug 2022 20:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660075227; 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=3EuUlIIZpgo6McjIZYyW1ioXG3SntxEkXDT5pLzuQt8=; b=F+9KJt3j2YX/hd+kv7M5oI/6uZogFCrOjFunJIZLP9mOiwsKXfytGB4v9xzUMLblm2xQ2j BwIHYS7KM0HOQUEJ+wUM6uE3FD37Wv6UfoFXhwfgaGnILnT6ho2zr7eMEJraVegs+MAcZQ ft6L9c7aIEIT7lym6Q7E04KMFAlwVzNLfmMqKhPLmOSecEB9R2uFXAbmpDD0LQh+0n03Iu moWdkHmxOACgvBFuKvB8Bk2BoafEfHv0on9Dwzvl+1HPzWOAbUq7ZvQPB+RLYIO13a87uw UUJbjRONBK8hDqzCD1Hu37DEpQjE7ea8cyn6Sp+84wnyYByuQ3i1aboi6qVNeA== 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 4M2P7b11stzkJh; Tue, 9 Aug 2022 20:00:27 +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 279K0Qpm030960; Tue, 9 Aug 2022 20:00:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 279K0Qnn030959; Tue, 9 Aug 2022 20:00:26 GMT (envelope-from git) Date: Tue, 9 Aug 2022 20:00:26 GMT Message-Id: <202208092000.279K0Qnn030959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5430423b6d63 - releng/13.0 - CAM: Keep periph_links when restoring CCB in camperiphdone(). 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 5430423b6d63b76548ed23efff5d33b7ebeefd05 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660075227; 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=3EuUlIIZpgo6McjIZYyW1ioXG3SntxEkXDT5pLzuQt8=; b=ByfjxRROTYmBrSeVXgQ83aIlY/ia4rWcrluV1SqXTbSRVDbKVn2C7zxAKllJuo0FB8gU9V HEFS8ybh1/E8OPJ4dMGBlPkCQo2FtR3+LOD0xWlrG1YLL9P31cXE8K0+7Jnsj1a3eM9M4l UiyWf+9SPojDAU99Y8G+e5SJt41e2JOWhineywtm2PevWXY7CyyjIidPnmCQuG2tQbeCgc 09fxkONK/Y+fRITo+MsPvqHtX3GHTmzBgFSbDVAmezfxS8+lf+NjcleLgg9stM55UZ2ZWc ho0mfvAwwhGgNrOT9CZ+15TZc3JZ4bstTGw2BTDT7Te6frb1fUr3hxIZkKtyeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660075227; a=rsa-sha256; cv=none; b=jdRyLetzxpUZBm69vnEP4SWB9xHOiL80AvowST/9ZAd0p+R9KKGKwwS7kzCn90XnzeFW5V gd9AT0gGSzPBgf9Tw7arp8ITSUd8/4NSR9TfDqrY0ooAFMiKnk+R0hn+qLs5t8Vc2Lo2ej FZwgc7Mkfmrp1dEyJPnyv2LYhWOh74GzQBhVW8VXogmjgRi4nv0Ff/SG7klOAXfuVdfFxp JaRcI4/37lrG5N4Xip1nCIngeSiD3bvGA4MS88Ag5DwoWrtlwGN2lMELTH99GnarFhJwDn IOcx3InOQVmtAdFmdOj6F2cHhnvfwk2z3/3ciYJl3UXNCsUI1/MzI21RPzEikw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5430423b6d63b76548ed23efff5d33b7ebeefd05 commit 5430423b6d63b76548ed23efff5d33b7ebeefd05 Author: Alexander Motin AuthorDate: 2022-04-28 01:39:50 +0000 Commit: Mark Johnston CommitDate: 2022-07-25 21:09:17 +0000 CAM: Keep periph_links when restoring CCB in camperiphdone(). While recovery command executed, some other commands from the periph may complete, that may affect periph_links of this CCB. So restoring original CCB we must keep current periph_links as more up to date. I've found this triggering assertions with debug kernel and suspect some memory corruptions otherwise when spun down disk receives two or sometimes more concurrent requests. Approved by: so Security: FreeBSD-EN-22:17.cam Sponsored by: iXsystems, Inc. (cherry picked from commit 404f001161b975164d8b52d9f404d07ac7584027) (cherry picked from commit 84849cfd1dc016917402511bc5a55d3d7317ce39) --- sys/cam/cam_periph.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 92f7c33cbc75..8c3956d641be 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1416,6 +1416,7 @@ camperiphdone(struct cam_periph *periph, union ccb *done_ccb) * and the result will be the final one returned to the CCB owher. */ saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; + saved_ccb->ccb_h.periph_links = done_ccb->ccb_h.periph_links; bcopy(saved_ccb, done_ccb, sizeof(*done_ccb)); xpt_free_ccb(saved_ccb); if (done_ccb->ccb_h.cbfcnp != camperiphdone)