From patchwork Tue Feb 15 02:08:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 12746436 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34086C433EF for ; Tue, 15 Feb 2022 02:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231760AbiBOCI7 (ORCPT ); Mon, 14 Feb 2022 21:08:59 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230498AbiBOCI6 (ORCPT ); Mon, 14 Feb 2022 21:08:58 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F036B0EB1 for ; Mon, 14 Feb 2022 18:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=VxT5+TzYaXUngLzkpp0wLjeCZ8njF59V4ZINZ5d0e68=; b=MRXjtI+ud5DO2jHBLU2o4TVrmM xeh3JrdrH+eHLul/Hj0BKEIegmmrDwhaCEYsBDJftrFKM6jlfp/QcEOJQBnpd2j7KGc0RSCh200w3 f3IGkPMW2bdv+kBnapbBx4G3k2u1VARqtVgh8BkypDfzl1M06krk4fd0EY70EvL5DshW2hM2s5Oai FZy1YGOQ/b6JBL1I8O6vd7PD9QVJoswDcnmvKUFWbmaOOCIIZYYRZkc0gUxXV/GsEA3cu3pWT9WWq 02oXXNMqIfpMz7D6Fhm86sg7TjwnEc4pPv+qeS7+5iqhzU/GUqX6HSqh/kRBFk/G3q+vtuNLBoipX sM2OoKPA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJnGX-00HXek-Qc; Tue, 15 Feb 2022 02:08:29 +0000 From: Luis Chamberlain To: torvalds@linux-foundation.org, akpm@linux-foundation.org, keescook@chromium.org, yzaikin@google.com, nixiaoming@huawei.com, ebiederm@xmission.com Cc: sfr@canb.auug.org.au, linux-fsdevel@vger.kernel.org, patches@lists.linux.dev, Luis Chamberlain , Tong Zhang Subject: [PATCH] fs/file_table: fix adding missing kmemleak_not_leak() Date: Mon, 14 Feb 2022 18:08:28 -0800 Message-Id: <20220215020828.4180911-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Commit b42bc9a3c511 ("Fix regression due to "fs: move binfmt_misc sysctl to its own file") fixed a regression, however it failed to add a kmemleak_not_leak(). Fixes: b42bc9a3c511 ("Fix regression due to "fs: move binfmt_misc sysctl to its own file") Reported-by: Tong Zhang Cc: Tong Zhang Signed-off-by: Luis Chamberlain --- The fix for the regression was applied before we could say Satoshi Nakamoto, and so it failed to carry the little tidbit of using kmemleak_not_leak() to avoid the false positive splat. Fix this. fs/file_table.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index 4969021fa676..7d2e692b66a9 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -119,8 +120,11 @@ static struct ctl_table fs_stat_sysctls[] = { static int __init init_fs_stat_sysctls(void) { register_sysctl_init("fs", fs_stat_sysctls); - if (IS_ENABLED(CONFIG_BINFMT_MISC)) - register_sysctl_mount_point("fs/binfmt_misc"); + if (IS_ENABLED(CONFIG_BINFMT_MISC)) { + struct ctl_table_header *hdr; + hdr = register_sysctl_mount_point("fs/binfmt_misc"); + kmemleak_not_leak(hdr); + } return 0; } fs_initcall(init_fs_stat_sysctls);