[roce-0111]sync mainline kernel 5.5rc6 roce patchset into ubuntu HWE kernel branch

Bug #1859269 reported by Fred Kimmy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kunpeng920
Fix Released
Undecided
Unassigned
Ubuntu-18.04-hwe
Fix Released
Undecided
Ike Panhc
Ubuntu-20.04
Fix Released
Undecided
Ike Panhc
Upstream-kernel
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Undecided
Ike Panhc

Bug Description

[Bug Description]
roce patchset have merged into mainline 5.5rc6 kernel. Pls backport ubuntu 18.04.5 kernel version
[Steps to Reproduce]
  1)
  2)
  3)

[Actual Results]

[Expected Results]

[Reproducibility]

[Additional information]
  (Firmware version, kernel version, affected hardware, etc. if required):

[Resolution]
RDMA/hns: Delete unnecessary callback functions for cq
RDMA/hns: Rename the functions used inside creating cq
RDMA/hns: Redefine the member of hns_roce_cq struct
RDMA/hns: Redefine interfaces used in creating cq
IB/umem: remove the dmasync argument to ib_umem_get
RDMA/hns: Modify appropriate printings
RDMA/hns: Fix non-standard error codes
RDMA/hns: Modify hns_roce_hw_v2_get_cfg to simplify the code
RDMA/hns: Simplify doorbell initialization code
RDMA/hns: Replace not intuitive function/macro names
RDMA/hns: Modify fields of struct hns_roce_srq
RDMA/hns: Delete unnecessary uar from hns_roce_cq
RDMA/hns: Remove unnecessary structure hns_roce_sqp
RDMA/hns: Delete unnecessary variable max_post
RDMA/hns: Remove unsupported modify_port callback
RDMA: Connect between the mmap entry and the umap_priv structure
RDMA/hns: Fix build error again
RDMA/hns: Fix memory leak on 'context' on error return path
RDMA/hns: Bugfix for qpc/cqc timer configuration
RDMA/hns: Fix to support 64K page for srq
RDMA/hns: Delete BITS_PER_BYTE redefinition
RDMA/hns: Prevent undefined behavior in hns_roce_set_user_sq_size()
RDMA/hns: Release qp resources when failed to destroy qp
RDMA/hns: Fix a spelling mistake in a macro
RDMA/hns: Modify return value of restrack functions
RDMA/hns: Modify variable/field name from vlan to vlan_id
RDMA/hns: Fix wrong parameters when initial mtt of srq->idx_que
RDMA/hns: remove a redundant le16_to_cpu
RDMA/hns: Prevent memory leaks of eq->buf_list
RDMA/hns: Correct the value of srq_desc_size
RDMA/hns: Correct the value of HNS_ROCE_HEM_CHUNK_LEN
RDMA/hns: Add support for reporting wc as software mode
RDMA/hns: Bugfix for posting a wqe with sge
RDMA/hns: Fix coding style issues
RDMA/hns: Replace custom macros HNS_ROCE_ALIGN_UP
RDMA/hns: Remove redundant print information
RDMA/hns: Delete unnessary parameters in hns_roce_v2_qp_modify()
RDMA/hns: Update the value of qp type
RDMA/hns: Remove unused function hns_roce_init_eq_table()
RDMA/hns: Avoid printing address of mtt page
RDMA/hns: Simplify the calculation and usage of wqe idx for post verbs

update 01120
RDMA/hns: Get pf capabilities from firmware
RDMA/hns: Add interfaces to get pf capabilities from firmware
RDMA/hns: Remove some redundant variables related to capabilities
RDMA/hns: Add support for extended atomic in userspace

