]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xsigo: Fix crash in accessing xve proc l2 entries
authorPradeep Gopanapalli <pradeep.gopanapalli@oracle.com>
Mon, 28 Nov 2016 23:58:20 +0000 (23:58 +0000)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 20 Jan 2017 06:27:49 +0000 (22:27 -0800)
Orabug: 25165085

When accessing l2tables using /proc/driver/xve/devices/
system panics if path is created and there is no associated
Transmit QP. Added a check for validating tx structure before
using it.

Reported-by: Jie zhu <jie.x.zhu@oracle.com>
Signed-off-by: Pradeep Gopanapalli <pradeep.gopanapalli@oracle.com>
Reviewed-by: sajid zia <szia@oracle.com>
drivers/infiniband/ulp/xsigo/xscore/Makefile
drivers/infiniband/ulp/xsigo/xsvhba/Makefile
drivers/infiniband/ulp/xsigo/xsvnic/Makefile
drivers/infiniband/ulp/xsigo/xve/Makefile
drivers/infiniband/ulp/xsigo/xve/xve.h
drivers/infiniband/ulp/xsigo/xve/xve_stats.c

index 2a76c98dd60cd427e74cf4cec5bb413392c6b989..bc52ca6707392e96950544f12a403c9fb8a853ae 100644 (file)
@@ -2,7 +2,7 @@ obj-$(CONFIG_INFINIBAND_XSCORE) := xscore.o
 xscore-y := xscore_impl.o xs_ud.o xscore_api.o xsmp.o \
            xscore_stats.o xscore_uadm.o
 
-ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8040\"
+ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8041\"
 ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS
 ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE
 ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT
index 5505cc964e9ccac21375ada4b512b2e7f6e4ab1a..715c949f1554ab388d40dc595ab23123e48cf972 100644 (file)
@@ -3,7 +3,7 @@ xsvhba-y := vhba_main.o vhba_xsmp.o vhba_create.o vhba_init.o vhba_delete.o \
            vhba_attr.o vhba_wq.o vhba_proc.o vhba_stats.o vhba_ib.o        \
            vhba_scsi_intf.o vhba_align.o
 
-ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8040\"
+ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8041\"
 ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS
 ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE
 ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT
index c06a251987db67e077e6d5eda62c20eced7c4125..e59d925db6199728f017814ca83830e25ef30ce1 100644 (file)
@@ -1,7 +1,7 @@
 obj-$(CONFIG_INFINIBAND_XSVNIC) := xsvnic.o
 xsvnic-y := xsvnic_main.o xsvnic_stats.o
 
-ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8040\"
+ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8041\"
 ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS
 ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE
 ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT
index 9c3e03731ccf15112c0d9206db16e13dcddacbf8..57b401bc272958e0fc435189775e9396b01438fb 100644 (file)
@@ -2,7 +2,7 @@ obj-$(CONFIG_INFINIBAND_XVE) := xve.o
 xve-y := xve_main.o xve_verbs.o xve_multicast.o xve_ib.o xve_tables.o \
         xve_ethtool.o xve_cm.o xve_stats.o
 
-ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8040\"
+ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8041\"
 ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS
 ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE
 ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT
index fc4998276c9d0da3a4b4a845c6f8e7badc6d2318..baab637945280549f5112cc62864bd75b409d85b 100644 (file)
@@ -1089,6 +1089,14 @@ static inline int xve_cm_up(struct xve_path *path)
                return test_bit(XVE_FLAG_OPER_UP, &path->cm_ctx_tx->flags);
 }
 
+static inline char *xve_cm_txstate(struct xve_cm_ctx *tx)
+{
+       if (test_bit(XVE_FLAG_OPER_UP, &tx->flags))
+               return "Connected";
+       else
+               return "Not Connected";
+}
+
 static inline struct xve_cm_ctx *xve_get_cmctx(struct xve_path *path)
 {
        return path->cm_ctx_common;
index 537d253c9ae4586cfea645e769b095be7af744b2..791c219755b8324c351bd49be94b38c12694dbb8 100755 (executable)
@@ -322,7 +322,6 @@ static int xve_proc_l2_read_device(struct seq_file *m, void *data)
                k = 0;
                hlist_for_each_entry_safe(fwt_entry, n, head, hlist) {
                        if (xve_fwt_entry_valid(xve_fwt, fwt_entry) == true) {
-                               char *cmstr = "Not Connected";
                                u16 printed = 0;
                                struct xve_cm_ctx *tx = NULL, *rx = NULL;
 
@@ -337,9 +336,6 @@ static int xve_proc_l2_read_device(struct seq_file *m, void *data)
 
                                        tx = xve_cmtx_get(fwt_entry->path);
                                        rx = xve_cmrx_get(fwt_entry->path);
-                                       if (test_bit(XVE_FLAG_OPER_UP,
-                                                    &tx->flags))
-                                               cmstr = "Connected";
                                        if (rx)
                                                rx_rate = rx->stats.rx_rate;
                                        if (tx) {
@@ -354,7 +350,8 @@ static int xve_proc_l2_read_device(struct seq_file *m, void *data)
                                                           ALIGN_TO_FF(smac[3]),
                                                           ALIGN_TO_FF(smac[4]),
                                                           ALIGN_TO_FF(smac[5]),
-                                                          tmp_buf + 8, cmstr,
+                                                          tmp_buf + 8,
+                                                          xve_cm_txstate(tx),
                                                           tx->qp ? tx->qp->
                                                           qp_num : 0,
                                                           tx->version,