]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/cxgb4: Add a sanity check in process_work()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 5 Dec 2017 14:36:54 +0000 (17:36 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 13 Dec 2017 18:00:13 +0000 (11:00 -0700)
commit8e48d009796135c49264482a2b071899d64ab30f
treea16216a98da32b58300b4162e912cd7cc8c946b0
parent72aafb17bb27f87084b55c593a495781d21f9a21
RDMA/cxgb4: Add a sanity check in process_work()

The story is that Smatch marks skb->data as untrusted so it generates
a warning message here:

    drivers/infiniband/hw/cxgb4/cm.c:4100 process_work()
    error: buffer overflow 'work_handlers' 241 <= 255

In other places which handle this such as t4_uld_rx_handler() there is
some checking to make sure that the function pointer is not NULL.  I
have added bounds checking and a check for NULL here as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/cxgb4/cm.c