[CRIU] [PATCH] criu: lazy-pages: take care of possible NULL pointer dereference

Mike Rapoport rppt at linux.vnet.ibm.com
Wed Jun 15 22:06:48 PDT 2016


Fix CID 163485 (#2 of 2): Dereference null return value (NULL_RETURNS)
7. dereference: Dereferencing a pointer that might be null dest when
calling handle_user_fault.

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/uffd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/criu/uffd.c b/criu/uffd.c
index 61100b8..988e311 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -730,6 +730,7 @@ static int handle_requests(int epollfd, struct epoll_event *events)
 
 		for (i = 0; i < ret; i++) {
 			lpi = uffd_to_lpi(events[i].data.fd);
+			BUG_ON(!lpi);
 			ret = handle_user_fault(lpi, dest);
 			if (ret < 0)
 				goto out;
-- 
1.9.1



More information about the CRIU mailing list