Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1253556pxa; Thu, 20 Aug 2020 06:51:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiEDuPXh0/VM2urydvFsogfr1l6TStHGuSzaJvKx4LPCxWRGoTx7Eta/ONWi6/Q7NxhciK X-Received: by 2002:a17:906:d786:: with SMTP id pj6mr3421856ejb.261.1597931483402; Thu, 20 Aug 2020 06:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931483; cv=none; d=google.com; s=arc-20160816; b=yIV4NM3bxNRJSJYkfZ33zHxhwPmuJuRjvWaRZBViUr8EVm46jKTbYUQQZ8+mqjcntJ hno1HVXBAAY8N60xWeP5JIKaNfSkTJD7Gp8jyXvPCyMGswPhLoFxvaDMQnmWhWW2Cy5+ wB0wit9oydovIjnCeNzy1oCGSnjzB5VJ1qgVZCEr4S1lCfatYodA0z+L6J7nh2AMuGOq wyJx7yYN+UE5O6YpPJzElmZi/4C6FhHDGbCbqzBKyS5rgUisHDT4n1jduwWiv/MdK0OT R0GspqHKIjKAXc83ABFyDoWDlE7vVRrfCbgEMB7CrIV+8uOju3/NpO381LcyzBTKTjxF pVGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=S+rXrsf+tOZ/2nm3bMcKCYhjHjUcIU7aaam9dDwuOk4=; b=dWnC5PHS6aBZXKIzcJJSRuH79lApNzhfUS7tzrBM7cuPMVnuU2ORoXPzjZdy+hQ7yN HdcZmVuL3mRwbmI9MIWCDYT5M1fk4WWSZf2UwrXTMiKTNJoU+WNobcJdzvoKdble4qjI CBrIDTqsCY3y8/eVgrpQLrVm7vypFARDZgNCvyMEgdb83b0GKb+d/sNRXHL9IXvAetO7 3StcO+x7fHtF/sguJNn/aL5EBS+vYNZwh8Nzcw7HZb5AClxmIeEqhiIsKYfVvO2hZEzN /eRmke17jRvNDESD4yDSIWEGl4EFZGABoHhQG6JI7QWRCRqB8TK6OYuF+oHOwBw+Hrdm iCCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QVZU1qKH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si1246202ejh.441.2020.08.20.06.50.59; Thu, 20 Aug 2020 06:51:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QVZU1qKH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730388AbgHTNpq (ORCPT + 99 others); Thu, 20 Aug 2020 09:45:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:37472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726908AbgHTJ1p (ORCPT ); Thu, 20 Aug 2020 05:27:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 8378B22D06; Thu, 20 Aug 2020 09:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915665; bh=/pAvMKa+8PzqG9VMQ//rGLClT6PLL9jtalg44Ovo9+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QVZU1qKHy+71+1+A4dMuopodEsCbHenhaEV62JJxQ9+Dqyb5k8eR1DdlgLJQHuM10 I56gLS1diSM6dZmQJawjS/83meUliwnS//uMmmg2YrDUMdFJSgr7w0o10jlYgY/Nqo nifsTJn49sP+912Lz6kNQqX99denlmeS1wGPyN9M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tycho Andersen , Kees Cook Subject: [PATCH 5.8 063/232] selftests/seccomp: Set NNP for TSYNC ESRCH flag test Date: Thu, 20 Aug 2020 11:18:34 +0200 Message-Id: <20200820091615.845518621@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kees Cook commit e4d05028a07f505a08802a6d1b11674c149df2b3 upstream. The TSYNC ESRCH flag test will fail for regular users because NNP was not set yet. Add NNP setting. Fixes: 51891498f2da ("seccomp: allow TSYNC and USER_NOTIF together") Cc: stable@vger.kernel.org Reviewed-by: Tycho Andersen Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/seccomp/seccomp_bpf.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -3258,6 +3258,11 @@ TEST(user_notification_with_tsync) int ret; unsigned int flags; + ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); + ASSERT_EQ(0, ret) { + TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!"); + } + /* these were exclusive */ flags = SECCOMP_FILTER_FLAG_NEW_LISTENER | SECCOMP_FILTER_FLAG_TSYNC;