<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/infiniband/hw, branch linux-4.16.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-06-20T19:01:35+00:00</updated>
<entry>
<title>IB/mlx4: Fix integer overflow when calculating optimal MTT size</title>
<updated>2018-06-20T19:01:35+00:00</updated>
<author>
<name>Jack Morgenstein</name>
<email>jackm@dev.mellanox.co.il</email>
</author>
<published>2018-05-02T10:04:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=000fcf06055b9fc59ad005a4919a06d2277afd50'/>
<id>urn:sha1:000fcf06055b9fc59ad005a4919a06d2277afd50</id>
<content type='text'>
[ Upstream commit b03bcde962606d2ee59a4e9dd470db9ad53c5418 ]

When the kernel was compiled using the UBSAN option,
we saw the following stack trace:

[ 1184.827917] UBSAN: Undefined behaviour in drivers/infiniband/hw/mlx4/mr.c:349:27
[ 1184.828114] signed integer overflow:
[ 1184.828247] -2147483648 - 1 cannot be represented in type 'int'

The problem was caused by calling round_up in procedure
mlx4_ib_umem_calc_optimal_mtt_size (on line 349, as noted in the stack
trace) with the second parameter (1 &lt;&lt; block_shift) (which is an int).
The second parameter should have been (1ULL &lt;&lt; block_shift) (which
is an unsigned long long).

(1 &lt;&lt; block_shift) is treated by the compiler as an int (because 1 is
an integer).

Now, local variable block_shift is initialized to 31.
If block_shift is 31, 1 &lt;&lt; block_shift is 1 &lt;&lt; 31 = 0x80000000=-214748368.
This is the most negative int value.

Inside the round_up macro, there is a cast applied to ((1 &lt;&lt; 31) - 1).
However, this cast is applied AFTER ((1 &lt;&lt; 31) - 1) is calculated.
Since (1 &lt;&lt; 31) is treated as an int, we get the negative overflow
identified by UBSAN in the process of calculating ((1 &lt;&lt; 31) - 1).

The fix is to change (1 &lt;&lt; block_shift) to (1ULL &lt;&lt; block_shift) on
line 349.

Fixes: 9901abf58368 ("IB/mlx4: Use optimal numbers of MTT entries")
Signed-off-by: Jack Morgenstein &lt;jackm@dev.mellanox.co.il&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>IB/hfi1: Fix memory leak in exception path in get_irq_affinity()</title>
<updated>2018-06-20T19:01:35+00:00</updated>
<author>
<name>Sebastian Sanchez</name>
<email>sebastian.sanchez@intel.com</email>
</author>
<published>2018-05-01T12:36:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d047fef7eb1321939af74e10a5cb603e20cd19f6'/>
<id>urn:sha1:d047fef7eb1321939af74e10a5cb603e20cd19f6</id>
<content type='text'>
[ Upstream commit 59482a14918b282ca2a98f38c69da5ebeb1107d2 ]

When IRQ affinity is set and the interrupt type is unknown, a cpu
mask allocated within the function is never freed. Fix this memory
leak by allocating memory within the scope where it is used.

Reviewed-by: Mike Marciniszyn &lt;mike.marciniszyn@intel.com&gt;
Reviewed-by: Michael J. Ruhl &lt;michael.j.ruhl@intel.com&gt;
Signed-off-by: Sebastian Sanchez &lt;sebastian.sanchez@intel.com&gt;
Signed-off-by: Dennis Dalessandro &lt;dennis.dalessandro@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>IB/{hfi1, rdmavt}: Fix memory leak in hfi1_alloc_devdata() upon failure</title>
<updated>2018-06-20T19:01:35+00:00</updated>
<author>
<name>Sebastian Sanchez</name>
<email>sebastian.sanchez@intel.com</email>
</author>
<published>2018-05-01T12:36:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3566fe0f196ea7d1d189a0437e7b0a7c3eed05e3'/>
<id>urn:sha1:3566fe0f196ea7d1d189a0437e7b0a7c3eed05e3</id>
<content type='text'>
[ Upstream commit e9777ad4399c26c70318c4945f94efac2ed95391 ]

