From: Richard Palethorpe Date: Tue, 18 Jul 2017 09:33:18 +0200 Subject: [LTP] [PATCH 3/4] CVE-2012-0957: Use SAFE_PERSONALITY In-Reply-To: <20170718073319.23543-1-rpalethorpe@suse.com> References: <20170718073319.23543-1-rpalethorpe@suse.com> Message-ID: <20170718073319.23543-4-rpalethorpe@suse.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it Signed-off-by: Richard Palethorpe --- testcases/cve/cve-2012-0957.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/testcases/cve/cve-2012-0957.c b/testcases/cve/cve-2012-0957.c index f065735a1..3b92325d6 100644 --- a/testcases/cve/cve-2012-0957.c +++ b/testcases/cve/cve-2012-0957.c @@ -26,10 +26,8 @@ #include #include -#include #include "tst_test.h" - -#define UNAME26 0x0020000 +#include "tst_personality.h" static int check_field(char *bytes, size_t length, char *field) { @@ -75,9 +73,7 @@ static void run(unsigned int test_nr) tst_res(TINFO, "Calling uname with default personality"); try_leak_bytes(); } else { - if (personality(PER_LINUX | UNAME26) < 0) - tst_brk(TCONF | TERRNO, - "Could not change personality to UNAME26"); + SAFE_PERSONALITY(PER_LINUX | UNAME26); tst_res(TINFO, "Calling uname with UNAME26 personality"); try_leak_bytes(); } -- 2.13.2