<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/net/smc, branch linux-6.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-6.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-6.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-11-10T17:17:22+00:00</updated>
<entry>
<title>net/smc: Fix possible leaked pernet namespace in smc_init()</title>
<updated>2022-11-10T17:17:22+00:00</updated>
<author>
<name>Chen Zhongjin</name>
<email>chenzhongjin@huawei.com</email>
</author>
<published>2022-11-01T09:37:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c97daf836f7caf81d3144b8cd2b2a51f9bc3bd09'/>
<id>urn:sha1:c97daf836f7caf81d3144b8cd2b2a51f9bc3bd09</id>
<content type='text'>
[ Upstream commit 62ff373da2534534c55debe6c724c7fe14adb97f ]

In smc_init(), register_pernet_subsys(&amp;smc_net_stat_ops) is called
without any error handling.
If it fails, registering of &amp;smc_net_ops won't be reverted.
And if smc_nl_init() fails, &amp;smc_net_stat_ops itself won't be reverted.

This leaves wild ops in subsystem linkedlist and when another module
tries to call register_pernet_operations() it triggers page fault:

BUG: unable to handle page fault for address: fffffbfff81b964c
RIP: 0010:register_pernet_operations+0x1b9/0x5f0
Call Trace:
  &lt;TASK&gt;
  register_pernet_subsys+0x29/0x40
  ebtables_init+0x58/0x1000 [ebtables]
  ...

Fixes: 194730a9beb5 ("net/smc: Make SMC statistics network namespace aware")
Signed-off-by: Chen Zhongjin &lt;chenzhongjin@huawei.com&gt;
Reviewed-by: Tony Lu &lt;tonylu@linux.alibaba.com&gt;
Reviewed-by: Wenjia Zhang &lt;wenjia@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20221101093722.127223-1-chenzhongjin@huawei.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net/smc: Fix an error code in smc_lgr_create()</title>
<updated>2022-10-29T08:08:32+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2022-10-14T09:34:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=294a8e9a3cecbf6e6faf6b37d031a0ded5671403'/>
<id>urn:sha1:294a8e9a3cecbf6e6faf6b37d031a0ded5671403</id>
<content type='text'>
[ Upstream commit bdee15e8c58b450ad736a2b62ef8c7a12548b704 ]

If smc_wr_alloc_lgr_mem() fails then return an error code.  Don't return
success.

Fixes: 8799e310fb3f ("net/smc: add v2 support to the work request layer")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Wenjia Zhang &lt;wenjia@linux.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net/smc: Stop the CLC flow if no link to map buffers on</title>
<updated>2022-09-22T10:53:53+00:00</updated>
<author>
<name>Wen Gu</name>
<email>guwen@linux.alibaba.com</email>
</author>
<published>2022-09-20T06:43:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e738455b2c6dcdab03e45d97de36476f93f557d2'/>
<id>urn:sha1:e738455b2c6dcdab03e45d97de36476f93f557d2</id>
<content type='text'>
There might be a potential race between SMC-R buffer map and
link group termination.

smc_smcr_terminate_all()     | smc_connect_rdma()
--------------------------------------------------------------
                             | smc_conn_create()
for links in smcibdev        |
        schedule links down  |
                             | smc_buf_create()
                             |  \- smcr_buf_map_usable_links()
                             |      \- no usable links found,
                             |         (rmb-&gt;mr = NULL)
                             |
                             | smc_clc_send_confirm()
                             |  \- access conn-&gt;rmb_desc-&gt;mr[]-&gt;rkey
                             |     (panic)

During reboot and IB device module remove, all links will be set
down and no usable links remain in link groups. In such situation
smcr_buf_map_usable_links() should return an error and stop the
CLC flow accessing to uninitialized mr.

