<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/misc/genwqe, branch v3.18.76</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.18.76</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.18.76'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2016-11-24T03:56:30+00:00</updated>
<entry>
<title>GenWQE: Fix bad page access during abort of resource allocation</title>
<updated>2016-11-24T03:56:30+00:00</updated>
<author>
<name>Gerald Schaefer</name>
<email>gerald.schaefer@de.ibm.com</email>
</author>
<published>2016-10-19T10:29:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7d9ad295527ff08a9f44aa71e2d77a84f57efcd1'/>
<id>urn:sha1:7d9ad295527ff08a9f44aa71e2d77a84f57efcd1</id>
<content type='text'>
[ Upstream commit a7a7aeefbca2982586ba2c9fd7739b96416a6d1d ]

When interrupting an application which was allocating DMAable
memory, it was possible, that the DMA memory was deallocated
twice, leading to the error symptoms below.

Thanks to Gerald, who analyzed the problem and provided this
patch.

I agree with his analysis of the problem: ddcb_cmd_fixups() -&gt;
genwqe_alloc_sync_sgl() (fails in f/lpage, but sgl-&gt;sgl != NULL
and f/lpage maybe also != NULL) -&gt; ddcb_cmd_cleanup() -&gt;
genwqe_free_sync_sgl() (double free, because sgl-&gt;sgl != NULL and
f/lpage maybe also != NULL)

In this scenario we would have exactly the kind of double free that
would explain the WARNING / Bad page state, and as expected it is
caused by broken error handling (cleanup).

Using the Ubuntu git source, tag Ubuntu-4.4.0-33.52, he was able to reproduce
the "Bad page state" issue, and with the patch on top he could not reproduce
it any more.

------------[ cut here ]------------
WARNING: at /build/linux-o03cxz/linux-4.4.0/arch/s390/include/asm/pci_dma.h:141
Modules linked in: qeth_l2 ghash_s390 prng aes_s390 des_s390 des_generic sha512_s390 sha256_s390 sha1_s390 sha_common genwqe_card qeth crc_itu_t qdio ccwgroup vmur dm_multipath dasd_eckd_mod dasd_mod
CPU: 2 PID: 3293 Comm: genwqe_gunzip Not tainted 4.4.0-33-generic #52-Ubuntu
task: 0000000032c7e270 ti: 00000000324e4000 task.ti: 00000000324e4000
Krnl PSW : 0404c00180000000 0000000000156346 (dma_update_cpu_trans+0x9e/0xa8)
           R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3
Krnl GPRS: 00000000324e7bcd 0000000000c3c34a 0000000027628298 000000003215b400
           0000000000000400 0000000000001fff 0000000000000400 0000000116853000
           07000000324e7b1e 0000000000000001 0000000000000001 0000000000000001
           0000000000001000 0000000116854000 0000000000156402 00000000324e7a38
Krnl Code: 000000000015633a: 95001000           cli     0(%r1),0
           000000000015633e: a774ffc3           brc     7,1562c4
          #0000000000156342: a7f40001           brc     15,156344
          &gt;0000000000156346: 92011000           mvi     0(%r1),1
           000000000015634a: a7f4ffbd           brc     15,1562c4
           000000000015634e: 0707               bcr     0,%r7
           0000000000156350: c00400000000       brcl    0,156350
           0000000000156356: eb7ff0500024       stmg    %r7,%r15,80(%r15)
Call Trace:
([&lt;00000000001563e0&gt;] dma_update_trans+0x90/0x228)
 [&lt;00000000001565dc&gt;] s390_dma_unmap_pages+0x64/0x160
 [&lt;00000000001567c2&gt;] s390_dma_free+0x62/0x98
 [&lt;000003ff801310ce&gt;] __genwqe_free_consistent+0x56/0x70 [genwqe_card]
 [&lt;000003ff801316d0&gt;] genwqe_free_sync_sgl+0xf8/0x160 [genwqe_card]
 [&lt;000003ff8012bd6e&gt;] ddcb_cmd_cleanup+0x86/0xa8 [genwqe_card]
 [&lt;000003ff8012c1c0&gt;] do_execute_ddcb+0x110/0x348 [genwqe_card]
 [&lt;000003ff8012c914&gt;] genwqe_ioctl+0x51c/0xc20 [genwqe_card]
 [&lt;000000000032513a&gt;] do_vfs_ioctl+0x3b2/0x518
 [&lt;0000000000325344&gt;] SyS_ioctl+0xa4/0xb8
 [&lt;00000000007b86c6&gt;] system_call+0xd6/0x264
 [&lt;000003ff9e8e520a&gt;] 0x3ff9e8e520a