When allocating device data, if there's an allocation failure, the
already allocated memory won't be freed such as per-cpu counters.

Fix memory leaks in exception path by creating a common reentrant
clean up function hfi1_clean_devdata() to be used at driver unload
time and device data allocation failure.

To accomplish this, free_platform_config() and clean_up_i2c() are
changed to be reentrant to remove dependencies when they are called
in different order. This helps avoid NULL pointer dereferences
introduced by this patch if those two functions weren't reentrant.

In addition, set dd-&gt;int_counter, dd-&gt;rcv_limit,
dd-&gt;send_schedule and dd-&gt;tx_opstats to NULL after they're freed in
hfi1_clean_devdata(), so that hfi1_clean_devdata() is fully reentrant.

Reviewed-by: Mike Marciniszyn &lt;mike.marciniszyn@intel.com&gt;
Reviewed-by: Michael J. Ruhl &lt;michael.j.ruhl@intel.com&gt;
Signed-off-by: Sebastian Sanchez &lt;sebastian.sanchez@intel.com&gt;
Signed-off-by: Dennis Dalessandro &lt;dennis.dalessandro@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>IB/hfi1 Use correct type for num_user_context</title>
<updated>2018-06-20T19:01:35+00:00</updated>
<author>
<name>Michael J. Ruhl</name>
<email>michael.j.ruhl@intel.com</email>
</author>
<published>2018-05-01T12:35:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eca2f76b1d13c2dedc24e3b405389018866ed76b'/>
<id>urn:sha1:eca2f76b1d13c2dedc24e3b405389018866ed76b</id>
<content type='text'>
[ Upstream commit 5da9e742be44d9b7c68b1bf6e1aaf46a1aa7a52b ]

The module parameter num_user_context is defined as 'int' and
defaults to -1.  The module_param_named() says that it is uint.

Correct module_param_named() type information and update the modinfo
text to reflect the default value.

Reviewed-by: Dennis Dalessandro &lt;dennis.dalessandro@intel.com&gt;
Signed-off-by: Michael J. Ruhl &lt;michael.j.ruhl@intel.com&gt;
Signed-off-by: Dennis Dalessandro &lt;dennis.dalessandro@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>RDMA/hns: Submit bad wr</title>
<updated>2018-06-20T19:01:31+00:00</updated>
<author>
<name>oulijun</name>
<email>oulijun@huawei.com</email>
</author>
<published>2018-04-26T06:46:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0d8d5f26052a19db9065609f4a456d2bd34a1f1'/>
<id>urn:sha1:e0d8d5f26052a19db9065609f4a456d2bd34a1f1</id>
<content type='text'>
[ Upstream commit 137ae3208416278aabef3b71e0ea1052940ca362 ]

When generated bad work reqeust, it needs to
report to user. This patch mainly fixes it.

Signed-off-by: Lijun Ou &lt;oulijun@huawei.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>RDMA/hns: Fix the qp context state diagram</title>
<updated>2018-06-20T19:01:30+00:00</updated>
<author>
<name>oulijun</name>
<email>oulijun@huawei.com</email>
</author>
<published>2018-04-26T06:46:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f9c774acd2954f47fc4b003c8881c36eddf275ab'/>
<id>urn:sha1:f9c774acd2954f47fc4b003c8881c36eddf275ab</id>
<content type='text'>
[ Upstream commit 6e1a70943cecdca9bb13b601b1a9772a7bdcc2c3 ]

According to RoCE protocol, it is possible to
transition from error to error state for modifying
qp in hip08. This patch fix it.

