From 2709abc88376efe80d7d5ef6d9d4e740d5c9afcb Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 21 Apr 2010 15:33:37 +0300 Subject: [PATCH] msync() also may be called on unaligned address. --- src/x86/Ginit.c | 4 ++-- src/x86_64/Ginit.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x86/Ginit.c b/src/x86/Ginit.c index 4ed88bbd..0af616a5 100644 --- a/src/x86/Ginit.c +++ b/src/x86/Ginit.c @@ -103,9 +103,9 @@ validate_mem (unw_word_t addr) } #ifdef HAVE_MINCORE - if (mincore ((void *) addr, 1, mvec) == -1) + if (mincore ((void *) addr, sizeof (unw_word_t), mvec) == -1) #else - if (msync ((void *) addr, 1, MS_ASYNC) == -1) + if (msync ((void *) addr, sizeof (unw_word_t), MS_ASYNC) == -1) #endif return -1; diff --git a/src/x86_64/Ginit.c b/src/x86_64/Ginit.c index 790f88be..ac5ea66f 100644 --- a/src/x86_64/Ginit.c +++ b/src/x86_64/Ginit.c @@ -104,7 +104,7 @@ validate_mem (unw_word_t addr) #ifdef HAVE_MINCORE if (mincore ((void *) addr, sizeof (unw_word_t), mvec) == -1) #else - if (msync ((void *) addr, 1, MS_ASYNC) == -1) + if (msync ((void *) addr, sizeof (unw_word_t), MS_ASYNC) == -1) #endif return -1;