Last Breaking-Event-Address:
 [&lt;0000000000156342&gt;] dma_update_cpu_trans+0x9a/0xa8
---[ end trace 35996336235145c8 ]---
BUG: Bad page state in process jbd2/dasdb1-8  pfn:3215b
page:000003d100c856c0 count:-1 mapcount:0 mapping:          (null) index:0x0
flags: 0x3fffc0000000000()
page dumped because: nonzero _count

Signed-off-by: Gerald Schaefer &lt;gerald.schaefer@de.ibm.com&gt;
Signed-off-by: Frank Haverkamp &lt;haver@linux.vnet.ibm.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>misc: genwqe: check for error from get_user_pages_fast()</title>
<updated>2015-01-16T14:59:50+00:00</updated>
<author>
<name>Ian Abbott</name>
<email>abbotti@mev.co.uk</email>
</author>
<published>2014-11-06T16:23:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1a5773af11ccd56972a5b764028646326bdc9799'/>
<id>urn:sha1:1a5773af11ccd56972a5b764028646326bdc9799</id>
<content type='text'>
commit cf35d6e0475982667b0d2d318fb27be4b8849827 upstream.

`genwqe_user_vmap()` calls `get_user_pages_fast()` and if the return
value is less than the number of pages requested, it frees the pages and
returns an error (`-EFAULT`).  However, it fails to consider a negative
error return value from `get_user_pages_fast()`.  In that case, the test
`if (rc &lt; m-&gt;nr_pages)` will be false (due to promotion of `rc` to a
large `unsigned int`) and the code will continue on to call
`genwqe_map_pages()` with an invalid list of page pointers.  Fix it by
bailing out if `get_user_pages_fast()` returns a negative error value.

Signed-off-by: Ian Abbott &lt;abbotti@mev.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>GenWQE: Support blocking when DDCB queue is busy</title>
<updated>2014-09-24T06:15:47+00:00</updated>
<author>
<name>Frank Haverkamp</name>
<email>haver@linux.vnet.ibm.com</email>
</author>
<published>2014-09-10T14:37:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1451f414639465995dfc1f820aa1a64723cbd662'/>
<id>urn:sha1:1451f414639465995dfc1f820aa1a64723cbd662</id>
<content type='text'>
When the GenWQE hardware queue was busy, the driver returned simply
-EBUSY. This caused polling by applications which increased the load
on the already busy system. This change implements the possiblity to
sleep on a waitqueue instead when the DDCB queue is busy. The
requestor is woken up when there is free space on the queue again.
The old way to get -EBUSY is still available if the device is openend
with O_NONBLOCKING. The default is now blocking behavior.

Signed-off-by: Frank Haverkamp &lt;haver@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>GenWQE: Fix problem when reading HSI and Retc</title>
<updated>2014-09-24T06:15:47+00:00</updated>
<author>
<name>Eberhard S. Amann</name>
<email>esa@linux.vnet.ibm.com</email>
</author>
<published>2014-09-10T14:37:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=08e4906cc29d092ae2da0ff089efe1488e584d3c'/>
<id>urn:sha1:08e4906cc29d092ae2da0ff089efe1488e584d3c</id>
<content type='text'>
This patch fixes a problem we found during debug on PPC64 when
reading HSI status and Retc.

