Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1083664pxu; Thu, 17 Dec 2020 01:33:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxl0DRy2mc7TnYIUyf04JAVcZuDmtxGIy2PyOwNVv798gT9B1/3KGnk1can6iJ+5YRlgGdh X-Received: by 2002:a17:906:5f97:: with SMTP id a23mr23372504eju.128.1608197606078; Thu, 17 Dec 2020 01:33:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608197606; cv=none; d=google.com; s=arc-20160816; b=iSwzY4PAiYK3wYz6Hqhef9LoINAYgYXLqfrC+p/ziVd4Xhg5z3DHpT+3EeZAWmMhP2 +ayRUK1OJeJ9hNJsH7xhK+bkW2h51qTVTN3RXPCqgoPcg/Qm3ViKR9j5JLwASqeudAoV G7udHOOkIwBr6fb9ZTUOuG3N/pdNzvfWQuZnvX6LjF0lA2ieu7TltyZc5lJlKpD0Qwoh jxoBDdhp3fsCq+jNi63OsQJZ0tpAmvCzVfvfsdV8NkYgSgWbNhURuRsquqlucaBgX0hv l/ZmLn3pWWOX1r53nOjy7Zzol+KxiwII0nh+l5icRC1YMGscR/QKK3xbq5kz9Ie/xFUI XmEQ== 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=1JtcTpy/S+Llr1B1911cF9LWYPxzwxqBFDg7R5WcOTg=; b=IoJylU7ljib1Akq5rGb9Dv/B9Qk2mLLG5Tm69RCf4r/ZJQaKTzRLouPHICUy54fxlK CsScC6ttX8tPOkSzCTKOSl56WKv8MPR8OrPxSHRMnXKvIlECIWliiFtn0br9SoIwanBE /T79pWgWqC5/eVSVC7dsAZ4Miw3ZM+zHRmeTYRkLiksMaKGsXzuzaq6aYMToWKFnid7d seV/7wKF2mE9HWocn0ANHMPTWF6mDCtF8S1hWWE2oH0c5VV+tT5gZTHMzSlNrZg9sjqJ vDWweQL4NNuhNi5PT34/bmeEia/PfGebUkHDpFeDyUiFyhKCiuihiWK0At8OXYcOR/Rq mmaw== 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 od20si2321169ejb.621.2020.12.17.01.33.03; Thu, 17 Dec 2020 01:33:26 -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 S1725871AbgLQJc3 (ORCPT + 99 others); Thu, 17 Dec 2020 04:32:29 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:9900 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbgLQJc0 (ORCPT ); Thu, 17 Dec 2020 04:32:26 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CxRZK57hgz7Fwt; Thu, 17 Dec 2020 17:31:05 +0800 (CST) Received: from huawei.com (10.44.142.101) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Thu, 17 Dec 2020 17:31:36 +0800 From: Zhuling To: , , , , , , , , , , CC: , , Subject: [PATCH] Modify hardcode to SECCOMP_MODE_FILTER Date: Thu, 17 Dec 2020 16:46:32 +0800 Message-ID: <20201217084632.67251-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 bpf/seccomp: modify hardcode 2 to SECCOMP_MODE_FILTER while the hardcode 2 has been define in seccomp_bpf.c, we should use the definitions(SECCOMP_MODE_FILTER) instead of hardcode 2. 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