From patchwork Wed Sep 6 07:02:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksa Sarai X-Patchwork-Id: 13375312 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 3FA8AEB8FA5 for ; Wed, 6 Sep 2023 07:02:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C8228280002; Wed, 6 Sep 2023 03:02:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C330B8E0014; Wed, 6 Sep 2023 03:02:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B2146280002; Wed, 6 Sep 2023 03:02:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9FC5D8E0014 for ; Wed, 6 Sep 2023 03:02:22 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 73CCC1CA98D for ; Wed, 6 Sep 2023 07:02:22 +0000 (UTC) X-FDA: 81205278924.06.709BC8A Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by imf17.hostedemail.com (Postfix) with ESMTP id 788DC40028 for ; Wed, 6 Sep 2023 07:02:20 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=cyphar.com header.s=MBO0001 header.b=axjflxjj; dmarc=pass (policy=reject) header.from=cyphar.com; spf=pass (imf17.hostedemail.com: domain of cyphar@cyphar.com designates 80.241.56.152 as permitted sender) smtp.mailfrom=cyphar@cyphar.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693983740; 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=+k6V4wqFBDUDmAoXXrgivFUiDnLDqDPZixBVs4Okvc0=; b=fMVeKuzJaY9mW43sEBgFAQky+Bj+T5UlG8w4YxG9SFaY5e37PXnemh+XA9qoxuNAioyH45 Vydynk9z+qbE1hRVaVIFobTt1e4RLsKu8K7/Bttv+jiywSXJttVH5dFJJltFvJpRKj1LdX oknHdVgV7ugCaY31CTnZ7xPEcnLpi7M= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=cyphar.com header.s=MBO0001 header.b=axjflxjj; dmarc=pass (policy=reject) header.from=cyphar.com; spf=pass (imf17.hostedemail.com: domain of cyphar@cyphar.com designates 80.241.56.152 as permitted sender) smtp.mailfrom=cyphar@cyphar.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693983740; a=rsa-sha256; cv=none; b=5CZS7ejRJ/ytUaW8oD4XIt5MMEcq2skA/hp2KHDWU38N3NV1W9MbHvv+91EhNLtLtCxEYF UQekQBjJyqcQkxS85TfFTCkLF9EwTCtltTqYGxwwCVPJMdOI0Eser+eQudU12EJLgWNLHE Ie9DTYbWxRsAZpRJo6ZIvriNKhNk9H8= Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4RgYGJ4r1Jz9srY; Wed, 6 Sep 2023 09:02:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cyphar.com; s=MBO0001; t=1693983736; h=from:from: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; bh=+k6V4wqFBDUDmAoXXrgivFUiDnLDqDPZixBVs4Okvc0=; b=axjflxjjQczY8egvFtzzgesPxnSG7/OdfTxt1w+gRuqEQlDkl2JT7E87FOvC2NkU1HDkRI VJiseGMcOZmgF9C8fTugmODhsAkGgU6eCc/5AjVtN78+CUdvPe/gx1+oncm8wGZOpeGXZD lsS6mfWiF939YuO2xzXdlPVEBDH3LczRl4/WwMwjP7H4zYkwwcbtvRnhx8gPCoM7nnUsCR 95m+Jsx0OxMQoQepURR0MN/yh8USZIFqDZ8jN5nWRyghaM4XmjJsI7vW/BZUZGFJFxzufF f/ERqSQiNWigESMW2Edt86WEzBCPW0pXzAcVRS+ftvl7ukrLlu5mwKeNtCh08Q== From: Aleksa Sarai Date: Wed, 06 Sep 2023 17:02:06 +1000 Subject: [PATCH] memfd: drop warning for missing exec-related flags MIME-Version: 1.0 Message-Id: <20230906-memfd-reduce-spam-v1-1-1f0d35facd95@cyphar.com> X-B4-Tracking: v=1; b=H4sIAO0j+GQC/x3MQQ5AMBBG4avIrE1SBOUqYkH7l1kUaUMk4u4ay 2/x3kMRQRCpzx4KuCTKviUUeUZmnbYFLDaZSlVWqlMNe3hnOcCeBhyPybNutXZGzV1dgFJ3BDi 5/+cwvu8HzWgnpmMAAAA= To: Andrew Morton Cc: Damian Tometzki , Aleksa Sarai , Christian Brauner , Daniel Verkamp , Jeff Xu , Kees Cook , Shuah Khan , linux-mm@kvack.org, linux-kernel@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1924; i=cyphar@cyphar.com; h=from:subject:message-id; bh=/VYfd7Di0058KXgnpDZddvw9amq+11iEgviQ8j3mDio=; b=owGbwMvMwCWmMf3Xpe0vXfIZT6slMaT8UP7ke1mce8aJR8pOrj82Kj9gsVOZ3FrsYyo7xbvcK 9J92+57HaUsDGJcDLJiiizb/DxDN81ffCX500o2mDmsTCBDGLg4BWAiSzczMlx6xZdaVcfxxsbF J+V2SWl6ncbK7Q5fTRb4H8qbplyZpMfwP37uhNqcH2ZJyVtl/SpCZNPDZF18m5iEcufHc0letl7 HDAA= X-Developer-Key: i=cyphar@cyphar.com; a=openpgp; fpr=C9C370B246B09F6DBCFC744C34401015D1D2D386 X-Rspamd-Queue-Id: 788DC40028 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 8shxf6if7rorch7shhq8tjz7q3tucqwr X-HE-Tag: 1693983740-698953 X-HE-Meta: U2FsdGVkX1/sXOqjl9Scnf0nUbCivXcCfBKnl+wHybh8gpr3FpLkHf0lTTPtG8aRWscWwIhoVEOjKbUinaw3vLQH9fToTpU2Ib8KGuzoyJtj04J0bL+f67/trz4VNDLGeqrolGmUKBcJNuUy7X1jBE7Ee8xljuG6c036XO1H+/0TgSTLLVJHm7Ry9JA+LfN0pVyjrgqD+JE1/Au6qClXmAiSrJv5qB05mxKHCZn0RfebF3YlbveFIu+cDo2NXZMTvc+JCIFg2ZVW8g58e5UXM/M9iS8xvSEnqc1bfVZLHsIAuCR7XAK47NnA3PirS6K3qpJgXhnrNOhsUH32DqZcCvM6FoSYUCFJnx87SThVN6nZyY+5oW99DKXaJ4kFuAdZ1E7v7SW420m8IT4OW/DI+uA9Td3BomXPtBvMn7blwE2A2snjS+NXztThIOUdOUIOuvbtz7rr+lR/DCYDqLmLs2jnsMZNJSmb3RTmHSt6boApyTjLNnL0JlvWgeQGaXEdpkAN7moM6I51LNg+tHIupFZB08S7k7sVaysn7XyHIbpBqRpkt5hSNIf3kX4cBXKDHwZriT7zjKW6qyuOwYnnMghR7l1hk+DUOHarXniIN/Xwn9K6wY1PaG9PDXZTZkcvx9SKDZR5/1IU2szAUF+hSs9tPcuDgtlT1q3FqKuY4O4KwOl851AL9N/qCzlUFXAQRY0HzVnUA8+cZPCXgp761X7ksF2I+NhsWOVLh3zBdKkSWD5lVsYIAnXz/2TWKm4WQ6Hs71Va6KSwlO5vZFTdJEVESiftGvsDtAxAhG4gmV4YsDUy4KClQZp9fovwnuWoUOr4XU+cLPtKvBPCB4TkJ6c+UvYVgBl8Q1dB13A9DzpEqXuax0tgLwkLDcs8hkhGeOvI24B7WdfRvZ19Zyp53XbI1FlHPsOI6OCcx27/8yZiSO7vSwOUx6cCLSjsAaq0TisP47OUdL0SKMquI76 Xmz6c+fa Y1LqDcj2ngkW9Cp5xzJfwr0KB6Wxy+M8vnhDV9Bm6aGxnD3jUdA/eEjr6fQH8kt4zveqsRyIvgZdF5sIG7f0sKv430YlexsbVVUmg5xGYoDTt2z/1tBmSy9PqluEI8x5K0qPpgxRCvzQEVb5GR7hEFOu8t7F90ZaxTr0aW+4ipH6sIb7aUtKOKrzqqfsM9QPYd7X3WCC5ZE1sbn+8wHpBJK4fD/XBDFtkXl6M/gU59M7PnnDpbkJ6/EUlLM82xcPd1qaAEykRQo37LK8XOoJRU0T1VhrDQf9O2tfb 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 434ed3350f57 ("memfd: improve userspace warnings for missing exec-related flags") attempted to make these warnings more useful (so they would work as an incentive to get users to switch to specifying these flags -- as intended by the original MFD_NOEXEC_SEAL patchset). Unfortunately, it turns out that even INFO-level logging is too extreme to enable by default and alternative solutions to the spam issue (such as doing more extreme rate-limiting per-task) are either too ugly or overkill for something as simple as emitting a log as a developer aid. Given that the flags are new and there is no harm to not specifying them (after all, we maintain backwards compatibility) we can just drop the warnings for now until some time in the future when most programs have migrated and distributions start using vm.memfd_noexec=1 (where failing to pass the flag would result in unexpected errors for programs that use executable memfds). Fixes: 434ed3350f57 ("memfd: improve userspace warnings for missing exec-related flags") Reported-by: Damian Tometzki Signed-off-by: Aleksa Sarai Reviewed-by: Christian Brauner --- mm/memfd.c | 6 ------ 1 file changed, 6 deletions(-) --- base-commit: 2374b401b0e0b9ab6d91eead30f9a049f8d620cf change-id: 20230906-memfd-reduce-spam-8788fc0b951e Best regards, diff --git a/mm/memfd.c b/mm/memfd.c index 1cad1904fc26..d3a1ba4208c9 100644 --- a/mm/memfd.c +++ b/mm/memfd.c @@ -315,12 +315,6 @@ SYSCALL_DEFINE2(memfd_create, if ((flags & MFD_EXEC) && (flags & MFD_NOEXEC_SEAL)) return -EINVAL; - if (!(flags & (MFD_EXEC | MFD_NOEXEC_SEAL))) { - pr_info_ratelimited( - "%s[%d]: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set\n", - current->comm, task_pid_nr(current)); - } - error = check_sysctl_memfd_noexec(&flags); if (error < 0) return error;