From 92b26d8804b4e500e2ad4e403cf57a62f9dc79f5 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 5 Apr 2012 15:43:00 +0400 Subject: [PATCH] check: prctl -- Add PR_SET_MM_AUXV test The ability to set PR_SET_MM_AUXV is implemented in kernel as a separate PR_SET_MM extension, so we need to test if the kernel patch is applied on a running system. Signed-off-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- cr-check.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cr-check.c b/cr-check.c index de79e40fa..2ed70e851 100644 --- a/cr-check.c +++ b/cr-check.c @@ -77,6 +77,7 @@ static int check_kcmp(void) static int check_prctl(void) { + unsigned long user_auxv = 0; unsigned int *tid_addr; int ret; @@ -98,6 +99,12 @@ static int check_prctl(void) return -1; } + ret = sys_prctl(PR_SET_MM, PR_SET_MM_AUXV, (long)&user_auxv, sizeof(user_auxv), 0); + if (ret) { + pr_msg("prctl: PR_SET_MM_AUXV is not supported\n"); + return -1; + } + return 0; }