Signed-off-by: Eberhard S. Amann &lt;esa@linux.vnet.ibm.com&gt;
Signed-off-by: Frank Haverkamp &lt;haver@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>GenWQE: Fix checkpatch complaints</title>
<updated>2014-09-24T06:15:47+00:00</updated>
<author>
<name>Frank Haverkamp</name>
<email>haver@linux.vnet.ibm.com</email>
</author>
<published>2014-09-10T14:37:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d9c11d45b33c9226abd50a50c87e19bfa7c7a2cb'/>
<id>urn:sha1:d9c11d45b33c9226abd50a50c87e19bfa7c7a2cb</id>
<content type='text'>
The checkpatch.pl script got improved. I ran it on the latest GenWQE
sources and fixed what it complained about.

Signed-off-by: Frank Haverkamp &lt;haver@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>GenWQE: Check return code of pci_sriov_enable</title>
<updated>2014-09-24T06:15:46+00:00</updated>
<author>
<name>Frank Haverkamp</name>
<email>haver@linux.vnet.ibm.com</email>
</author>
<published>2014-09-10T14:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bc407dd319bb8c3608369989d95b700d00e6cf43'/>
<id>urn:sha1:bc407dd319bb8c3608369989d95b700d00e6cf43</id>
<content type='text'>
Forgetting to check this, can lead to problems on systems which
do not support SRIOV.

Signed-off-by: Frank Haverkamp &lt;haver@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>GenWQE: Do not modify return code of genwqe_set_interrupt_capability</title>
<updated>2014-09-24T06:15:46+00:00</updated>
<author>
<name>Frank Haverkamp</name>
<email>haver@linux.vnet.ibm.com</email>
</author>
<published>2014-09-10T14:37:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2d880ccfa9be92a10ea19f5a8f7e4be2a7d45e4d'/>
<id>urn:sha1:2d880ccfa9be92a10ea19f5a8f7e4be2a7d45e4d</id>
<content type='text'>
Follow up patch to the one from Sebastian Ott. There is no need to
change the return code once it fails. And Sebastians version is tested
now and works nicely on our test-system.

Signed-off-by: Frank Haverkamp &lt;haver@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>GenWQE: Update author information</title>
<updated>2014-09-24T06:15:46+00:00</updated>
<author>
<name>Frank Haverkamp</name>
<email>haver@linux.vnet.ibm.com</email>
</author>
<published>2014-09-10T14:37:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=26d8f6f15112b8b0fbff360c360e8c42bf2bc370'/>
<id>urn:sha1:26d8f6f15112b8b0fbff360c360e8c42bf2bc370</id>
<content type='text'>
Updated email address of co-author.

Signed-off-by: Frank Haverkamp &lt;haver@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Jung &lt;mijung@gmx.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>GenWQE: Remove sysfs entry for driver version</title>
<updated>2014-09-24T06:15:46+00:00</updated>
<author>
<name>Frank Haverkamp</name>
<email>haver@linux.vnet.ibm.com</email>
</author>
<published>2014-09-10T14:37:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=64df2ec5108de3f627761cade7b31e5d583ce448'/>
<id>urn:sha1:64df2ec5108de3f627761cade7b31e5d583ce448</id>
<content type='text'>
A special sysfs entry to display the driver version is not
needed. We left the driver version and adjusted it to the
naming a lot of other drivers use. The information can be
retrieved by using modinfo genwqe_card.

modinfo genwqe_card will provide the same information.

Signed-off-by: Frank Haverkamp &lt;haver@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>GenWQE: Check pci_get_totalvfs return code</title>
<updated>2014-09-24T06:15:46+00:00</updated>
<author>
<name>Frank Haverkamp</name>
<email>haver@linux.vnet.ibm.com</email>
</author>
<published>2014-09-10T14:37:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=95a8825c9c3482e31ee5064184138a18be186515'/>
<id>urn:sha1:95a8825c9c3482e31ee5064184138a18be186515</id>
<content type='text'>
Currently the driver is using the pci_get_totalvfs() return code
directly in a loop. To avoid problems with potentially negative
returns in case of errors, we are adding some more sanity checking
code.

Signed-off-by: Frank Haverkamp &lt;haver@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
