<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/misc/genwqe, branch v4.4.89</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.89</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.89'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2016-11-10T15:36:33+00:00</updated>
<entry>
<title>GenWQE: Fix bad page access during abort of resource allocation</title>
<updated>2016-11-10T15:36:33+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=bd5cc3294de37fc07f76ee6beed89101d4b4b0ee'/>
<id>urn:sha1:bd5cc3294de37fc07f76ee6beed89101d4b4b0ee</id>
<content type='text'>
commit a7a7aeefbca2982586ba2c9fd7739b96416a6d1d upstream.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>misc: genwqe: fix a comment typo</title>
<updated>2015-10-04T11:57:15+00:00</updated>
<author>
<name>Geliang Tang</name>
<email>geliangtang@163.com</email>
</author>
<published>2015-09-30T06:33:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d4896a507d7e169c62468c6f44ace368dc7880b'/>
<id>urn:sha1:4d4896a507d7e169c62468c6f44ace368dc7880b</id>
<content type='text'>
Just fix a typo in the code comment.

Signed-off-by: Geliang Tang &lt;geliangtang@163.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc/genwqe: get rid of atomic allocations</title>
<updated>2015-10-04T11:42:33+00:00</updated>
<author>
<name>Sebastian Ott</name>
<email>sebott@linux.vnet.ibm.com</email>
</author>
<published>2015-09-29T16:23:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=19f7767e297f81726e0bd7bf3729178c41b94079'/>
<id>urn:sha1:19f7767e297f81726e0bd7bf3729178c41b94079</id>
<content type='text'>
we received reports of failed allocations in genwqe code:

[  733.550955] genwqe_gzip: page allocation failure: order:1, mode:0x20
[  733.550964] CPU: 2 PID: 1846 Comm: genwqe_gzip Not tainted 4.3.0-rc3-00042-g3225031 #78
[  733.550968]        000000002782b830 000000002782b8c0 0000000000000002 0000000000000000
       000000002782b960 000000002782b8d8 000000002782b8d8 00000000001134a0
       0000000000000000 0000000000892b2a 0000000000871d0a 000000000000000b
       000000002782b920 000000002782b8c0 0000000000000000 0000000000000000
       0000000000000000 00000000001134a0 000000002782b8c0 000000002782b920
[  733.551003] Call Trace:
[  733.551013] ([&lt;0000000000113388&gt;] show_trace+0xf8/0x158)
[  733.551018]  [&lt;0000000000113452&gt;] show_stack+0x6a/0xe8
[  733.551024]  [&lt;00000000004611d4&gt;] dump_stack+0x7c/0xd8
[  733.551031]  [&lt;000000000024dc22&gt;] warn_alloc_failed+0xda/0x150
[  733.551036]  [&lt;000000000025268e&gt;] __alloc_pages_nodemask+0x94e/0xbc0
[  733.551041]  [&lt;000000000012bcd8&gt;] s390_dma_alloc+0x70/0x1a0
[  733.551054]  [&lt;000003ff804d8e8c&gt;] __genwqe_alloc_consistent+0x84/0xd0 [genwqe_card]
[  733.551063]  [&lt;000003ff804d90c2&gt;] genwqe_alloc_sync_sgl+0x13a/0x328 [genwqe_card]
[  733.551066]  [&lt;000003ff804d41a0&gt;] do_execute_ddcb+0x1f8/0x388 [genwqe_card]
[  733.551069]  [&lt;000003ff804d48c8&gt;] genwqe_ioctl+0x598/0xd50 [genwqe_card]
[  733.551072]  [&lt;00000000002cc90c&gt;] do_vfs_ioctl+0x3f4/0x590
[  733.551074]  [&lt;00000000002ccb46&gt;] SyS_ioctl+0x9e/0xb0
[  733.551078]  [&lt;00000000006c8166&gt;] system_call+0xd6/0x258
[  733.551080]  [&lt;000003fffd25819a&gt;] 0x3fffd25819a
[  733.551082] no locks held by genwqe_gzip/1846.