Fixes: b9247544c1bc ("net/smc: convert static link ID instances to support multiple links")
Signed-off-by: Wen Gu &lt;guwen@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/1663656189-32090-1-git-send-email-guwen@linux.alibaba.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net/smc: Fix possible access to freed memory in link clear</title>
<updated>2022-09-07T15:00:48+00:00</updated>
<author>
<name>Yacan Liu</name>
<email>liuyacan@corp.netease.com</email>
</author>
<published>2022-09-06T13:01:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e9b1a4f867ae9c1dbd1d71cd09cbdb3239fb4968'/>
<id>urn:sha1:e9b1a4f867ae9c1dbd1d71cd09cbdb3239fb4968</id>
<content type='text'>
After modifying the QP to the Error state, all RX WR would be completed
with WC in IB_WC_WR_FLUSH_ERR status. Current implementation does not
wait for it is done, but destroy the QP and free the link group directly.
So there is a risk that accessing the freed memory in tasklet context.

Here is a crash example:

 BUG: unable to handle page fault for address: ffffffff8f220860
 #PF: supervisor write access in kernel mode
 #PF: error_code(0x0002) - not-present page
 PGD f7300e067 P4D f7300e067 PUD f7300f063 PMD 8c4e45063 PTE 800ffff08c9df060
 Oops: 0002 [#1] SMP PTI
 CPU: 1 PID: 0 Comm: swapper/1 Kdump: loaded Tainted: G S         OE     5.10.0-0607+ #23
 Hardware name: Inspur NF5280M4/YZMB-00689-101, BIOS 4.1.20 07/09/2018
 RIP: 0010:native_queued_spin_lock_slowpath+0x176/0x1b0
 Code: f3 90 48 8b 32 48 85 f6 74 f6 eb d5 c1 ee 12 83 e0 03 83 ee 01 48 c1 e0 05 48 63 f6 48 05 00 c8 02 00 48 03 04 f5 00 09 98 8e &lt;48&gt; 89 10 8b 42 08 85 c0 75 09 f3 90 8b 42 08 85 c0 74 f7 48 8b 32
 RSP: 0018:ffffb3b6c001ebd8 EFLAGS: 00010086
 RAX: ffffffff8f220860 RBX: 0000000000000246 RCX: 0000000000080000
 RDX: ffff91db1f86c800 RSI: 000000000000173c RDI: ffff91db62bace00
 RBP: ffff91db62bacc00 R08: 0000000000000000 R09: c00000010000028b
 R10: 0000000000055198 R11: ffffb3b6c001ea58 R12: ffff91db80e05010
 R13: 000000000000000a R14: 0000000000000006 R15: 0000000000000040
 FS:  0000000000000000(0000) GS:ffff91db1f840000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: ffffffff8f220860 CR3: 00000001f9580004 CR4: 00000000003706e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
 Call Trace:
  &lt;IRQ&gt;
  _raw_spin_lock_irqsave+0x30/0x40
  mlx5_ib_poll_cq+0x4c/0xc50 [mlx5_ib]
  smc_wr_rx_tasklet_fn+0x56/0xa0 [smc]
  tasklet_action_common.isra.21+0x66/0x100
  __do_softirq+0xd5/0x29c
  asm_call_irq_on_stack+0x12/0x20
  &lt;/IRQ&gt;
  do_softirq_own_stack+0x37/0x40
  irq_exit_rcu+0x9d/0xa0
  sysvec_call_function_single+0x34/0x80
  asm_sysvec_call_function_single+0x12/0x20

Fixes: bd4ad57718cc ("smc: initialize IB transport incl. PD, MR, QP, CQ, event, WR")
Signed-off-by: Yacan Liu &lt;liuyacan@corp.netease.com&gt;
Reviewed-by: Tony Lu &lt;tonylu@linux.alibaba.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/smc: Remove redundant refcount increase</title>
<updated>2022-09-01T08:04:45+00:00</updated>
<author>
<name>Yacan Liu</name>
<email>liuyacan@corp.netease.com</email>
</author>
<published>2022-08-30T15:23:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a8424a9b4522a3ab9f32175ad6d848739079071f'/>
<id>urn:sha1:a8424a9b4522a3ab9f32175ad6d848739079071f</id>
<content type='text'>
For passive connections, the refcount increment has been done in
smc_clcsock_accept()--&gt;smc_sock_alloc().

Fixes: 3b2dec2603d5 ("net/smc: restructure client and server code in af_smc")
Signed-off-by: Yacan Liu &lt;liuyacan@corp.netease.com&gt;
Reviewed-by: Tony Lu &lt;tonylu@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20220830152314.838736-1-liuyacan@corp.netease.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net/smc: Enable module load on netlink usage</title>
<updated>2022-07-27T12:24:42+00:00</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@linux.ibm.com</email>
</author>
<published>2022-07-25T14:10:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=28ec53f3a830750f1b5ccf73cb13dae66ade1660'/>
<id>urn:sha1:28ec53f3a830750f1b5ccf73cb13dae66ade1660</id>
<content type='text'>
Previously, the smc and smc_diag modules were automatically loaded as
dependencies of the ism module whenever an ISM device was present.
With the pending rework of the ISM API, the smc module will no longer
automatically be loaded in presence of an ISM device. Usage of an AF_SMC
socket will still trigger loading of the smc modules, but usage of a
netlink socket will not.
This is addressed by setting the correct module aliases.

Signed-off-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Signed-off-by: Wenjia Zhang &lt; wenjia@linux.ibm.com&gt;
Reviewed-by: Tony Lu &lt;tonylu@linux.alibaba.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/smc: Pass on DMBE bit mask in IRQ handler</title>
<updated>2022-07-27T12:24:42+00:00</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@linux.ibm.com</email>
</author>
<published>2022-07-25T14:09:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8b2fed8e2712e8c23665df3c9e0fbabbb76e466c'/>
<id>urn:sha1:8b2fed8e2712e8c23665df3c9e0fbabbb76e466c</id>
<content type='text'>
Make the DMBE bits, which are passed on individually in ism_move() as
parameter idx, available to the receiver.

Signed-off-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Signed-off-by: Wenjia Zhang &lt; wenjia@linux.ibm.com&gt;
Reviewed-by: Tony Lu &lt;tonylu@linux.alibaba.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>s390/ism: Cleanups</title>
<updated>2022-07-27T12:24:42+00:00</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@linux.ibm.com</email>
</author>
<published>2022-07-25T14:09:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0a2f4f9893c83bd722bd55a903fb682da2eb24ba'/>
<id>urn:sha1:0a2f4f9893c83bd722bd55a903fb682da2eb24ba</id>
<content type='text'>
Reworked signature of the function to retrieve the system EID: No plausible
reason to use a double pointer. And neither to pass in the device as an
argument, as this identifier is by definition per system, not per device.
Plus some minor consistency edits.

Signed-off-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Signed-off-by: Wenjia Zhang &lt; wenjia@linux.ibm.com&gt;
Reviewed-by: Tony Lu &lt;tonylu@linux.alibaba.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/smc: Eliminate struct smc_ism_position</title>
<updated>2022-07-27T12:24:42+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2022-07-25T14:09:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eb481b02bd182a96e22070895bf887277b82150f'/>
<id>urn:sha1:eb481b02bd182a96e22070895bf887277b82150f</id>
<content type='text'>
This struct is used in a single place only, and its usage generates
inefficient code. Time to clean up!

Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Reviewed-and-tested-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Signed-off-by: Wenjia Zhang &lt; wenjia@linux.ibm.com&gt;
Reviewed-by: Tony Lu &lt;tonylu@linux.alibaba.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2022-07-21T20:03:39+00:00</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2022-07-21T20:03:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e0e846ee2ab01bc44254e6a0a6a6a0db1cba16d'/>
<id>urn:sha1:6e0e846ee2ab01bc44254e6a0a6a6a0db1cba16d</id>
<content type='text'>
No conflicts.

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
