From patchwork Thu Dec 17 07:54:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhuling X-Patchwork-Id: 11979255 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCA92C2BB9A for ; Thu, 17 Dec 2020 08:40:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E5012389A for ; Thu, 17 Dec 2020 08:40:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726864AbgLQIkK (ORCPT ); Thu, 17 Dec 2020 03:40:10 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:9899 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbgLQIkK (ORCPT ); Thu, 17 Dec 2020 03:40:10 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CxQPw5Psrz7Fp9; Thu, 17 Dec 2020 16:38:44 +0800 (CST) Received: from huawei.com (10.44.142.101) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Thu, 17 Dec 2020 16:39:16 +0800 From: Zhuling To: , , , , , , , , , , CC: , Subject: [PATCH] Modify hardcode 2 to SECCOMP_MODE_FILTER Date: Thu, 17 Dec 2020 15:54:13 +0800 Message-ID: <20201217075413.19314-1-zhuling8@huawei.com> X-Mailer: git-send-email 2.9.5 MIME-Version: 1.0 X-Originating-IP: [10.44.142.101] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net From: zhuling Signed-off-by: zhuling --- samples/bpf/tracex5_user.c | 2 +- samples/seccomp/dropper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.9.5 diff --git a/samples/bpf/tracex5_user.c b/samples/bpf/tracex5_user.c index c17d3fb..417753f 100644 --- a/samples/bpf/tracex5_user.c +++ b/samples/bpf/tracex5_user.c @@ -28,7 +28,7 @@ static void install_accept_all_seccomp(void) .len = (unsigned short)(sizeof(filter)/sizeof(filter[0])), .filter = filter, }; - if (prctl(PR_SET_SECCOMP, 2, &prog)) + if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) perror("prctl"); } diff --git a/samples/seccomp/dropper.c b/samples/seccomp/dropper.c index cc0648e..08f8e7f 100644 --- a/samples/seccomp/dropper.c +++ b/samples/seccomp/dropper.c @@ -46,7 +46,7 @@ static int install_filter(int nr, int arch, int error) perror("prctl(NO_NEW_PRIVS)"); return 1; } - if (prctl(PR_SET_SECCOMP, 2, &prog)) { + if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) { perror("prctl(PR_SET_SECCOMP)"); return 1; }