linux/drivers/infiniband/sw/rxe
Thomas Bogendoerfer 3192c53e5a IB/rxe: don't crash, if allocation of crc algorithm failed
Following crash happens, if crc algorithm couldn't be allocated:

[ 1087.989072] rdma_rxe: loaded
[ 1097.855397] PCLMULQDQ-NI instructions are not detected.
[ 1097.901220] rdma_rxe: failed to allocate crc algorithmi err:-2
[ 1097.901248] BUG: unable to handle kernel
[ 1097.901249] NULL pointer dereference
[ 1097.901250]  at 0000000000000046
[...]

Reason is that rxe->tfm is assigned the error return, which will then
be used for crypto_free_shash() in rxe_cleanup. Fix by using a
temporary variable and assigning it rxe->tfm after allocation succeeded.

Fixes: cee2688e3c ("IB/rxe: Offload CRC calculation when possible")
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Acked-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-11-10 13:43:50 -05:00
..
Kconfig IB/rxe: Offload CRC calculation when possible 2017-04-21 10:45:02 -04:00
Makefile IB/rxe: Add port protocol stats 2017-04-21 10:43:28 -04:00
rxe_av.c IB/rxe: Remove unneeded check 2017-08-18 14:01:10 -04:00
rxe_comp.c IB/rxe: Convert timers to use timer_setup() 2017-10-25 15:24:49 -04:00
rxe_cq.c IB/rxe: Disable completion upcalls when a CQ is destroyed 2017-08-28 19:12:32 -04:00
rxe_hdr.h IB/rxe: Enable type checking on SKB_TO_PKT() and PKT_TO_SKB() arguments 2017-01-10 16:52:47 -05:00
rxe_hw_counters.c IB/rxe: Make rxe_counter_name static 2017-08-24 16:44:48 -04:00
rxe_hw_counters.h IB/rxe: Add port protocol stats 2017-04-21 10:43:28 -04:00
rxe_icrc.c IB/rxe: Offload CRC calculation when possible 2017-04-21 10:45:02 -04:00
rxe_loc.h IB/rxe: Convert timers to use timer_setup() 2017-10-25 15:24:49 -04:00
rxe_mcast.c IB/rxe: Remove a pointless indirection layer 2017-01-10 16:52:47 -05:00
rxe_mmap.c IB/rxe: Constify static rxe_vm_ops 2017-07-24 08:43:12 -04:00
rxe_mr.c IB/rxe: Avoid ICRC errors by copying into the skb first 2017-08-28 19:12:36 -04:00
rxe_net.c IB/rxe: Handle NETDEV_CHANGE events 2017-08-28 19:12:36 -04:00
rxe_net.h IB/rxe: improved debug prints & code cleanup 2016-10-06 13:50:04 -04:00
rxe_opcode.c
rxe_opcode.h
rxe_param.h rxe: expose num_possible_cpus() cnum_comp_vectors 2017-05-04 19:33:02 -04:00
rxe_pool.c IB/rxe: put the pool on allocation failure 2017-10-09 12:10:41 -04:00
rxe_pool.h IB/rxe: Let the compiler check the type of the cleanup functions 2017-01-10 16:52:47 -05:00
rxe_qp.c IB/rxe: Convert timers to use timer_setup() 2017-10-25 15:24:49 -04:00
rxe_queue.c IB/rxe: Clear queue buffer when modifying QP to reset 2016-11-16 20:03:44 -05:00
rxe_queue.h IB/rxe: Clear queue buffer when modifying QP to reset 2016-11-16 20:03:44 -05:00
rxe_recv.c IB/rxe: Offload CRC calculation when possible 2017-04-21 10:45:02 -04:00
rxe_req.c IB/rxe: Convert timers to use timer_setup() 2017-10-25 15:24:49 -04:00
rxe_resp.c IB/rxe: Fix up the responder's find_resources() function 2017-08-28 19:12:33 -04:00
rxe_srq.c IB/rxe: Remove unneeded cast in rxe_srq_from_attr() 2016-12-12 16:31:45 -05:00
rxe_sysfs.c IB/rxe: improved debug prints & code cleanup 2016-10-06 13:50:04 -04:00
rxe_task.c RDMA/rxe: Suppress gcc 7 fall-through complaints 2017-10-14 20:47:07 -04:00
rxe_task.h IB/rxe: Wait for tasklets to finish before tearing down QP 2016-12-12 16:31:45 -05:00
rxe_verbs.c IB/rxe: don't crash, if allocation of crc algorithm failed 2017-11-10 13:43:50 -05:00
rxe_verbs.h IB/rxe: Fix destination cache for IPv6 2017-08-28 19:12:33 -04:00
rxe.c RDMA: Remove useless MODULE_VERSION 2017-07-24 08:45:11 -04:00
rxe.h IB/rxe: Use "foo *bar" instead of "foo * bar" 2017-07-24 08:43:12 -04:00