[Status]
(Fix committed): RDMA/hns: Delete unnecessary callback functions for cq
(Fix committed): RDMA/hns: Rename the functions used inside creating cq
(Fix committed): RDMA/hns: Redefine the member of hns_roce_cq struct
(Fix committed): RDMA/hns: Redefine interfaces used in creating cq
(Fix committed): IB/umem: remove the dmasync argument to ib_umem_get
(Fix committed): RDMA/hns: Modify appropriate printings
(Fix committed): RDMA/hns: Fix non-standard error codes
(Fix committed): RDMA/hns: Modify hns_roce_hw_v2_get_cfg to simplify the code
(Fix committed): RDMA/hns: Simplify doorbell initialization code
(Fix committed): RDMA/hns: Replace not intuitive function/macro names
(Fix committed): RDMA/hns: Modify fields of struct hns_roce_srq
(Fix committed): RDMA/hns: Delete unnecessary uar from hns_roce_cq
(Fix committed): RDMA/hns: Remove unnecessary structure hns_roce_sqp
(Fix committed): RDMA/hns: Delete unnecessary variable max_post
(Fix committed): RDMA/hns: Remove unsupported modify_port callback
(Fix committed): RDMA: Connect between the mmap entry and the umap_priv structure
(Fix committed): RDMA/hns: Fix build error again
(Fix committed): RDMA/hns: Fix memory leak on 'context' on error return path
(Fix committed): RDMA/hns: Bugfix for qpc/cqc timer configuration
(Fix committed): RDMA/hns: Fix to support 64K page for srq
(Fix committed): RDMA/hns: Delete BITS_PER_BYTE redefinition
(Fix committed): RDMA/hns: Prevent undefined behavior in hns_roce_set_user_sq_size()
(Fix committed): RDMA/hns: Release qp resources when failed to destroy qp
(Fix committed): RDMA/hns: Fix a spelling mistake in a macro
(Fix committed): RDMA/hns: Modify return value of restrack functions
(Fix committed): RDMA/hns: Modify variable/field name from vlan to vlan_id
(Fix committed): RDMA/hns: Fix wrong parameters when initial mtt of srq->idx_que
(Fix committed): RDMA/hns: remove a redundant le16_to_cpu
(Fix committed): RDMA/hns: Prevent memory leaks of eq->buf_list
(Fix committed): RDMA/hns: Correct the value of srq_desc_size
(Fix committed): RDMA/hns: Correct the value of HNS_ROCE_HEM_CHUNK_LEN
(Fix committed): RDMA/hns: Add support for reporting wc as software mode
(Fix committed): RDMA/hns: Bugfix for posting a wqe with sge
(Fix committed): RDMA/hns: Fix coding style issues
(Fix committed): RDMA/hns: Replace custom macros HNS_ROCE_ALIGN_UP
(Fix committed): RDMA/hns: Remove redundant print information
(Fix committed): RDMA/hns: Delete unnessary parameters in hns_roce_v2_qp_modify()
(Fix committed): RDMA/hns: Update the value of qp type
(Fix committed): RDMA/hns: Remove unused function hns_roce_init_eq_table()
(Fix committed): RDMA/hns: Avoid printing address of mtt page
(Fix committed): RDMA/hns: Simplify the calculation and usage of wqe idx for post verbs
(Fix committed): RDMA/hns: Get pf capabilities from firmware
(Fix committed): RDMA/hns: Add interfaces to get pf capabilities from firmware
(Fix committed): RDMA/hns: Remove some redundant variables related to capabilities
(Fix committed): RDMA/hns: Add support for extended atomic in userspace

CVE References

Ike Panhc (ikepanhc)
tags: added: ikeradar
description: updated
summary: - [roce-0111]sync mainline kernel 5.5rc5 roce patchset into ubuntu HWE
+ [roce-0111]sync mainline kernel 5.5rc6 roce patchset into ubuntu HWE
kernel branch Edit
summary: [roce-0111]sync mainline kernel 5.5rc6 roce patchset into ubuntu HWE
- kernel branch Edit
+ kernel branch
Ike Panhc (ikepanhc)
Changed in kunpeng920:
status: New → In Progress
Revision history for this message
Ike Panhc (ikepanhc) wrote :

Get an error on cherry-pick. Might need to pull other RDMA patches.

error: could not apply c043ff2cfb7f... RDMA: Connect between the mmap entry and the umap_priv structure
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

