Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1056350pxu; Thu, 17 Dec 2020 00:41:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwY0HQsvI1famjDle2vqNuvK9Wjji6xvdUOB+h8nnDdcH0IV5uHMcwypUugNB/wUg9+2oBE X-Received: by 2002:a17:906:354a:: with SMTP id s10mr34722728eja.335.1608194462383; Thu, 17 Dec 2020 00:41:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608194462; cv=none; d=google.com; s=arc-20160816; b=uTShyQ1pvkocS0LoBLm1yAyRjtY8nkQoAxsCCUoVYLDXZIVCfjUOs5kD9B8OnREpaq 4RnuvTvo6+1Wa4ask/zzAJP1hruO/oKP4pXESIow/N/9xSPJXe63yfmyhBwPmy4TRFMW EoMvAdoNhL5Tl11Xnj6e4VLXmk+0HZEOKFRaS5Pl3+P91V/3rtiohMkwpoTwGOEMPfE0 QKNiDJV1Cz/9bi9S5XhG57V6WzAjhGL9TEVHwiA/5d+u5+DZHXUiqDbN7N/Z4xxC2Al3 OMmdv67MUIrYR+9g4VUu71cfRoQKY2iOAXTbBK4oWD/r3lu84HDD45ut8kwDu4nIsy// 7xrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=3lld4mpflayWnPYoEXRoB+2KaZFa0pc6MHgiVjiPH/c=; b=BvryfPGj2+ybCQOXlM9MCCWPHR7k64e+0IoDLWnufkNwQzTFnCMyZHWVBfbBkBocGU kvFlOUxqCHcfPebxG+XJuOVzLFq2vIdNDfKY20lUp9AiBCPk3INs0EXqpevtzx7wEHXB cW5Sb05d2QS7/KwDykzxQ/K0rCVpyMDh6clzqUy2rKVhktv23MdomFrkixUx0TusOZqt zv+BHW9pMs5R3Zvyh/IeHGuzXWRTK6V8f7I2iOyUOX5uW3ApdlqGjb+UMx1a8jAcWYvj xAsm//gqlF3SaT6Rb7RUqXKSxljiu7rJ4VYNXtPblyTyibVoLW20kOi6iIA5Kk5KAf1L XyUA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si4448720edc.387.2020.12.17.00.40.39; Thu, 17 Dec 2020 00:41:02 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727255AbgLQIkK (ORCPT + 99 others); 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 Content-Type: text/plain X-Originating-IP: [10.44.142.101] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: zhuling Signed-off-by: zhuling --- samples/bpf/tracex5_user.c | 2 +- samples/seccomp/dropper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.9.5