From nobody Tue Aug 9 19:58:52 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 4M2P5m4PFhz3j7bl; Tue, 9 Aug 2022 19:58:52 +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 4M2P5m3s77z3h93; Tue, 9 Aug 2022 19:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660075132; 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=uK7efS3A2m0ezaCcIpjfS/GjsRICgtwG1gR/+qMdBAg=; b=oL6RJ6LiR444nyFoJEO1VoR9pfjh9BlmApFwy4svYkDfocr7LnOa6ipi3e9F5Hsy7H14ei E9dT63cPEKnO6P2qb2J67X76mILb4QzVyJHS3DkiCcpRU9qtrAcxKFX81nGYyody11R4l5 CLOcx0pVQsCFsIkpGKt/zWOwPrCF20MzE7WSLlSs15vYrPHGbXE/YJ0oozQcZDVOkc7ELn RGudbCvDOzn3OXDx7uWE4+kpyQsv33Qi29X47YBeQEIsD0IF0f60bWtpx3WQ69S46Vk7ae PVfgtHELUmbpgT33pcZdbpu15sjU8LDklt9vDEZokQjbKNgTHvzsm/cjg4L8KA== 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 4M2P5m2wkKzkcl; Tue, 9 Aug 2022 19:58:52 +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 279Jwqk2021393; Tue, 9 Aug 2022 19:58:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 279JwqEk021392; Tue, 9 Aug 2022 19:58:52 GMT (envelope-from git) Date: Tue, 9 Aug 2022 19:58:52 GMT Message-Id: <202208091958.279JwqEk021392@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: cd7c996c4ed9 - releng/12.3 - 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/12.3 X-Git-Reftype: branch X-Git-Commit: cd7c996c4ed94c195e14e33e6173e91e5bbc6f29 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660075132; 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=uK7efS3A2m0ezaCcIpjfS/GjsRICgtwG1gR/+qMdBAg=; b=BI2QT63Nz4vy/6WF9rQFh/196TdUb8Ki/p37M52cNSXGv8JKxu/LtXhe422eXm/kcjOODo UUayr9GqzJsIwxSmCX3fsiIlE7jja307V2cAhj6D75AXisEkGJH5J6QOuBegZkfIWWPmVp c6llMg2/Yk9D3tqHb+DrT+DmU3bequ05tFFPmZDhDokWbmiQbT8MVVWu5YthngTbbTHZeW gl++dUlYbcv2SoanY6OzOnknRouV0oSh87vkLQCNmjAsxEiw4vSF7Gc7ez9M+WZPwCWuF/ JDdaxh8X3RtSbMaf7/YdjBx/RcKCwfFM15ABFolVJw6oA41DT9D7eAxbIT1P6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660075132; a=rsa-sha256; cv=none; b=qQ8SPHQZqMzFUX5Xs5g1SeACirjVYKzDSY8HW0+Ws/ya1DEs8fYJiWt8ctFCBh33x34JG7 H8zlaPj4PstfFBHt21AizxjynRbXHTqFLUDjB0V2Ayvb/vBTmYwrzS79U+GgmJsrMJZ/Vq 4QbKY03uocj8c4ov04YwA8t06vRPHT5QWOmlwrmlTgPlXP5KHybnImK0vEzo6oqhlsyws0 DJMCCYskjzVD79qUex5jSSsEzv9QhwHrat/Ht7cWXjKuKuv3TQMaWuR1N61p6joYGkcMmZ 8XNtgguuawc2yYt8RaQAku8QgeTh9hKerR3sdN1J6i7tSzAhQQFxvtXyalyROQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cd7c996c4ed94c195e14e33e6173e91e5bbc6f29 commit cd7c996c4ed94c195e14e33e6173e91e5bbc6f29 Author: Alexander Motin AuthorDate: 2022-04-28 01:39:50 +0000 Commit: Mark Johnston CommitDate: 2022-07-25 20:06:40 +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 MFC after: 1 week Sponsored by: iXsystems, Inc. (cherry picked from commit 404f001161b975164d8b52d9f404d07ac7584027) (cherry picked from commit 8dab6aba5f6ee635e4ff3f313d0209af718ea42f) --- 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 c53be6d61fa7..30423f4d72a0 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1440,6 +1440,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)