From patchwork Sun Jun 17 11:23:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10468819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 64EDB6029B for ; Sun, 17 Jun 2018 11:36:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55C9528874 for ; Sun, 17 Jun 2018 11:36:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A1FD28A1B; Sun, 17 Jun 2018 11:36:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6FC828874 for ; Sun, 17 Jun 2018 11:36:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D14BB6B0275; Sun, 17 Jun 2018 07:36:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C9CA86B0276; Sun, 17 Jun 2018 07:36:48 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3D716B0277; Sun, 17 Jun 2018 07:36:48 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id 6C33F6B0275 for ; Sun, 17 Jun 2018 07:36:48 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id j8-v6so1328347pfn.6 for ; Sun, 17 Jun 2018 04:36:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:subject:to:cc:from:date :message-id:mime-version:content-transfer-encoding; bh=a+cIbDH1hDhuX2n6j2N5IMpDkxlcGymE1b/F4t7DFvw=; b=LgD3d+chV6Obomw0lH7CfcER75/6fOAFtKzx/R/cIgpYjINMWUfFqUCQOTNn0cvguY 1woYm3VWX9z1wpmhYGBtNo7Kv5BVYP6XjUNsIrLSno+Xk7QNZvHTg5XwwcL4SGOele+o NwFGMQO3rpd1SNME4JQuyPgt8dNBqepspiyC77W3KQw2e0myYWgGTH4TfA5powsghvpc tkeINwJu//tOMbSTVOb+5CpWgFE3va+i3tnu0xu/kBexPbExOBi3PleGmEujnw85/0QJ LOV9IXsCMnOEzKRoGVptCf6CsIPchl/Ri9b9TtzeYwtmC6tK9hEnQh6S/ckhFXCb5PgF TU0Q== X-Gm-Message-State: APt69E2YtIzlKOGrd7aVMRgKkXudTJP8xl4layZHi/+CoW45KdmQbJHw Dsr841VW2inGJ7hYiDsggWEDzTh7wlbn1pVVabBp+3N65/JuC5MdwX8bLb44LIzGMbgcsb1eNrJ 0p48QWJ+Q7Uem0GTO9BErwPQ/04Txhk/1svhu6OfpU735UQpW0jvdxd9dDoUB/R8= X-Received: by 2002:a63:770c:: with SMTP id s12-v6mr7574480pgc.17.1529235408108; Sun, 17 Jun 2018 04:36:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL5asQAggkyzEGDwE5/RjvtGVr2EpSIgHnDm409UkN1CXqgVTNH9riL5sE7VZRRFGR4OPih X-Received: by 2002:a63:770c:: with SMTP id s12-v6mr7574451pgc.17.1529235407387; Sun, 17 Jun 2018 04:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529235407; cv=none; d=google.com; s=arc-20160816; b=D6lik5KzLs5g+u3z4y3tVAXdqPWIv5UsUtQYUtlb1qG8cVRUvSiW0ADVzBORCC5bfG yWLNKKdKeD5gmJW5jkdark8ifStKli9Hdb+6HCDmXgXdtiHWDeqMadNl7Nebl+1oLZ+h o7rPlV9KUnzJuIjJROVVpZtSeou0TV8g+YTKaNeq7HU+QIuvjhlOJ0qDtxrlUh26AV7j LGkasOhipDF7Y7PWkDe5ui6D1iRW4lhsaZmIR1vtv0rmTWMF9WPOyp189z48Le/aB7MB pRKPDpDtzuUCzKeYm63sAzax8k+2ukxLQq8tl47Zpl50V7vXO/Ym6VQtoL7/A49dgnyG 922A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:from:cc:to :subject:dkim-signature:arc-authentication-results; bh=a+cIbDH1hDhuX2n6j2N5IMpDkxlcGymE1b/F4t7DFvw=; b=GSUpBhq/atnj8KIG+9Nw1RNAPwWT+ltVup8nYWVnp7FYZEEQKMd7qbpvngClkc3wRL iAdw6dq08t+30VABVKdsIThAlqib1bgyX6llzZzENHH9EUTf1mqqFe/uyxtPay0NI0cU EYPARh07cKlZr2IEUFyTsPWC6mTvwzfyb/RsLXhRPLW7AQkvKTyensGYamaYBEzdrs0c VlBW/VU2w5YMskhJo+N+MEZrIGV0G9fOcrWz3tR5w4k9Qx8GFCQpFMi9WJkvWQZW1Lxk rcdy76yGsqGaWDLQfaR/ZX1UVviOgpH3KBTYyhOxeU7OjQP/yFv8P238moxVoftlI+UV 9grw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WQKvTHyB; spf=pass (google.com: domain of srs0=nxds=jd=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom="SRS0=nXdS=JD=linuxfoundation.org=gregkh@kernel.org" Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id u1-v6si12874832plj.386.2018.06.17.04.36.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jun 2018 04:36:47 -0700 (PDT) Received-SPF: pass (google.com: domain of srs0=nxds=jd=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WQKvTHyB; spf=pass (google.com: domain of srs0=nxds=jd=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom="SRS0=nXdS=JD=linuxfoundation.org=gregkh@kernel.org" Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 81228208E6; Sun, 17 Jun 2018 11:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1529235407; bh=7CCPzZIezeEJcEdX/MbErXIQ4TAEe1aH8FAJ9LtPU4I=; h=Subject:To:Cc:From:Date:From; b=WQKvTHyB/+PPF6aJs9OoP1B26139NoIPnAkQKH72zTiBssaSjnkDmZsJjG5OmhsYW vNVRj65hw4+jjlRcs5230/kxxfqzTq91CW7mgZ6fnmeMe4Tqfty1zXofgu9ZvpsxeA jHu060hbeQQlJW05oeF7N4QXHelQp7NaVYvPFrC8= Subject: Patch "x86/pkeys/selftests: Stop using assert()" has been added to the 4.14-stable tree To: 20180509171340.E63EF7DA@viggo.jf.intel.com, akpm@linux-foundation.org, alexander.levin@microsoft.com, dave.hansen@intel.com, dave.hansen@linux.intel.com, gregkh@linuxfoundation.org, linux-mm@kvack.org, linuxram@us.ibm.com, mingo@kernel.org, mpe@ellerman.id.au, peterz@infradead.org, shuah@kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org Cc: From: Date: Sun, 17 Jun 2018 13:23:32 +0200 Message-ID: <152923461218610@kroah.com> MIME-Version: 1.0 X-stable: commit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP This is a note to let you know that I've just added the patch titled x86/pkeys/selftests: Stop using assert() to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: x86-pkeys-selftests-stop-using-assert.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From foo@baz Sun Jun 17 12:13:49 CEST 2018 From: Dave Hansen Date: Wed, 9 May 2018 10:13:40 -0700 Subject: x86/pkeys/selftests: Stop using assert() From: Dave Hansen [ Upstream commit 86b9eea230edf4c67d4d4a70fba9b74505867a25 ] If we use assert(), the program "crashes". That can be scary to users, so stop doing it. Just exit with a >0 exit code instead. Signed-off-by: Dave Hansen Cc: Andrew Morton Cc: Dave Hansen Cc: Linus Torvalds Cc: Michael Ellermen Cc: Peter Zijlstra Cc: Ram Pai Cc: Shuah Khan Cc: Thomas Gleixner Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/20180509171340.E63EF7DA@viggo.jf.intel.com Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/x86/protection_keys.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) Patches currently in stable-queue which might be from dave.hansen@linux.intel.com are queue-4.14/x86-pkeys-selftests-factor-out-instruction-page.patch queue-4.14/x86-pkeys-selftests-fix-pointer-math.patch queue-4.14/x86-pkeys-selftests-adjust-the-self-test-to-fresh-distros-that-export-the-pkeys-abi.patch queue-4.14/x86-pkeys-selftests-add-a-test-for-pkey-0.patch queue-4.14/x86-pkeys-selftests-stop-using-assert.patch queue-4.14/x86-pkeys-selftests-save-off-prot-for-allocations.patch queue-4.14/x86-pkeys-selftests-remove-dead-debugging-code-fix-dprint_in_signal.patch queue-4.14/x86-mpx-selftests-adjust-the-self-test-to-fresh-distros-that-export-the-mpx-abi.patch queue-4.14/x86-pkeys-selftests-add-prot_exec-test.patch queue-4.14/x86-pkeys-selftests-allow-faults-on-unknown-keys.patch queue-4.14/x86-pkeys-selftests-give-better-unexpected-fault-error-messages.patch queue-4.14/x86-pkeys-selftests-fix-pkey-exhaustion-test-off-by-one.patch --- a/tools/testing/selftests/x86/protection_keys.c +++ b/tools/testing/selftests/x86/protection_keys.c @@ -72,10 +72,9 @@ extern void abort_hooks(void); test_nr, iteration_nr); \ dprintf0("errno at assert: %d", errno); \ abort_hooks(); \ - assert(condition); \ + exit(__LINE__); \ } \ } while (0) -#define raw_assert(cond) assert(cond) void cat_into_file(char *str, char *file) { @@ -87,12 +86,17 @@ void cat_into_file(char *str, char *file * these need to be raw because they are called under * pkey_assert() */ - raw_assert(fd >= 0); + if (fd < 0) { + fprintf(stderr, "error opening '%s'\n", str); + perror("error: "); + exit(__LINE__); + } + ret = write(fd, str, strlen(str)); if (ret != strlen(str)) { perror("write to file failed"); fprintf(stderr, "filename: '%s' str: '%s'\n", file, str); - raw_assert(0); + exit(__LINE__); } close(fd); }