From patchwork Mon Nov 20 15:11:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13461505 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AYSMExc+" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AEB4D8; Mon, 20 Nov 2023 07:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700493265; x=1732029265; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y1Slo391/qaxM0yM/Z69wR+ZO7w0aji/XOiyHktSsMY=; b=AYSMExc+rUGK0fyrmNWOm5eSUslfzy1/7sA45yHesCNF7cQUlBJUTH4E WU3SddVqZuXtca7s9/ZMiL34+Vd2oqJaRWOX5OKn0ZoP7ulI4yBbx8gyf EhkGSlU7EQsbjoDgD05WAVaUG19GGJ/jkjRfVdt0B4GLMs+4LFhmCz6ZN gXgYlMsyCUSFiXbqrkNYuRCc1Rsdd6hMPfDauu9KoPm7q4JXjKlBdhrf7 l4MK39bySJCHXKY5LIV5qpyMCOWIgwRobRBEG7fR7HDDniuV1+l3KWfZJ /vPEd7taZDsUnk35sB2I3yiQQGYIN6E5sVp8fH3YauxgEzffexe/CaooL g==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="394486342" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="394486342" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 07:14:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="801209700" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="801209700" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 20 Nov 2023 07:14:22 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 490A168; Mon, 20 Nov 2023 17:14:21 +0200 (EET) From: Andy Shevchenko To: Luis Chamberlain , Kees Cook , Andy Shevchenko , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman Subject: [PATCH v3 1/5] params: Introduce the param_unknown_fn type Date: Mon, 20 Nov 2023 17:11:42 +0200 Message-ID: <20231120151419.1661807-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231120151419.1661807-1-andriy.shevchenko@linux.intel.com> References: <20231120151419.1661807-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 Introduce a new type for the callback to parse an unknown argument. This unifies function prototypes which takes that as a parameter. Reviewed-by: Luis Chamberlain Reviewed-by: Kees Cook 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 Nov 20 15:11:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13461506 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AGmk7sbN" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 547C7CB; Mon, 20 Nov 2023 07:14:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700493266; x=1732029266; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=22qKIvbrgULxlxyf3xmSTybLyjjW9aZHEYq6pWfjelQ=; b=AGmk7sbNCl0eKA72nse3rxU4lhYhOHzM38LOICvGzy98xo1JPBNoscua 7z2qjMB6W/DWRZZqBvH93TXkn3QBMtRPt3ZyaVvCEFF5RgbAaCmcvILb6 plmZkTK9OyOdJzmZvHdASBryKcS1YuwfwhtRQXwnvwF96nKpeDRziPLCP viaIqX4PmGTy+2htEGAgoIc8hvr1cmjTm34Oeeo6D+a5lEZWAFKJEHmzE 3z5zX5Vw110J+u3vkp+FqJ0xZVt3Jam6ye5vCo/1KVESy2grt49gzpZUL Qbx2XCTITmxtNZPrwCwOcWdD2OsNBkkRcfSopi+BoolcHnG+hDHjdmT5A Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="394486347" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="394486347" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 07:14:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="801209698" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="801209698" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 20 Nov 2023 07:14:22 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5240C9F; Mon, 20 Nov 2023 17:14:21 +0200 (EET) From: Andy Shevchenko To: Luis Chamberlain , Kees Cook , Andy Shevchenko , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman Subject: [PATCH v3 2/5] params: Do not go over the limit when getting the string length Date: Mon, 20 Nov 2023 17:11:43 +0200 Message-ID: <20231120151419.1661807-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231120151419.1661807-1-andriy.shevchenko@linux.intel.com> References: <20231120151419.1661807-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 We can use strnlen() even on early stages and it prevents from going over the string boundaries in case it's already too long. Reviewed-by: Luis Chamberlain Reviewed-by: Kees Cook 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 Nov 20 15:11:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13461508 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kcKTvZvw" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7B3FA4; Mon, 20 Nov 2023 07:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700493265; x=1732029265; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D5Ir1Vj8OLtklsn72GYygYA1+G2UYfWZWZVSidHq6PI=; b=kcKTvZvwVGtGylf8gdQDbV6eMPUKloNWG8khdyNa0a2vCPMKl/VR/fcJ weRdhwkgBnA/hhMzWTwx4D6sIOHvf/avkufbI3LXmF+q45/r/Te0pf5Wr ha61WZfBYjpkrEwVA6OVuZLKR6RKmGBaWXjx9nURxwQQzF7llUPiF3+j3 AvMfVPLFBlMnGVa9+a1BfC1bB/SLCUnLLusBxGngAratzb4ivnWBJvcR9 72cu+s/+dLZd1AImLm6I1OP0MA+6FX8hi2TvUWESXZhEV/iHMn/POWOSD 8U4pXSToIu5teX6CpdGlaYFjxADvuN3FxptSvtq5RXhIifBzknypmqDuk g==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="422730970" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="422730970" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 07:14:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="1097766557" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="1097766557" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 20 Nov 2023 07:14:22 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6093C12A; Mon, 20 Nov 2023 17:14:21 +0200 (EET) From: Andy Shevchenko To: Luis Chamberlain , Kees Cook , Andy Shevchenko , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman Subject: [PATCH v3 3/5] params: Use size_add() for kmalloc() Date: Mon, 20 Nov 2023 17:11:44 +0200 Message-ID: <20231120151419.1661807-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231120151419.1661807-1-andriy.shevchenko@linux.intel.com> References: <20231120151419.1661807-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 Prevent allocations from integer overflow by using size_add(). Reviewed-by: Luis Chamberlain Reviewed-by: Kees Cook 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 Nov 20 15:11:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13461507 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="j+lQmsP0" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB24DC8; Mon, 20 Nov 2023 07:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700493265; x=1732029265; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=egBySuvnF1rs3mSn+o1fYvDyEOWxN6cCjTLiLa9cCxU=; b=j+lQmsP0OFnU3mXi9p//7Mpo/mOBDSWqI0bI53+keG7c4PzFpGPcqNF2 BtxOdQ6AGwNUc2A8Yj/wPGRqpDKVdnwLMw8is5ZUfpNyb3p6hZp4UFcOS 5s6kk9C9kqpJRtsfVeEYMPNsaguogESD0OMBNlR3EiI87V928CctZJlk/ sM8h87IplghpF4twTOTNR6qpXuuZh6IpL4qrjxBPECnZM7EbXctKmv5IQ g6wL5gfPGuFuMNV+502iBKFyr8TE1TxNxYpQsgN7fVdJj2vnF06LOjcHk EHbuAYUT8NkHNZ3SUZV3pw1qATMDxth7BYrQ9KOV6BnhCs8+R7bkiFNdw A==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="422730966" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="422730966" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 07:14:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="1097766556" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="1097766556" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 20 Nov 2023 07:14:22 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 69CAD118; Mon, 20 Nov 2023 17:14:21 +0200 (EET) From: Andy Shevchenko To: Luis Chamberlain , Kees Cook , Andy Shevchenko , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman Subject: [PATCH v3 4/5] params: Sort headers Date: Mon, 20 Nov 2023 17:11:45 +0200 Message-ID: <20231120151419.1661807-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231120151419.1661807-1-andriy.shevchenko@linux.intel.com> References: <20231120151419.1661807-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 Sort the headers in alphabetic order in order to ease the maintenance for this part. Reviewed-by: Luis Chamberlain Reviewed-by: Kees Cook Signed-off-by: Andy Shevchenko --- kernel/params.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 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 +#include +#include #ifdef CONFIG_SYSFS /* Protects all built-in parameters, modules use their own param_lock */ From patchwork Mon Nov 20 15:11:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13461509 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TTXH5gfB" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08C30CF; Mon, 20 Nov 2023 07:14:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700493268; x=1732029268; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y9bZb8ktHeC1feBWDiNoTxs7R/QFBZGG8vwsdkn9s4k=; b=TTXH5gfBU6HN76cK/JdeYleIU6HF77yBnCevWYcQH+U9c0NkNbj97UVQ MOsI7luJL0V8M/sxx/tukwtu6/JfMsgKZALe4gyyFPfvwyygRe20hFA1+ 1nzNygcosW5IxZ+1G7vd9NJsS/A2YQO4MbNaGeo3vTgQxRA/BiSoYh36C xRANSxQjeJZ1i3bnBWrgkgPDf3585qFIE5WOSvXUtUnz8TWxnKB1D474G oAT9XHMh+9mKsf7EJP06z6K2CGkZFT8T5WYN7w9ly9r0bsuesPVv25b9V nd4FSn/AYIez2tWW/InnQFX7PJoiKhKSvRWgvGZ7+N7GbNoGTQ/WzNen6 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="394486350" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="394486350" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 07:14:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="801209746" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="801209746" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 20 Nov 2023 07:14:25 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7E2491D9; Mon, 20 Nov 2023 17:14:21 +0200 (EET) From: Andy Shevchenko To: Luis Chamberlain , Kees Cook , Andy Shevchenko , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman Subject: [PATCH v3 5/5] params: Fix multi-line comment style Date: Mon, 20 Nov 2023 17:11:46 +0200 Message-ID: <20231120151419.1661807-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231120151419.1661807-1-andriy.shevchenko@linux.intel.com> References: <20231120151419.1661807-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 The multi-line comment style in the file is rather arbitrary. Make it follow the standard one. Reviewed-by: Luis Chamberlain Reviewed-by: Kees Cook 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); } }