From patchwork Tue Feb 22 19:32:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 580981 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1MJXRZJ015858 for ; Tue, 22 Feb 2011 19:33:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754113Ab1BVTdZ (ORCPT ); Tue, 22 Feb 2011 14:33:25 -0500 Received: from smtp.outflux.net ([198.145.64.163]:59515 "EHLO smtp.outflux.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751985Ab1BVTdZ (ORCPT ); Tue, 22 Feb 2011 14:33:25 -0500 Received: from www.outflux.net (serenity-end.outflux.net [10.2.0.2]) by vinyl.outflux.net (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id p1MJWpD1025668; Tue, 22 Feb 2011 11:32:51 -0800 Date: Tue, 22 Feb 2011 11:32:50 -0800 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Len Brown , linux-acpi@vger.kernel.org Subject: [PATCH] acpi: create CONFIG item for debugfs custom_method Message-ID: <20110222193250.GA23913@outflux.net> MIME-Version: 1.0 Content-Disposition: inline Organization: Canonical X-MIMEDefang-Filter: outflux$Revision: 1.316 $ X-HELO: www.outflux.net X-Scanned-By: MIMEDefang 2.67 on 10.2.0.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 22 Feb 2011 19:33:29 +0000 (UTC) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 2aa042a..726b7ea 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -381,6 +381,16 @@ config ACPI_HED which is used to report some hardware errors notified via SCI, mainly the corrected errors. +config ACPI_DEBUG_CUSTOM_METHOD + bool "Debugging: Custom Method Insertion" + depends on DEBUG_FS + default n + help + This creates the debugfs interface file "acpi/custom_method" + used for loading custom ACPI methods. Note that this allows + arbitrary kernel memory writing by the root user and is not + recommended for normal systems. + source "drivers/acpi/apei/Kconfig" endif # ACPI diff --git a/drivers/acpi/debugfs.c b/drivers/acpi/debugfs.c index 5df67f1..0240b15 100644 --- a/drivers/acpi/debugfs.c +++ b/drivers/acpi/debugfs.c @@ -20,6 +20,7 @@ module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object, MODULE_PARM_DESC(aml_debug_output, "To enable/disable the ACPI Debug Object output."); +#ifdef CONFIG_ACPI_DEBUG_CUSTOM_METHOD /* /sys/kernel/debug/acpi/custom_method */ static ssize_t cm_write(struct file *file, const char __user * user_buf, @@ -92,3 +93,4 @@ err: debugfs_remove(acpi_dir); return -EINVAL; } +#endif