lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170918070313.GA1514@jagdpanzerIV.localdomain>
Date:   Mon, 18 Sep 2017 16:03:13 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:     "Luck, Tony" <tony.luck@...el.com>
Cc:     Helge Deller <deller@....de>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Petr Mladek <pmladek@...e.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "Yu, Fenghua" <fenghua.yu@...el.com>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>
Subject: Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier
 usages

On (09/14/17 16:01), Luck, Tony wrote:
> 
> > let's hear from ia64 and ppc64 guys.
> 
> If you write a patch, I can try it on some ia64 h/w.
> 
> Please include some test cases (perhaps as a second patch that adds a few good/bad %pF and %pS
> to some code (both in base kernel, and in a module).

Hello,

I sent out an RFC patch set.


would the following test case work for you?

kernel)

   echo 1 > /proc/sys/vm/drop_caches

module)

   modprobe zram
   echo 100M > /sys/block/zram0/disksize


---

 drivers/block/zram/zram_drv.c | 15 +++++++++++++++
 fs/drop_caches.c              | 11 +++++++++++
 2 files changed, 26 insertions(+)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 2981c27d3aae..ac92aaeaced0 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1508,6 +1508,12 @@ static int zram_add(void)
 	struct request_queue *queue;
 	int ret, device_id;
 
+	printk("printk#13 %pF\n", (void *)_RET_IP_);
+	printk("printk#14 %pS\n", (void *)_RET_IP_);
+
+	printk("printk#15 %pF\n", __builtin_return_address(0));
+	printk("printk#16 %pS\n", __builtin_return_address(0));
+
 	zram = kzalloc(sizeof(struct zram), GFP_KERNEL);
 	if (!zram)
 		return -ENOMEM;
@@ -1730,6 +1736,15 @@ static int __init zram_init(void)
 {
 	int ret;
 
+	printk("printk#7 %pF\n", zram_init);
+	printk("printk#8 %pS\n", zram_init);
+
+	printk("printk#9 %pF\n", (void *)_RET_IP_);
+	printk("printk#10 %pS\n", (void *)_RET_IP_);
+
+	printk("printk#11 %pF\n", __builtin_return_address(0));
+	printk("printk#12 %pS\n", __builtin_return_address(0));
+
 	ret = cpuhp_setup_state_multi(CPUHP_ZCOMP_PREPARE, "block/zram:prepare",
 				      zcomp_cpu_up_prepare, zcomp_cpu_dead);
 	if (ret < 0)
diff --git a/fs/drop_caches.c b/fs/drop_caches.c
index d72d52b90433..3db4adcac78d 100644
--- a/fs/drop_caches.c
+++ b/fs/drop_caches.c
@@ -39,11 +39,22 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused)
 	iput(toput_inode);
 }
 
+#include <linux/sched.h>
+
 int drop_caches_sysctl_handler(struct ctl_table *table, int write,
 	void __user *buffer, size_t *length, loff_t *ppos)
 {
 	int ret;
 
+	printk("printk#1 %pF\n", schedule_timeout);
+	printk("printk#2 %pS\n", schedule_timeout);
+
+	printk("printk#3 %pF\n", (void *)_RET_IP_);
+	printk("printk#4 %pS\n", (void *)_RET_IP_);
+
+	printk("printk#5 %pF\n", __builtin_return_address(0));
+	printk("printk#6 %pS\n", __builtin_return_address(0));
+
 	ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
 	if (ret)
 		return ret;
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