]> git.baikalelectronics.ru Git - kernel.git/commit
s390/qdio: fix access to uninitialized qdio_q fields
authorJulian Wiedmann <jwi@linux.ibm.com>
Wed, 2 May 2018 06:48:43 +0000 (08:48 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 15 May 2018 05:40:36 +0000 (07:40 +0200)
commit75fb0e58295041d490b21fea37f8618ab4460af6
tree553f2eef978d0dd921ae653d118fa22719dce281
parentbc9ac6d5500342230f52d6b57c51c608c521ce66
s390/qdio: fix access to uninitialized qdio_q fields

Ever since CQ/QAOB support was added, calling qdio_free() straight after
qdio_alloc() results in qdio_release_memory() accessing uninitialized
memory (ie. q->u.out.use_cq and q->u.out.aobs). Followed by a
kmem_cache_free() on the random AOB addresses.

For older kernels that don't have 13ad82d13c55, the same applies if
qdio_establish() fails in the DEV_STATE_ONLINE check.

While initializing q->u.out.use_cq would be enough to fix this
particular bug, the more future-proof change is to just zero-alloc the
whole struct.

Fixes: 472cc698f082 ("qdio: support asynchronous delivery of storage blocks")
Cc: <stable@vger.kernel.org> #v3.2+
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/qdio_setup.c