Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jun 2019 11:29:22 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 238659] ocs_fc: print instance_index value rather than pointer itself  in ocs_cam.c
Message-ID:  <bug-238659-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238659

            Bug ID: 238659
           Summary: ocs_fc: print instance_index value rather than pointer
                    itself  in ocs_cam.c
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: huangfq.daxian@gmail.com

Created attachment 205177
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D205177&action=
=3Dedit
The patch file

In function ocs_scsi_recv_tmf, print instance_index rather than
the pointer itself to avoid printing out kernel pointer to user space.

 sys/dev/ocs_fc/ocs_cam.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/ocs_fc/ocs_cam.c b/sys/dev/ocs_fc/ocs_cam.c
index 7efdc7a07ed..5de22d5f5f2 100644
--- a/sys/dev/ocs_fc/ocs_cam.c
+++ b/sys/dev/ocs_fc/ocs_cam.c
@@ -679,8 +679,8 @@ int32_t ocs_scsi_recv_tmf(ocs_io_t *tmfio, uint64_t lun,
ocs_scsi_tmf_cmd_e cmd,
                trsrc =3D &fcp->targ_rsrc_wildcard;
        }

-       device_printf(tmfio->ocs->dev, "%s: io=3D%p cmd=3D%#x LU=3D%lx en=
=3D%s\n",
-                       __func__, tmfio, cmd, (unsigned long)lun,
+       device_printf(tmfio->ocs->dev, "%s: io=3D%u(index) cmd=3D%#x LU=3D%=
lx
en=3D%s\n",
+                       __func__, tmfio->instance_index, cmd, (unsigned
long)lun,
                        trsrc ? (trsrc->enabled ? "T" : "F") : "X");
        if (trsrc) {
                inot =3D (struct ccb_immediate_notify
*)STAILQ_FIRST(&trsrc->inot);

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-238659-227>