Signed-off-by: Lijun Ou &lt;oulijun@huawei.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>RDMA/hns: Intercept illegal RDMA operation when use inline data</title>
<updated>2018-06-20T19:01:30+00:00</updated>
<author>
<name>oulijun</name>
<email>oulijun@huawei.com</email>
</author>
<published>2018-04-26T06:46:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9ec2e6cb0201fa8442b978fd03be2a83c9500298'/>
<id>urn:sha1:9ec2e6cb0201fa8442b978fd03be2a83c9500298</id>
<content type='text'>
[ Upstream commit 328d405b3d4c8dd1f06bfd77f498e23281ae348c ]

RDMA read operation is not supported inline data. If user cofigures
issue a RDMA read and use inline data, it will happen a hardware
error.

Signed-off-by: Lijun Ou &lt;oulijun@huawei.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>RDMA/hns: Bugfix for init hem table</title>
<updated>2018-06-20T19:01:30+00:00</updated>
<author>
<name>oulijun</name>
<email>oulijun@huawei.com</email>
</author>
<published>2018-04-26T06:46:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2c87269995e14f56be301be2e460f5f7338b4dbb'/>
<id>urn:sha1:2c87269995e14f56be301be2e460f5f7338b4dbb</id>
<content type='text'>
[ Upstream commit 215a8c09e5e2aa6ae1fbcef87f8f27d65d5d1ca4 ]

During init hem table, type should be used instead of
table-&gt;type which is finally initializaed with type.

Signed-off-by: Lijun Ou &lt;oulijun@huawei.com&gt;
Signed-off-by: Yixian Liu &lt;liuyixian@huawei.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>RDMA/mlx5: Properly check return value of mlx5_get_uars_page</title>
<updated>2018-06-20T19:01:28+00:00</updated>
<author>
<name>Leon Romanovsky</name>
<email>leonro@mellanox.com</email>
</author>
<published>2018-04-23T14:01:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2d4204ee6bf0727dfab7e77e5c09aa14e57ccd77'/>
<id>urn:sha1:2d4204ee6bf0727dfab7e77e5c09aa14e57ccd77</id>
<content type='text'>
[ Upstream commit 444261ca6ff201fa03de97a5041237e67a9d8d31 ]

Starting from commit 72f36be06138 ("net/mlx5: Fix mlx5_get_uars_page to
return error code") the mlx5_get_uars_page() call returns error in case
of failure, but it was mistakenly overlooked in the merge commit.

Fixes: e7996a9a77fc ("Merge tag v4.15 of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git")
Reported-by: Alaa Hleihel &lt;alaa@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>IB/mlx5: Set the default active rate and width to QDR and 4X</title>
<updated>2018-05-30T06:17:31+00:00</updated>
<author>
<name>Honggang Li</name>
<email>honli@redhat.com</email>
</author>
<published>2018-03-16T02:37:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cf4d94149ef38c9d9c07f5b01c3aa2c637a6aefb'/>
<id>urn:sha1:cf4d94149ef38c9d9c07f5b01c3aa2c637a6aefb</id>
<content type='text'>
[ Upstream commit 7672ed33c4c15dbe9d56880683baaba4227cf940 ]

Before commit f1b65df5a232 ("IB/mlx5: Add support for active_width and
active_speed in RoCE"), the mlx5_ib driver set the default active_width
and active_speed to IB_WIDTH_4X and IB_SPEED_QDR.

When the RoCE port is down, the RoCE port does not negotiate the active
width with the remote side, causing the active width to be zero. When
running userspace ibstat to view the port status, ibstat will panic as it
reads an invalid width from sys file.

This patch restores the original behavior.

Fixes: f1b65df5a232 ("IB/mlx5: Add support for active_width and active_speed in RoCE").
Signed-off-by: Honggang Li &lt;honli@redhat.com&gt;
Reviewed-by: Hal Rosenstock &lt;hal@mellanox.com&gt;
Reviewed-by: Noa Osherovich &lt;noaos@mellanox.com&gt;
Signed-off-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
