From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754062AbbC3XVD (ORCPT ); Mon, 30 Mar 2015 19:21:03 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:36008 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754013AbbC3XUh (ORCPT ); Mon, 30 Mar 2015 19:20:37 -0400 From: Dmitry Torokhov To: Greg Kroah-Hartman , "Luis R . Rodriguez" , Tejun Heo Cc: linux-kernel@vger.kernel.org, Arjan van de Ven , Rusty Russell , Olof Johansson , Tetsuo Handa Subject: [PATCH 7/8] module: add core_param_unsafe Date: Mon, 30 Mar 2015 16:20:09 -0700 Message-Id: <1427757610-27882-8-git-send-email-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1427757610-27882-1-git-send-email-dmitry.torokhov@gmail.com> References: <1427757610-27882-1-git-send-email-dmitry.torokhov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Similarly to module_param_unsafe(), add the helper to be used by core code wishing to expose unsafe debugging or testing parameters that taint the kernel when set. Acked-by: Rusty Russell Signed-off-by: Dmitry Torokhov --- include/linux/moduleparam.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 1392370..6480dca 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -310,6 +310,15 @@ static inline void __kernel_param_unlock(void) #define core_param(name, var, type, perm) \ param_check_##type(name, &(var)); \ __module_param_call("", name, ¶m_ops_##type, &var, perm, -1, 0) + +/** + * core_param_unsafe - same as core_param but taints kernel + */ +#define core_param_unsafe(name, var, type, perm) \ + param_check_##type(name, &(var)); \ + __module_param_call("", name, ¶m_ops_##type, &var, perm, \ + -1, KERNEL_PARAM_FL_UNSAFE) + #endif /* !MODULE */ /** -- 2.2.0.rc0.207.ga3a616c