From patchwork Fri Dec 16 18:33:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13075279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE116C4332F for ; Fri, 16 Dec 2022 18:33:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31AE18E0002; Fri, 16 Dec 2022 13:33:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CA878E0001; Fri, 16 Dec 2022 13:33:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 191B28E0002; Fri, 16 Dec 2022 13:33:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 093748E0001 for ; Fri, 16 Dec 2022 13:33:23 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D45BA1401A7 for ; Fri, 16 Dec 2022 18:33:22 +0000 (UTC) X-FDA: 80249017044.04.2561C98 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf20.hostedemail.com (Postfix) with ESMTP id 6425C1C0016 for ; Fri, 16 Dec 2022 18:33:21 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VWwUHJ9f; spf=pass (imf20.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671215601; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=sGrLECTVb4s/Eib5t9gwo/zBBWYyy+pXavhjIVtpceg=; b=6WHU1wzurRgsrIXWWZXRTXqaKrWT5KhjQ309NGUJLf3EGydakc4tI6k8zP9RyPbgI8FniG E/mQ+CFBCOE990+JTKURKQiPMbjgVkcIMq+5VH8jOIwYDE7zBt0G1zT9Tk85HxYVRPwoCG GjxHKPtCaqtwgnodnGnsiumAgDIsaT4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VWwUHJ9f; spf=pass (imf20.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671215601; a=rsa-sha256; cv=none; b=oVWjRNdXG5pMLwrMLWgeoq8+wGAQ3pgLZKp95G7AVIEh3cMjzPlvUOMTqexOhbROJA+Eoq TPxiMwmnv3GH1QKYxVCCcn3aK3hVEU139iPlHjBe/PWkLWKvbKNVnsQBk1Omt7Qq38Sr6C 3SJFb6lBdxfInX28kzNctUE/cWxmNR0= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4BA68621CD; Fri, 16 Dec 2022 18:33:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25AC3C433D2; Fri, 16 Dec 2022 18:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671215599; bh=GV3Lx/FAuUN/GrklkXc8+fnRlqJXI694w1uGuUC8AdM=; h=From:To:Cc:Subject:Date:From; b=VWwUHJ9fDnOyh+0tEMAWKotD+9B+DxbeZ6zx+/M4BZ6A0ku1mK5nB059ZmDh6pAP/ va/1l4ISU8czktlsKQasbI+PvWYZYJ8/istuBA5YsMasLHerOyJ/Uwkuh4fiTDzEpO tJrSZsV/uGcbHRLTlkuDPJ2GTb/cm5XE+w8UfvjZnHfj2A0JhM5XxhQn1WzU0cWkG+ LCcNJ+/2MPUwC2s6YFugbBJF8C8yoqAzDnZQD55B8DsL9raC20fJp6D4mWYbMPjNor mn5xlACC0tc2M8QAXGDJKzixoUm4fNSedmK6Z6J/ALcwbxl6hvCWtfCmbbTR/JFkf2 0E2X61lweUhSQ== From: SeongJae Park To: akpm@linux-foundation.org Cc: dverkamp@chromium.org, jeffxu@google.com, keescook@chromium.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH mm-unstable] kernel/pid_sysctl.h: Add missing definitions for specific config Date: Fri, 16 Dec 2022 18:33:14 +0000 Message-Id: <20221216183314.169707-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Stat-Signature: pp8uschmnkz6g1kcxhw9dy4bif6ywsu7 X-Rspam-User: X-Rspamd-Queue-Id: 6425C1C0016 X-Rspamd-Server: rspam06 X-HE-Tag: 1671215601-318517 X-HE-Meta: U2FsdGVkX198wOc99hXo1BtrfKRhpAzNBxkATpiwHNVMjEj75TeDOagZ8U0sNoqBqc246UwXToV1X1WctnNK6iHyv16ocrGaq7WI0UAS+u/SXReRFgtblohJqgYXzvySK+sfFW3cJhB8FKKDf6DYC3tg3+sr/QU3GYLrh3Zod2GgI4u8aTP1FWkn+LLiYABf3t3vNdnp1aH2WKsEhQ+CWJoRYOH364NkmsCWgm/RqqFOJEf2BpYrYIqWmKyyWNKKLLH75d6h815/5C7E6RC69NXp8tpVmLND0epcLpi/oKT1UzIKCcJrmmEkfRoccPeHoqpGqMeQLVNera8eZFxaf/QQd/kd0uaMWEO5X1KI9fNyQvRtQqdlOOcaAzzWWBsD+yMXtFHFH0JQdKzK9KQ+Z25Q+tEkm4mUihDvxHHdjv+Ao14acIbl99iAEa6CKOIP1yklOFu0HQvqpDkPMRaRkdnB67Z7CvnNG3R+TlROpFDmexO50XfV49Qh10ph5ARJTc975HbOc1iQg4aG/XRdsRvVr5xK2AAVuOrLt0jSftkgfcD2Snrx1tuNypXODWrfaE5i9SwV6pFoWUJAxNwFmaLES+SeOA9adLjxMV8VCO2QOQeVS3qaLY+Fpc11UBkg0KOo6E5AG8yYP4h4XdAc0j5WbRo0nfxARKoMoshspQqAO9MBsP+/wPuoT0qyCR5XNW+5WoPFgt+LusZVe3e9vBu/jIwcqmegJ1d0DIDjtg+AePMxICM/+KrL5PFjg/ARixMySZX1IfqD1GWI13v0HpasCPOATvm7efy9pI4p2BVyVtNn6anEwst2OMr9tCshNNHWFnlvtjXligrPrU1HEBitYy6s8cYGJNOaQ5x7uq5QEbXQhVjEKkqr2xXpHz4/sE9pmk80N74i2KoqWE/GlIS3Big2BY65oPHqlZr0aoOyqGAcbCRMnjgoFaLBOpH7gE3gdwkDHuOZeq+3iFd PYdok1Ln G4W04p7dBsTBfGB4EKs911PrU4ThrZbyssByPvH1+z9+WsnITe3sWvasrsJLNP8OXav6yrfTghDLOcsE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Commit bdb6231e88a3 ("mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC") on mm-unstable when CONFIG_SYSCTL or CONFIG_MEMFD_CRETE not defined, as below, because initialize_memfd_noexec_scope() and register_pid_ns_sysctl_table_vm(), which defined by the commit, is not defined for the config case. ERROR:root:/kernel/pid_namespace.c: In function ‘create_pid_namespace’: /kernel/pid_namespace.c:114:2: error: implicit declaration of function ‘initialize_memfd_noexec_scope’; did you mean ‘set_memfd_noexec_scope’? [-Werror=implicit-function-declaration] 114 | initialize_memfd_noexec_scope(ns); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | set_memfd_noexec_scope /kernel/pid_namespace.c: In function ‘pid_namespaces_init’: /kernel/pid_namespace.c:462:2: error: implicit declaration of function ‘register_pid_ns_sysctl_table_vm’; did you mean ‘register_pid_ns_ctl_table_vm’? [-Werror=implicit-function-declaration] 462 | register_pid_ns_sysctl_table_vm(); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | register_pid_ns_ctl_table_vm cc1: some warnings being treated as errors make[3]: *** [/scripts/Makefile.build:250: kernel/pid_namespace.o] Error 1 Fix the commit by defining the functions for the configuration. Fixes: bdb6231e88a3 ("mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC") on mm-unstable Signed-off-by: SeongJae Park --- kernel/pid_sysctl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/pid_sysctl.h b/kernel/pid_sysctl.h index 90a93161a122..770c060a0d33 100644 --- a/kernel/pid_sysctl.h +++ b/kernel/pid_sysctl.h @@ -52,8 +52,10 @@ static inline void register_pid_ns_sysctl_table_vm(void) register_sysctl_paths(vm_path, pid_ns_ctl_table_vm); } #else +static inline void initialize_memfd_noexec_scope(struct pid_namespace *ns) {} static inline void set_memfd_noexec_scope(struct pid_namespace *ns) {} static inline void register_pid_ns_ctl_table_vm(void) {} +static inline void register_pid_ns_sysctl_table_vm(void) {} #endif #endif /* LINUX_PID_SYSCTL_H */