From patchwork Mon Oct 2 12:48:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13406212 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 AC0AA10A26 for ; Mon, 2 Oct 2023 12:49:11 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68F03BD; Mon, 2 Oct 2023 05:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696250950; x=1727786950; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jfHAEitE/kOTudrhcZUhf3FG7lcoNA4VM+Ov2c+VfUc=; b=T4WsMvFKSTdb2mfnr4r9TjAVDzwx1vnFtSzIOiydMQBv4aO5mS/KYPSl GmVd4sZwGrehmv2nFOyhB1AZ7+L8Krdm8X3OT0KagtKNBrwg78OWY47hF QlWOyJmRJ+NXeCYEo1siI2aczIuZe0O+cmQDi5IjB/VtnSkzqI2ZQVUZ2 rMcY0OCrvq8c0zwmQGtyeyqo/rrmo7NokHBzof4oBk/JjasxU009iixMu 0dTr6yHBV/9HcSouO9IBFbenY1K40+D90eURgT6ZORFTSPWm0wnbWPFHl YiJhPVXfWtnLVwc3Coi6miw0H7cIn7TpmQNUEEwnqA2+2GYNHhjPh0wXc w==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="381517972" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="381517972" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 05:49:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="894127809" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="894127809" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 02 Oct 2023 05:47:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EF8F365; Mon, 2 Oct 2023 15:49:01 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Luis Chamberlain , Kees Cook , Greg Kroah-Hartman Subject: [PATCH v2 1/5] params: Introduce the param_unknown_fn type Date: Mon, 2 Oct 2023 15:48:52 +0300 Message-Id: <20231002124856.2455696-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231002124856.2455696-1-andriy.shevchenko@linux.intel.com> References: <20231002124856.2455696-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Introduce a new type for the callback to parse an unknown argument. This unifies function prototypes which takes that as a parameter. Signed-off-by: Andy Shevchenko --- include/linux/moduleparam.h | 6 +++--- kernel/params.c | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 4fa9726bc328..bfb85fd13e1f 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -385,6 +385,8 @@ extern bool parameq(const char *name1, const char *name2); */ extern bool parameqn(const char *name1, const char *name2, size_t n); +typedef int (*parse_unknown_fn)(char *param, char *val, const char *doing, void *arg); + /* Called on module insert or kernel boot */ extern char *parse_args(const char *name, char *args, @@ -392,9 +394,7 @@ extern char *parse_args(const char *name, unsigned num, s16 level_min, s16 level_max, - void *arg, - int (*unknown)(char *param, char *val, - const char *doing, void *arg)); + void *arg, parse_unknown_fn unknown); /* Called by module remove. */ #ifdef CONFIG_SYSFS diff --git a/kernel/params.c b/kernel/params.c index 2d4a0564697e..626fa8265932 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -120,9 +120,7 @@ static int parse_one(char *param, unsigned num_params, s16 min_level, s16 max_level, - void *arg, - int (*handle_unknown)(char *param, char *val, - const char *doing, void *arg)) + void *arg, parse_unknown_fn handle_unknown) { unsigned int i; int err; @@ -165,9 +163,7 @@ char *parse_args(const char *doing, unsigned num, s16 min_level, s16 max_level, - void *arg, - int (*unknown)(char *param, char *val, - const char *doing, void *arg)) + void *arg, parse_unknown_fn unknown) { char *param, *val, *err = NULL; From patchwork Mon Oct 2 12:48:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13406210 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 E7CAE10A3D for ; Mon, 2 Oct 2023 12:49:10 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 711CDB3; Mon, 2 Oct 2023 05:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696250949; x=1727786949; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WVE+cTWn35UO5vLvQsvUZfoDsGX8itnFJxRzd+LwsvA=; b=Xmulf2XW7dVrjf4oBXscwH2F10wFXYMP66EgBp9EZB4insMga2WRbd/v 5SGX4wqFRg507s8GzsewT6uwbYBNtjxYi2HDRkcZV8S7aIMznZvw3Qg55 uDKU0U3bbBdVTFEeTw4zJFGGiBULG49nLKA2QyOnhxXGP9NkYzegkSZI1 GKpQxoSHOBm6Nl/AuWoZkA0yah8B44tFFPR2jFWjUjVhSdAHpQna6ENvp H+Drut1fx8P6KhIvbtUWhqHLTml+gM1CMjYT2CmSOLPenuIoJCAiwHK2q nZ0Y7yYZdgkEu/Ijq0oiFSGT6gMAVEZM/7TAlqo7jlDx8W3xvp8rDJtjY Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="381517989" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="381517989" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 05:49:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="894127813" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="894127813" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 02 Oct 2023 05:47:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 098B914B3; Mon, 2 Oct 2023 15:49:02 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Luis Chamberlain , Kees Cook , Greg Kroah-Hartman Subject: [PATCH v2 2/5] params: Do not go over the limit when getting the string length Date: Mon, 2 Oct 2023 15:48:53 +0300 Message-Id: <20231002124856.2455696-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231002124856.2455696-1-andriy.shevchenko@linux.intel.com> References: <20231002124856.2455696-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net We can use strnlen() even on early stages and it prevents from going over the string boundaries in case it's already too long. Signed-off-by: Andy Shevchenko --- kernel/params.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/params.c b/kernel/params.c index 626fa8265932..f8e3c4139854 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -260,7 +260,10 @@ EXPORT_SYMBOL_GPL(param_set_uint_minmax); int param_set_charp(const char *val, const struct kernel_param *kp) { - if (strlen(val) > 1024) { + size_t len, maxlen = 1024; + + len = strnlen(val, maxlen + 1); + if (len == maxlen + 1) { pr_err("%s: string parameter too long\n", kp->name); return -ENOSPC; } @@ -270,7 +273,7 @@ int param_set_charp(const char *val, const struct kernel_param *kp) /* This is a hack. We can't kmalloc in early boot, and we * don't need to; this mangled commandline is preserved. */ if (slab_is_available()) { - *(char **)kp->arg = kmalloc_parameter(strlen(val)+1); + *(char **)kp->arg = kmalloc_parameter(len + 1); if (!*(char **)kp->arg) return -ENOMEM; strcpy(*(char **)kp->arg, val); @@ -508,7 +511,7 @@ int param_set_copystring(const char *val, const struct kernel_param *kp) { const struct kparam_string *kps = kp->str; - if (strlen(val)+1 > kps->maxlen) { + if (strnlen(val, kps->maxlen) == kps->maxlen) { pr_err("%s: string doesn't fit in %u chars.\n", kp->name, kps->maxlen-1); return -ENOSPC; From patchwork Mon Oct 2 12:48:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13406211 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 E9DAE11C83 for ; Mon, 2 Oct 2023 12:49:10 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86248B4; Mon, 2 Oct 2023 05:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696250949; x=1727786949; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ry1zc4POzBYQAnRgk6toapa9wplSP5XsgZYRUDDv5YI=; b=H5Zpd20tMDIGTwYGWtAfiJ/JPCSRdH9W0Peo9uPyhHWKW8KeR3hUtJq1 l+23LTkz3wZwFatkzx2RyYhJ0r8zHYROwWJSl1A/4Wz6pbq/OUQKWOEp2 RMDZwar5Yfj1hVG7J2y39l4sMvQO2eBOoWNOk2Sys+H5HA2G6aH5kPhQi Va14dInPZ2gB8jTiionf9QQym50Pmzsy82zEFzUIBz5RuH8GEXRuW0G2Z qACWOvghlov90krKNqPdLff45qwRLYJS8e6p7+2USCSXlGOz2aVn7zfOx uv5X8N9I3pY8CANruuv7pSnC+nbsclV1jchA96ggUTzsOGApRRwvxAVB7 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="381517982" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="381517982" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 05:49:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="894127812" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="894127812" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 02 Oct 2023 05:47:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1D8081593; Mon, 2 Oct 2023 15:49:02 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Luis Chamberlain , Kees Cook , Greg Kroah-Hartman Subject: [PATCH v2 3/5] params: Use size_add() for kmalloc() Date: Mon, 2 Oct 2023 15:48:54 +0300 Message-Id: <20231002124856.2455696-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231002124856.2455696-1-andriy.shevchenko@linux.intel.com> References: <20231002124856.2455696-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Prevent allocations from integer overflow by using size_add(). Signed-off-by: Andy Shevchenko --- kernel/params.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/params.c b/kernel/params.c index f8e3c4139854..c3a029fe183d 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -48,7 +49,7 @@ static void *kmalloc_parameter(unsigned int size) { struct kmalloced_param *p; - p = kmalloc(sizeof(*p) + size, GFP_KERNEL); + p = kmalloc(size_add(sizeof(*p), size), GFP_KERNEL); if (!p) return NULL; From patchwork Mon Oct 2 12:48:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13406208 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 BEE0610A26 for ; Mon, 2 Oct 2023 12:49:09 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77CF0AD; Mon, 2 Oct 2023 05:49:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696250946; x=1727786946; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JdWihm9gO/6oM/PwFuet3kJDZhfqZNY17EGbfixewkM=; b=hiPP8XvIAU5pjdLmrwr2eDODoDFec6e9UClNE3ETPJVGTM9PrBq/b205 hcOz5solsk7b4/HabIhCf+Q9EdYY68JqCxstm755ZOfSKQBBcgFBXAYiH qPZAviuzMMfxLVyqCjvzEwijMo2vdRFAC9lkHeSPQXmWIT+zrhdV4qx4B 4xCfSkAMZnwgVggZa5jg5f24by2pX/JORuWSKPpEqTWCJJrJsbGo+Wq8z 5xsjotj487kZZahBmv6ZvDdjwOH6dwCYadJazNTohnZmGJMCH4M+J+MI0 I7DxjLXLACgvlZrtNcOgMiUhZxiXzm+HcOC8+YyusebKUc+EctMVxiBgM w==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="381517986" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="381517986" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 05:49:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="894127810" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="894127810" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 02 Oct 2023 05:47:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 23104157E; Mon, 2 Oct 2023 15:49:02 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Luis Chamberlain , Kees Cook , Greg Kroah-Hartman Subject: [PATCH v2 4/5] params: Sort headers Date: Mon, 2 Oct 2023 15:48:55 +0300 Message-Id: <20231002124856.2455696-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231002124856.2455696-1-andriy.shevchenko@linux.intel.com> References: <20231002124856.2455696-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Sort the headers in alphabetic order in order to ease the maintenance for this part. Signed-off-by: Andy Shevchenko --- kernel/params.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/params.c b/kernel/params.c index c3a029fe183d..eb55b32399b4 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -3,18 +3,18 @@ Copyright (C) 2001 Rusty Russell. */ +#include +#include +#include +#include #include #include -#include -#include #include #include -#include -#include #include -#include -#include #include +#include +#include #ifdef CONFIG_SYSFS /* Protects all built-in parameters, modules use their own param_lock */ From patchwork Mon Oct 2 12:48:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13406209 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 9EF584693 for ; Mon, 2 Oct 2023 12:49:09 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C1CBB0; Mon, 2 Oct 2023 05:49:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696250948; x=1727786948; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=St8o8nXaM/Hc1Wx+43CvNqKafBY5/VZjLMJIwNON2J0=; b=X23s+LxdUGB/A1TLVJdAbhA6aWfl4H6+NAyqVUCWTOadRqjeMdFyaPSE ES87FOqM5/sJeOgeApD7TbjaRZhT3yuDMVYF1Xrzs09jc0e6DI2K5KFtj w0C8vI4igVM2YdtFsGRDsnkhbyKvsuu0r/PHlwYoXlkiGGo6rxdCp+5X2 aihwVRyp6wWY/haMPlLjThXb8Zl/H1zZ7TVCyjsCv/EHwrcU2LtQOLG8z r7SIH3kREfREWo2IvQBu5XR6iEyjgSH0xS2YHhHpdgs+OWb8ZllaqKv1O X8FfWZPVF4uVQj6bRq3BIUa+WmWelbcBeob/f1PqXr/jnLj2xEQg3hn9h w==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="362901240" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="362901240" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 05:49:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="840970521" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="840970521" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 02 Oct 2023 05:49:06 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2CCE415BA; Mon, 2 Oct 2023 15:49:02 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Luis Chamberlain , Kees Cook , Greg Kroah-Hartman Subject: [PATCH v2 5/5] params: Fix multi-line comment style Date: Mon, 2 Oct 2023 15:48:56 +0300 Message-Id: <20231002124856.2455696-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231002124856.2455696-1-andriy.shevchenko@linux.intel.com> References: <20231002124856.2455696-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net The multi-line comment style in the file is rather arbitrary. Make it follow the standard one. Signed-off-by: Andy Shevchenko --- kernel/params.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/kernel/params.c b/kernel/params.c index eb55b32399b4..2e447f8ae183 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later -/* Helpers for initial module or kernel cmdline parsing - Copyright (C) 2001 Rusty Russell. - -*/ +/* + * Helpers for initial module or kernel cmdline parsing + * Copyright (C) 2001 Rusty Russell. + */ #include #include #include @@ -271,8 +271,10 @@ int param_set_charp(const char *val, const struct kernel_param *kp) maybe_kfree_parameter(*(char **)kp->arg); - /* This is a hack. We can't kmalloc in early boot, and we - * don't need to; this mangled commandline is preserved. */ + /* + * This is a hack. We can't kmalloc() in early boot, and we + * don't need to; this mangled commandline is preserved. + */ if (slab_is_available()) { *(char **)kp->arg = kmalloc_parameter(len + 1); if (!*(char **)kp->arg) @@ -743,8 +745,10 @@ void module_param_sysfs_remove(struct module *mod) { if (mod->mkobj.mp) { sysfs_remove_group(&mod->mkobj.kobj, &mod->mkobj.mp->grp); - /* We are positive that no one is using any param - * attrs at this point. Deallocate immediately. */ + /* + * We are positive that no one is using any param + * attrs at this point. Deallocate immediately. + */ free_module_param_attrs(&mod->mkobj); } }