From c6ee60b36275a61889e713f05c2996aa6975a5a0 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Fri, 16 Mar 2012 15:01:58 -0400 Subject: [PATCH] [driver] fixing possible app/driver/nfsd race entry->filename points to something the app address space. if app was started and the ctrl-ed c, then when nfsd picks up the upcall it should check if the pointer is still valid --- sys/nfs41_driver.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c index ae854a1..cd9741b 100644 --- a/sys/nfs41_driver.c +++ b/sys/nfs41_driver.c @@ -558,10 +558,13 @@ NTSTATUS marshal_nfs41_header( tmp += sizeof(HANDLE); #ifdef DEBUG_MARSHAL_HEADER - DbgP("[upcall header] xid=%lld opcode=%s filename=%wZ version=%d " - "session=0x%x open_state=0x%x\n", entry->xid, - opcode2string(entry->opcode), entry->filename, - entry->version, entry->session, entry->open_state); + if (MmIsAddressValid(entry->filename)) + DbgP("[upcall header] xid=%lld opcode=%s filename=%wZ version=%d " + "session=0x%x open_state=0x%x\n", entry->xid, + opcode2string(entry->opcode), entry->filename, + entry->version, entry->session, entry->open_state); + else + status = STATUS_INTERNAL_ERROR; #endif out: return status;