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-next>] [day] [month] [year] [list]
Date:	Tue, 05 Mar 2013 17:18:28 -0800
From:	Dave Hansen <dave@...ux.vnet.ibm.com>
To:	Stepan Moskovchenko <stepanm@...eaurora.org>,
	Rob Landley <rob@...dley.net>,
	George Spelvin <linux@...izon.com>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Stephen Boyd <sboyd@...eaurora.org>,
	Andrei Emeltchenko <andrei.emeltchenko@...el.com>,
	Ingo Molnar <mingo@...e.hu>,
	LKML <linux-kernel@...r.kernel.org>
Subject: %pa format specifier issues

I went to go use the shiny new %pa specifier:

void test_printk_pa(void)
{
        phys_addr_t p = 0x1234;
        printk("p: %pa\n", p);
}

but gcc is spewing out warnings at me:

> arch/x86/mm/physaddr.c: In function ‘test_printk_pa’:
> arch/x86/mm/physaddr.c:95:2: warning: format ‘%p’ expects argument of type ‘void *’, but argument 2 has type ‘phys_addr_t’ [-Wformat]

I assume that's because gcc doesn't know about '%pa', and just assumes
it's a plain '%p'.  Should we be turning these warnings off somehow?

Plus when I actually go to run it, vsnprintf() crashes the kernel, which
usually happens if printk()'s format doesn't match the size of its
arguments.

Am I doing something really stupid here?

This is using a 32-bit i386 kernel.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