Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp441374lqi; Thu, 7 Mar 2024 01:40:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU5tsvoYjtq6QzI3hWfKWQOb0XOsPXAyguWh51ZLzdFY6cjDN9scuaNH8r1vlHhpzqYPWlntxnbqrBmIFL5DLqswQuQqH6N+NxAvKQX3w== X-Google-Smtp-Source: AGHT+IHuR1WuFWe0c2lW7XEuKJON2nzIEae/35StL4Z2Qbw3IC8u8bOO4mson2HdmFSiPmuiekRc X-Received: by 2002:a9d:6b9a:0:b0:6e4:e94e:c104 with SMTP id b26-20020a9d6b9a000000b006e4e94ec104mr7425873otq.9.1709804446802; Thu, 07 Mar 2024 01:40:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709804446; cv=pass; d=google.com; s=arc-20160816; b=o6k7DqfR+To7HhtGJwadfg86QGQx7frUAScA5GjJuiiR5ueP+xk18gStq72L4EinPn fWswkUFs88XLy65FeXmibMf/Y0Bn3e69DT0eeJRpoSA8bzL7vP3CD8SgJDI5jDzbr9z9 RAsf7oo0LQ1GSWbx0ds7hcqiXJa2ZSEXjonv7RLJulpdxMch2V4MsCAyBpAd+o724zC3 CSscZFR6SG7ovvIZ8HlJf7D8BxpM4XZ7t+tKV6jv8MGpwc6Uq5iHhtR5pgACO//dS/kZ A3Iu7VV6/efNHcRj2+DIcggDWPWF4yBFPWSRCjbVdm+z1RVLoepmBwrmEh8jALd25U5h PjeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VRxLLzh0NQVEODUW0SOe/caCPV6QPywIINg604GznpA=; fh=l1anugFSFIfYn/YXVWAwDNtTtMeYzYupC43vg5t5F3Q=; b=bI+sMeIJByxh818w08hRdnUHTZftzQBX/RmIsJV1Tr70Q6p667tayzB2qZsRXqlSQR ttbxiPhTOWE2y9I/J+La2esilyoj9oFWILCqP71kkz5RanoNEJZRuU4NiQrkvSa2Nzd8 1rFQQhAp0uCdyITGA+Bb3xhN88iKGU+VyeaqvZIYhX2mTL7tte4g5KrapT7lOwZDO5Yq 4kRcVBqsSKeWX5XHqHHezJj9DUUEe8py+nbDY2TmEi7ZuvVUC139KWlXr0pZqbpdmCpm AflhiS3k5eSZP9ptklPWPvUOXqC2MZC94jdVJ/UaBgHca8Kf118S19jmPWdXGxyMEG+1 kjNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=yPPXjblG; arc=pass (i=1 spf=pass spfdomain=digikod.net dkim=pass dkdomain=digikod.net); spf=pass (google.com: domain of linux-kernel+bounces-95241-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95241-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q3-20020a632a03000000b005d7a78810acsi13017906pgq.278.2024.03.07.01.40.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 01:40:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95241-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=yPPXjblG; arc=pass (i=1 spf=pass spfdomain=digikod.net dkim=pass dkdomain=digikod.net); spf=pass (google.com: domain of linux-kernel+bounces-95241-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95241-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 769D2281B11 for ; Thu, 7 Mar 2024 09:40:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42C1983CCB; Thu, 7 Mar 2024 09:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b="yPPXjblG" Received: from smtp-190f.mail.infomaniak.ch (smtp-190f.mail.infomaniak.ch [185.125.25.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E98A6839EF for ; Thu, 7 Mar 2024 09:39:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.125.25.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709804391; cv=none; b=bS9vlXppgTEriZbnD0j4VklzL4SP4Oenlk9S737uvMqAsbCSF30yY0hiFQdFp7ibxJ8j/0Rkd6J0VYswJfhnPKxRcBn9jODj6dPAq1wmV6nPTX4eZ4DXVtVocbaIywooOBJV4jN2XFNQ6WoOICXn3cT52mxea6PczschE44z+34= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709804391; c=relaxed/simple; bh=KluVRBv/19f0IRGPeyv1rPXZYsvrNfNV39euLt5Oi7I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Qz7xUvm9bKTtxoIL+Q2lPmzMM0rXRruGKmPFfX+x7oDwVnJt2UEdHVzXoelzmMWn7YN5o7OUepqErwl9crLgORcbNHeq1I5IgT/CzruZGGsUIcqBGPHwQl4Nlrav25pH0ZN6/TZnyDitpdlBjirchzzlHecDWt2zfsZn+VSzCfo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net; spf=pass smtp.mailfrom=digikod.net; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b=yPPXjblG; arc=none smtp.client-ip=185.125.25.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=digikod.net Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4Tr45R2qsDz15fF; Thu, 7 Mar 2024 10:39:39 +0100 (CET) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4Tr45Q6rtjzr1; Thu, 7 Mar 2024 10:39:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1709804379; bh=KluVRBv/19f0IRGPeyv1rPXZYsvrNfNV39euLt5Oi7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yPPXjblGjDxz+Oi9NbOFj1XxmtiPFkvsO6TI0jgs/97zDRSLz+CczRcToBOo1JdMq kJHMAk3wS+LTMfIm8D2RjTZLnmHW6ksU+DXJWcE8AvqZCwZI8GTUtFpOgVe1pHkmpS CNM3g4RkWdADHe/K0HQwGBHrdPyMbKBUivzqkoVY= From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= To: =?UTF-8?q?G=C3=BCnther=20Noack?= , Konstantin Meskhidze , Paul Moore Cc: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , "Serge E . Hallyn" , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [PATCH 2/2] landlock: Rename "ptrace" files to "task" Date: Thu, 7 Mar 2024 10:39:23 +0100 Message-ID: <20240307093923.1466071-2-mic@digikod.net> In-Reply-To: <20240307093923.1466071-1-mic@digikod.net> References: <20240307093923.1466071-1-mic@digikod.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha ptrace.[ch] are currently only used for the ptrace LSM hooks but their scope will expand with IPCs and audit support. Rename ptrace.[ch] to task.[ch], which better reflect their content. Similarly, rename landlock_add_ptrace_hooks() to landlock_add_task_hooks(). Keep header files for now. Cc: Günther Noack Cc: Paul Moore Signed-off-by: Mickaël Salaün --- security/landlock/Makefile | 2 +- security/landlock/setup.c | 4 ++-- security/landlock/{ptrace.c => task.c} | 4 ++-- security/landlock/{ptrace.h => task.h} | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) rename security/landlock/{ptrace.c => task.c} (98%) rename security/landlock/{ptrace.h => task.h} (52%) diff --git a/security/landlock/Makefile b/security/landlock/Makefile index c2e116f2a299..b4538b7cf7d2 100644 --- a/security/landlock/Makefile +++ b/security/landlock/Makefile @@ -1,6 +1,6 @@ obj-$(CONFIG_SECURITY_LANDLOCK) := landlock.o landlock-y := setup.o syscalls.o object.o ruleset.o \ - cred.o ptrace.o fs.o + cred.o task.o fs.o landlock-$(CONFIG_INET) += net.o diff --git a/security/landlock/setup.c b/security/landlock/setup.c index f6dd33143b7f..28519a45b11f 100644 --- a/security/landlock/setup.c +++ b/security/landlock/setup.c @@ -14,8 +14,8 @@ #include "cred.h" #include "fs.h" #include "net.h" -#include "ptrace.h" #include "setup.h" +#include "task.h" bool landlock_initialized __ro_after_init = false; @@ -34,7 +34,7 @@ const struct lsm_id landlock_lsmid = { static int __init landlock_init(void) { landlock_add_cred_hooks(); - landlock_add_ptrace_hooks(); + landlock_add_task_hooks(); landlock_add_fs_hooks(); landlock_add_net_hooks(); landlock_initialized = true; diff --git a/security/landlock/ptrace.c b/security/landlock/task.c similarity index 98% rename from security/landlock/ptrace.c rename to security/landlock/task.c index 2bfc533d36e4..849f5123610b 100644 --- a/security/landlock/ptrace.c +++ b/security/landlock/task.c @@ -16,9 +16,9 @@ #include "common.h" #include "cred.h" -#include "ptrace.h" #include "ruleset.h" #include "setup.h" +#include "task.h" /** * domain_scope_le - Checks domain ordering for scoped ptrace @@ -113,7 +113,7 @@ static struct security_hook_list landlock_hooks[] __ro_after_init = { LSM_HOOK_INIT(ptrace_traceme, hook_ptrace_traceme), }; -__init void landlock_add_ptrace_hooks(void) +__init void landlock_add_task_hooks(void) { security_add_hooks(landlock_hooks, ARRAY_SIZE(landlock_hooks), &landlock_lsmid); diff --git a/security/landlock/ptrace.h b/security/landlock/task.h similarity index 52% rename from security/landlock/ptrace.h rename to security/landlock/task.h index 265b220ae3bf..7c00360219a2 100644 --- a/security/landlock/ptrace.h +++ b/security/landlock/task.h @@ -6,9 +6,9 @@ * Copyright © 2019 ANSSI */ -#ifndef _SECURITY_LANDLOCK_PTRACE_H -#define _SECURITY_LANDLOCK_PTRACE_H +#ifndef _SECURITY_LANDLOCK_TASK_H +#define _SECURITY_LANDLOCK_TASK_H -__init void landlock_add_ptrace_hooks(void); +__init void landlock_add_task_hooks(void); -#endif /* _SECURITY_LANDLOCK_PTRACE_H */ +#endif /* _SECURITY_LANDLOCK_TASK_H */ -- 2.44.0