Skip to content

Commit e521813

Browse files
julianwiedmannMartin Schwidefsky
authored andcommitted
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 6e30c54, 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: 104ea55 ("qdio: support asynchronous delivery of storage blocks") Cc: <[email protected]> #v3.2+ Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
1 parent 4bbaf25 commit e521813

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/s390/cio/qdio_setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int __qdio_allocate_qs(struct qdio_q **irq_ptr_qs, int nr_queues)
141141
int i;
142142

143143
for (i = 0; i < nr_queues; i++) {
144-
q = kmem_cache_alloc(qdio_q_cache, GFP_KERNEL);
144+
q = kmem_cache_zalloc(qdio_q_cache, GFP_KERNEL);
145145
if (!q)
146146
return -ENOMEM;
147147

0 commit comments

Comments
 (0)