Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

Pull rdma fixes from Jason Gunthorpe:
"More fixes from testing done on the rc kernel, including more SELinux
testing. Looking forward, lockdep found regression today in ipoib
which is still being fixed.

Summary:

- Fix for SELinux on the umad SMI path. Some old hardware does not
fill the PKey properly exposing another bug in the newer SELinux
code.

- Check the input port as we can exceed array bounds from this user
supplied value

- Users are unable to use the hash field support as they want due to
incorrect checks on the field restrictions, correct that so the
feature works as intended

- User triggerable oops in the NETLINK_RDMA handler

- cxgb4 driver fix for a bad interaction with CQ flushing in iser
caused by patches in this merge window, and bad CQ flushing during
normal close.

- Unbalanced memalloc_noio in ipoib in an error path"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
IB/ipoib: Restore MM behavior in case of tx_ring allocation failure
iw_cxgb4: only insert drain cqes if wq is flushed
iw_cxgb4: only clear the ARMED bit if a notification is needed
RDMA/netlink: Fix general protection fault
IB/mlx4: Fix RSS hash fields restrictions
IB/core: Don't enforce PKey security on SMI MADs
IB/core: Bound check alternate path port number

+56 -19
+1 -1
drivers/infiniband/core/cma.c
··· 4458 4458 return skb->len; 4459 4459 } 4460 4460 4461 - static const struct rdma_nl_cbs cma_cb_table[] = { 4461 + static const struct rdma_nl_cbs cma_cb_table[RDMA_NL_RDMA_CM_NUM_OPS] = { 4462 4462 [RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats}, 4463 4463 }; 4464 4464
+1 -1
drivers/infiniband/core/device.c
··· 1146 1146 } 1147 1147 EXPORT_SYMBOL(ib_get_net_dev_by_params); 1148 1148 1149 - static const struct rdma_nl_cbs ibnl_ls_cb_table[] = { 1149 + static const struct rdma_nl_cbs ibnl_ls_cb_table[RDMA_NL_LS_NUM_OPS] = { 1150 1150 [RDMA_NL_LS_OP_RESOLVE] = { 1151 1151 .doit = ib_nl_handle_resolve_resp, 1152 1152 .flags = RDMA_NL_ADMIN_PERM,
+1 -1
drivers/infiniband/core/iwcm.c
··· 80 80 } 81 81 EXPORT_SYMBOL(iwcm_reject_msg); 82 82 83 - static struct rdma_nl_cbs iwcm_nl_cb_table[] = { 83 + static struct rdma_nl_cbs iwcm_nl_cb_table[RDMA_NL_IWPM_NUM_OPS] = { 84 84 [RDMA_NL_IWPM_REG_PID] = {.dump = iwpm_register_pid_cb}, 85 85 [RDMA_NL_IWPM_ADD_MAPPING] = {.dump = iwpm_add_mapping_cb}, 86 86 [RDMA_NL_IWPM_QUERY_MAPPING] = {.dump = iwpm_add_and_query_mapping_cb},
+1 -1
drivers/infiniband/core/nldev.c
··· 303 303 return skb->len; 304 304 } 305 305 306 - static const struct rdma_nl_cbs nldev_cb_table[] = { 306 + static const struct rdma_nl_cbs nldev_cb_table[RDMA_NLDEV_NUM_OPS] = { 307 307 [RDMA_NLDEV_CMD_GET] = { 308 308 .doit = nldev_get_doit, 309 309 .dump = nldev_get_dumpit,
+5 -2
drivers/infiniband/core/security.c
··· 739 739 if (!rdma_protocol_ib(map->agent.device, map->agent.port_num)) 740 740 return 0; 741 741 742 - if (map->agent.qp->qp_type == IB_QPT_SMI && !map->agent.smp_allowed) 743 - return -EACCES; 742 + if (map->agent.qp->qp_type == IB_QPT_SMI) { 743 + if (!map->agent.smp_allowed) 744 + return -EACCES; 745 + return 0; 746 + } 744 747 745 748 return ib_security_pkey_access(map->agent.device, 746 749 map->agent.port_num,
+6
drivers/infiniband/core/uverbs_cmd.c
··· 1971 1971 goto release_qp; 1972 1972 } 1973 1973 1974 + if ((cmd->base.attr_mask & IB_QP_ALT_PATH) && 1975 + !rdma_is_port_valid(qp->device, cmd->base.alt_port_num)) { 1976 + ret = -EINVAL; 1977 + goto release_qp; 1978 + } 1979 + 1974 1980 attr->qp_state = cmd->base.qp_state; 1975 1981 attr->cur_qp_state = cmd->base.cur_qp_state; 1976 1982 attr->path_mtu = cmd->base.path_mtu;
+5
drivers/infiniband/hw/cxgb4/cq.c
··· 395 395 396 396 static int cqe_completes_wr(struct t4_cqe *cqe, struct t4_wq *wq) 397 397 { 398 + if (CQE_OPCODE(cqe) == C4IW_DRAIN_OPCODE) { 399 + WARN_ONCE(1, "Unexpected DRAIN CQE qp id %u!\n", wq->sq.qid); 400 + return 0; 401 + } 402 + 398 403 if (CQE_OPCODE(cqe) == FW_RI_TERMINATE) 399 404 return 0; 400 405
+16 -6
drivers/infiniband/hw/cxgb4/qp.c
··· 868 868 869 869 qhp = to_c4iw_qp(ibqp); 870 870 spin_lock_irqsave(&qhp->lock, flag); 871 - if (t4_wq_in_error(&qhp->wq)) { 871 + 872 + /* 873 + * If the qp has been flushed, then just insert a special 874 + * drain cqe. 875 + */ 876 + if (qhp->wq.flushed) { 872 877 spin_unlock_irqrestore(&qhp->lock, flag); 873 878 complete_sq_drain_wr(qhp, wr); 874 879 return err; ··· 1016 1011 1017 1012 qhp = to_c4iw_qp(ibqp); 1018 1013 spin_lock_irqsave(&qhp->lock, flag); 1019 - if (t4_wq_in_error(&qhp->wq)) { 1014 + 1015 + /* 1016 + * If the qp has been flushed, then just insert a special 1017 + * drain cqe. 1018 + */ 1019 + if (qhp->wq.flushed) { 1020 1020 spin_unlock_irqrestore(&qhp->lock, flag); 1021 1021 complete_rq_drain_wr(qhp, wr); 1022 1022 return err; ··· 1295 1285 spin_unlock_irqrestore(&rchp->lock, flag); 1296 1286 1297 1287 if (schp == rchp) { 1298 - if (t4_clear_cq_armed(&rchp->cq) && 1299 - (rq_flushed || sq_flushed)) { 1288 + if ((rq_flushed || sq_flushed) && 1289 + t4_clear_cq_armed(&rchp->cq)) { 1300 1290 spin_lock_irqsave(&rchp->comp_handler_lock, flag); 1301 1291 (*rchp->ibcq.comp_handler)(&rchp->ibcq, 1302 1292 rchp->ibcq.cq_context); 1303 1293 spin_unlock_irqrestore(&rchp->comp_handler_lock, flag); 1304 1294 } 1305 1295 } else { 1306 - if (t4_clear_cq_armed(&rchp->cq) && rq_flushed) { 1296 + if (rq_flushed && t4_clear_cq_armed(&rchp->cq)) { 1307 1297 spin_lock_irqsave(&rchp->comp_handler_lock, flag); 1308 1298 (*rchp->ibcq.comp_handler)(&rchp->ibcq, 1309 1299 rchp->ibcq.cq_context); 1310 1300 spin_unlock_irqrestore(&rchp->comp_handler_lock, flag); 1311 1301 } 1312 - if (t4_clear_cq_armed(&schp->cq) && sq_flushed) { 1302 + if (sq_flushed && t4_clear_cq_armed(&schp->cq)) { 1313 1303 spin_lock_irqsave(&schp->comp_handler_lock, flag); 1314 1304 (*schp->ibcq.comp_handler)(&schp->ibcq, 1315 1305 schp->ibcq.cq_context);
+19 -7
drivers/infiniband/hw/mlx4/qp.c
··· 666 666 return (-EOPNOTSUPP); 667 667 } 668 668 669 + if (ucmd->rx_hash_fields_mask & ~(MLX4_IB_RX_HASH_SRC_IPV4 | 670 + MLX4_IB_RX_HASH_DST_IPV4 | 671 + MLX4_IB_RX_HASH_SRC_IPV6 | 672 + MLX4_IB_RX_HASH_DST_IPV6 | 673 + MLX4_IB_RX_HASH_SRC_PORT_TCP | 674 + MLX4_IB_RX_HASH_DST_PORT_TCP | 675 + MLX4_IB_RX_HASH_SRC_PORT_UDP | 676 + MLX4_IB_RX_HASH_DST_PORT_UDP)) { 677 + pr_debug("RX Hash fields_mask has unsupported mask (0x%llx)\n", 678 + ucmd->rx_hash_fields_mask); 679 + return (-EOPNOTSUPP); 680 + } 681 + 669 682 if ((ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_SRC_IPV4) && 670 683 (ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_DST_IPV4)) { 671 684 rss_ctx->flags = MLX4_RSS_IPV4; ··· 704 691 return (-EOPNOTSUPP); 705 692 } 706 693 707 - if (rss_ctx->flags & MLX4_RSS_IPV4) { 694 + if (rss_ctx->flags & MLX4_RSS_IPV4) 708 695 rss_ctx->flags |= MLX4_RSS_UDP_IPV4; 709 - } else if (rss_ctx->flags & MLX4_RSS_IPV6) { 696 + if (rss_ctx->flags & MLX4_RSS_IPV6) 710 697 rss_ctx->flags |= MLX4_RSS_UDP_IPV6; 711 - } else { 698 + if (!(rss_ctx->flags & (MLX4_RSS_IPV6 | MLX4_RSS_IPV4))) { 712 699 pr_debug("RX Hash fields_mask is not supported - UDP must be set with IPv4 or IPv6\n"); 713 700 return (-EOPNOTSUPP); 714 701 } ··· 720 707 721 708 if ((ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_SRC_PORT_TCP) && 722 709 (ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_DST_PORT_TCP)) { 723 - if (rss_ctx->flags & MLX4_RSS_IPV4) { 710 + if (rss_ctx->flags & MLX4_RSS_IPV4) 724 711 rss_ctx->flags |= MLX4_RSS_TCP_IPV4; 725 - } else if (rss_ctx->flags & MLX4_RSS_IPV6) { 712 + if (rss_ctx->flags & MLX4_RSS_IPV6) 726 713 rss_ctx->flags |= MLX4_RSS_TCP_IPV6; 727 - } else { 714 + if (!(rss_ctx->flags & (MLX4_RSS_IPV6 | MLX4_RSS_IPV4))) { 728 715 pr_debug("RX Hash fields_mask is not supported - TCP must be set with IPv4 or IPv6\n"); 729 716 return (-EOPNOTSUPP); 730 717 } 731 - 732 718 } else if ((ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_SRC_PORT_TCP) || 733 719 (ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_DST_PORT_TCP)) { 734 720 pr_debug("RX Hash fields_mask is not supported - both TCP SRC and DST must be set\n");
+1
drivers/infiniband/ulp/ipoib/ipoib_cm.c
··· 1145 1145 noio_flag = memalloc_noio_save(); 1146 1146 p->tx_ring = vzalloc(ipoib_sendq_size * sizeof(*p->tx_ring)); 1147 1147 if (!p->tx_ring) { 1148 + memalloc_noio_restore(noio_flag); 1148 1149 ret = -ENOMEM; 1149 1150 goto err_tx; 1150 1151 }