From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751893AbdJDKpy (ORCPT ); Wed, 4 Oct 2017 06:45:54 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33891 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbdJDKpx (ORCPT ); Wed, 4 Oct 2017 06:45:53 -0400 X-ME-Sender: X-Sasl-enc: ln9bkTtH9S4VQga1GE+tKUBJ1O9y6FJxYZLHT/x28vh3 1507113952 Date: Wed, 4 Oct 2017 21:45:49 +1100 From: "Tobin C. Harding" To: Greg KH Cc: Petr Mladek , Joe Perches , Ian Campbell , Sergey Senozhatsky , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Steven Rostedt , William Roberts , Chris Fries , Dave Weinstein Subject: Re: [kernel-hardening] [RFC V2 0/6] add more kernel pointer filter options Message-ID: <20171004104549.GD16685@eros> References: <1506816410-10230-1-git-send-email-me@tobin.cc> <20171001001105.GA10409@eros> <20171004085756.GD28247@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171004085756.GD28247@kroah.com> X-Mailer: Mutt 1.5.24 (2015-08-30) User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 04, 2017 at 10:57:56AM +0200, Greg KH wrote: > On Sun, Oct 01, 2017 at 11:11:05AM +1100, Tobin C. Harding wrote: > > On Sun, Oct 01, 2017 at 11:06:44AM +1100, Tobin C. Harding wrote: > > > Version 2 of Greg's patch series with changes made as suggested by comments to V1. > > > > Patch set tested by setting /proc/sys/kernel/kptr_restrict and inserting the following module > > > > #include > > #include > > > > #define DRIVER_AUTHOR "Tobin C. Harding " > > #define DRIVER_DESC "Testing module" > > > > static void test_printk(void) > > { > > char *ptr = ""; > > > > pr_alert("printing with p: %p\n", ptr); > > pr_alert("printing with pK: %pK\n", ptr); > > pr_alert("printing with pP: %pP\n", ptr); > > > > pr_alert("printing with pa: %pa\n", ptr); > > pr_alert("printing with pad: %pad\n", ptr); > > pr_alert("printing with pap: %pap\n", ptr); > > > > pr_alert("printing with paP: %paP\n", ptr); > > pr_alert("printing with padP: %padP\n", ptr); > > pr_alert("printing with papP: %papP\n", ptr); > > > > pr_alert("printing with pr: %pr\n", ptr); > > pr_alert("printing with pR: %pR\n", ptr); > > } > > > > static int hello_init(void) > > { > > pr_alert("Hello, world\n"); > > > > test_printk(); > > > > return 0; > > } > > module_init(hello_init); > > > > static void hello_exit(void) > > { > > pr_alert("Goodbye, world\n"); > > } > > module_exit(hello_exit); > > > > MODULE_DESCRIPTION(DRIVER_DESC); > > MODULE_AUTHOR(DRIVER_AUTHOR); > > MODULE_LICENSE("GPL"); > > > Hm, any way to add something like this to the testing infrastructure? > Or maybe just at boot time? It's nice to keep tests around to ensure > things do not break :) Sure, good idea, I'll look into it. It will be my first attempt at adding tests to the kernel so will come as a separate patch set some time soon. thanks, Tobin.