From 5166fdde7fa72e6448663099734ff3b67f25cb99 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Fri, 18 Mar 2016 19:04:01 +0000 Subject: [PATCH] aio_qphysio(): Avoid uninitialized pointer read on error. For the !unmap case it may happen that pbuf gets called unreferenced when vm_fault_quick_hold_pages() fails. Initialize it so it doesn't cause trouble. CID: 1352776 Reviewed by: jhb MFC after: 1 week --- sys/kern/vfs_aio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 27fa23908ecf..95e4c53ea0ab 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1226,7 +1226,8 @@ aio_qphysio(struct proc *p, struct kaiocb *job) if (!unmap) { job->pbuf = pbuf = (struct buf *)getpbuf(NULL); BUF_KERNPROC(pbuf); - } + } else + pbuf = NULL; AIO_LOCK(ki); if (!unmap)