$ git diff
diff --cc drivers/infiniband/core/core_priv.h
index 9d07378b5b42,6be180eb8cb3..000000000000
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@@ -388,4 -387,15 +388,18 @@@ int ib_device_set_netns_put(struct sk_b

  int rdma_nl_net_init(struct rdma_dev_net *rnet);
  void rdma_nl_net_exit(struct rdma_dev_net *rnet);
++<<<<<<< HEAD
++=======
+
+ struct rdma_umap_priv {
+ struct vm_area_struct *vma;
+ struct list_head list;
+ struct rdma_user_mmap_entry *entry;
+ };
+
+ void rdma_umap_priv_init(struct rdma_umap_priv *priv,
+ struct vm_area_struct *vma,
+ struct rdma_user_mmap_entry *entry);
+
++>>>>>>> c043ff2cfb7f... RDMA: Connect between the mmap entry and the umap_priv structure
  #endif /* _CORE_PRIV_H */
diff --cc include/rdma/ib_verbs.h
index 44c52639db55,416e72ea80d9..000000000000
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@@ -2789,18 -2826,21 +2789,34 @@@ void ib_set_client_data(struct ib_devi
  void ib_set_device_ops(struct ib_device *device,
                       const struct ib_device_ops *ops);

- #if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
  int rdma_user_mmap_io(struct ib_ucontext *ucontext, struct vm_area_struct *vma,
++<<<<<<< HEAD
 + unsigned long pfn, unsigned long size, pgprot_t prot);
 +#else
 +static inline int rdma_user_mmap_io(struct ib_ucontext *ucontext,
 + struct vm_area_struct *vma,
 + unsigned long pfn, unsigned long size,
 + pgprot_t prot)
 +{
 + return -EINVAL;
 +}

description: updated
Revision history for this message
Ike Panhc (ikepanhc) wrote :

One found.

commit b86deba977a91aaa5a4b725d7b42970e6de28d2c
Author: Michal Kalderon <email address hidden>
Date: Wed Oct 30 11:44:10 2019 +0200

    RDMA/core: Move core content from ib_uverbs to ib_core

    Move functionality that is called by the driver, which is
    related to umap, to a new file that will be linked in ib_core.
    This is a first step in later enabling ib_uverbs to be optional.
    vm_ops is now initialized in ib_uverbs_mmap instead of
    priv_init to avoid having to move all the rdma_umap functions
    as well.

Revision history for this message
Ike Panhc (ikepanhc) wrote :

(Conflicted): IB/umem: remove the dmasync argument to ib_umem_get
(Conflicted): RDMA: Connect between the mmap entry and the umap_priv structure

Conflicted on cherry-picking these 2 patches. Since these are for RDMA/IB core, I will put them on hold.

description: updated
description: updated
description: updated
Ike Panhc (ikepanhc)
description: updated
Revision history for this message
Ike Panhc (ikepanhc) wrote :

Found another patch needed to satisfy dependency

commit d11769fdc1bbf6664083c0caabd9f2f864dd72ec
Author: Wenpeng Liang <email address hidden>
Date: Tue Nov 5 19:08:02 2019 +0800

    RDMA/hns: Modify appropriate printings

    Modify some printings that is not in uniformed style, non-standard or with
    spelling errors.

    Link: https://<email address hidden>
    Signed-off-by: Wenpeng Liang <email address hidden>
    Signed-off-by: Weihang Li <email address hidden>
    Signed-off-by: Jason Gunthorpe <email address hidden>

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Another patch is also needed for clean cherry-pick

commit 27e19f45108959f99b23a414be391b6a2a282caa
Author: Matthew Wilcox <email address hidden>
Date: Wed Feb 20 16:20:39 2019 -0800

    RDMA/hns: Convert cq_table to XArray

    Change the locking to not disable interrupts as the lookup in interrupt
    context will not see a freed CQ, thanks to the synchronize_irq() call
    before freeing the CQ.

    Signed-off-by: Matthew Wilcox <email address hidden>
    Signed-off-by: Jason Gunthorpe <email address hidden>

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Now the problem is with this patch

  72b894b09a96 IB/umem: remove the dmasync argument to ib_umem_get

Which depends on other RDMA patches. I am working on modifying this patches for focal. Might take more time for RDMA patches.

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Hi Xinwei,

I build test kernel debs at

  https://kernel.ubuntu.com/~ikepanhc/lp1859269.1/

and the kernel source is at

  https://kernel.ubuntu.com/git/ikepanhc/public.git/log/?h=lp1859269.1

Please let me know if test works fine or not.

Changed in kunpeng920:
status: In Progress → Incomplete
Ike Panhc (ikepanhc)
Changed in linux (Ubuntu):
status: New → In Progress
assignee: nobody → Ike Panhc (ikepanhc)
Changed in kunpeng920:
status: Incomplete → In Progress
Revision history for this message
Andrew Cloke (andrew-cloke) wrote :

Xinwei has communicated to Ike that this will take some time to test. Testing should be completed around the middle of March.

Revision history for this message
Andrew Cloke (andrew-cloke) wrote :

Marking as "incomplete" while waiting for test results.

Changed in kunpeng920:
status: In Progress → Incomplete
Revision history for this message
Fred Kimmy (kongzizaixian) wrote :

I have confirmed that our internal test team have completed 28 testcases and not find any bug. now also are adding some testcase to test this Roce module.

Ike Panhc (ikepanhc)
Changed in kunpeng920:
status: Incomplete → In Progress
Revision history for this message
Ike Panhc (ikepanhc) wrote :
tags: removed: ikeradar
Ike Panhc (ikepanhc)
Changed in kunpeng920:
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Ike Panhc (ikepanhc)
description: updated
Revision history for this message
Ike Panhc (ikepanhc) wrote :

Thanks. focal kernel 5.4.0-20.24 works for me.

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 5.4.0-21.25

---------------
linux (5.4.0-21.25) focal; urgency=medium

  * CVE-2020-8835
    - SAUCE: bpf: undo incorrect __reg_bound_offset32 handling

 -- Thadeu Lima de Souza Cascardo <email address hidden> Thu, 26 Mar 2020 17:51:28 -0300

Changed in linux (Ubuntu):
status: In Progress → Fix Released
Ike Panhc (ikepanhc)
Changed in kunpeng920:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.