This specific allocation and some others in genwqe are unnecessary flagged
as atomic.

All of genwqe's atomic allocations happen in a context where it's allowed
to sleep. Change these to use GFP_KERNEL.

Signed-off-by: Sebastian Ott &lt;sebott@linux.vnet.ibm.com&gt;
Acked-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>mm: mark most vm_operations_struct const</title>
<updated>2015-09-10T20:29:01+00:00</updated>
<author>
<name>Kirill A. Shutemov</name>
<email>kirill.shutemov@linux.intel.com</email>
</author>
<published>2015-09-09T22:39:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7cbea8dc0127a95226c7722a738ac6534950ef67'/>
<id>urn:sha1:7cbea8dc0127a95226c7722a738ac6534950ef67</id>
<content type='text'>
With two exceptions (drm/qxl and drm/radeon) all vm_operations_struct
structs should be constant.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Reviewed-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>GenWQE: remove unnecessary version.h inclusion</title>
<updated>2015-01-12T13:04:11+00:00</updated>
<author>
<name>Fabian Frederick</name>
<email>fabf@skynet.be</email>
</author>
<published>2014-12-29T14:32:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0ecb3dffb1f56f03cbce91fe8b03d52c2980c13b'/>
<id>urn:sha1:0ecb3dffb1f56f03cbce91fe8b03d52c2980c13b</id>
<content type='text'>
Based on versioncheck.

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'char-misc-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc</title>
<updated>2014-12-15T00:43:47+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-12-15T00:43:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6ae840e7cc4be0be3aa40d9f67c35c75cfc67d83'/>
<id>urn:sha1:6ae840e7cc4be0be3aa40d9f67c35c75cfc67d83</id>
<content type='text'>
Pull char/misc driver updates from Greg KH:
 "Here's the big char/misc driver update for 3.19-rc1

  Lots of little things all over the place in different drivers, and a
  new subsystem, "coresight" has been added.  Full details are in the
  shortlog"

* tag 'char-misc-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (73 commits)
  parport: parport_pc, do not remove parent devices early
  spmi: Remove shutdown/suspend/resume kernel-doc
  carma-fpga-program: drop videobuf dependency
  carma-fpga: drop videobuf dependency
  carma-fpga-program.c: fix compile errors
  i8k: Fix temperature bug handling in i8k_get_temp()
  cxl: Name interrupts in /proc/interrupt
  CXL: Return error to PSL if IRQ demultiplexing fails &amp; print clearer warning
  coresight-replicator: remove .owner field for driver
  coresight: fixed comments in coresight.h
  coresight: fix typo in comment in coresight-priv.h
  coresight: bindings for coresight drivers
  coresight: Adding ABI documentation
  w1: support auto-load of w1_bq27000 module.
  w1: avoid potential u16 overflow
  cn: verify msg-&gt;len before making callback
  mei: export fw status registers through sysfs
  mei: read and print all six FW status registers
  mei: txe: add cherrytrail device id
  mei: kill cached host and me csr values
  ...
</content>
</entry>
<entry>
<title>assorted conversions to %p[dD]</title>
<updated>2014-11-19T18:01:20+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-10-22T00:11:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a455589f181e60439c736c6c6a068bb7e6dc23f0'/>
<id>urn:sha1:a455589f181e60439c736c6c6a068bb7e6dc23f0</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>misc: genwqe: check for error from get_user_pages_fast()</title>
<updated>2014-11-07T18:26:46+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=cf35d6e0475982667b0d2d318fb27be4b8849827'/>
<id>urn:sha1:cf35d6e0475982667b0d2d318fb27be4b8849827</id>
<content type='text'>
`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;
Cc: &lt;stable@vger.kernel.org&gt; # 3.14.x # 3.15.x # 3.16.x # 3.17.x
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>
</feed>
