From: Zhao Hongjiang Date: Fri, 26 Apr 2013 03:03:53 +0000 (+0800) Subject: aio: fix possible invalid memory access when DEBUG is enabled X-Git-Tag: v3.2.45~117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf0f91c05b5abf5fafa0b1118db4c33fc011fcd1;p=people%2Fms%2Flinux.git aio: fix possible invalid memory access when DEBUG is enabled commit 91d80a84bbc8f28375cca7e65ec666577b4209ad upstream. dprintk() shouldn't access @ring after it's unmapped. Signed-off-by: Zhao Hongjiang Signed-off-by: Linus Torvalds [bwh: Backported to 3.2: keep the second argument to kunmap_atomic()] Signed-off-by: Ben Hutchings --- diff --git a/fs/aio.c b/fs/aio.c index 3b65ee767ce6..8cdd8ea0f44a 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1112,9 +1112,9 @@ static int aio_read_evt(struct kioctx *ioctx, struct io_event *ent) spin_unlock(&info->ring_lock); out: - kunmap_atomic(ring, KM_USER0); dprintk("leaving aio_read_evt: %d h%lu t%lu\n", ret, (unsigned long)ring->head, (unsigned long)ring->tail); + kunmap_atomic(ring, KM_USER0); return ret; }