Re: [PATCH] staging: ccree: Fix bool comparison

2017-10-16 Thread Tobin C. Harding
On Mon, Oct 16, 2017 at 03:38:11PM +0530, suni...@techveda.org wrote: > From: Suniel Mahesh > > Bool tests don't need comparisons. This commit log could be a bit longer. You may like to read Documentation/process/submitting-patches.rst (section 2). > This fixes the following coccinelle warning:

Re: [PATCH] staging: ccree: fix boolreturn.cocci warning

2017-10-16 Thread Tobin C. Harding
On Mon, Oct 16, 2017 at 03:39:57PM +0530, suni...@techveda.org wrote: > From: Suniel Mahesh > > This fixes the following coccinelle warning: > WARNING: return of 0/1 in function 'ssi_is_hw_key' with return type bool. Perhaps Coccinelle emits WARNING: return of 0/1 in function 'ssi_is_hw_key' wi

[PATCH v2] printk: hash addresses printed with %p

2017-10-16 Thread Tobin C. Harding
; | wc -l arch: 2512 block: 20 crypto: 12 fs: 1221 include: 147 kernel: 109 lib: 77 mm: 120 net: 1516 security: 11 sound: 168 virt: 2 drivers: 8420 Add helper function siphash_1ulong(). Add function ptr_to_id() to map an address to a 32 bit unique identifier. Signed-off-by: Tobin C. Harding --- V2:

Re: [PATCH v2] printk: hash addresses printed with %p

2017-10-17 Thread Tobin C. Harding
On Tue, Oct 17, 2017 at 05:27:15PM +, Roberts, William C wrote: > > > > -Original Message- > > From: Tobin C. Harding [mailto:m...@tobin.cc] > > Sent: Monday, October 16, 2017 9:53 PM > > To: kernel-harden...@lists.openwall.com > > C

Re: [PATCH v2] printk: hash addresses printed with %p

2017-10-17 Thread Tobin C. Harding
On Tue, Oct 17, 2017 at 09:31:19AM -0400, Steven Rostedt wrote: > On Tue, 17 Oct 2017 15:52:51 +1100 > "Tobin C. Harding" wrote: > > > Currently there are many places in the kernel where addresses are being > > printed using an unadorned %p. Kernel pointers

[PATCH v3] printk: hash addresses printed with %p

2017-10-17 Thread Tobin C. Harding
d function ptr_to_id() to map an address to a 32 bit unique identifier. Signed-off-by: Tobin C. Harding --- V3: - Use atomic_xchg() to guard setting [random] key. - Remove erroneous white space change. V2: - Use SipHash to do the hashing. The discussion related to this patch has been fr

Re: [PATCH V8 0/2] printk: hash addresses printed with %p

2017-10-31 Thread Tobin C. Harding
On Mon, Oct 30, 2017 at 07:08:48PM -0700, Joe Perches wrote: > On Tue, 2017-10-31 at 09:33 +1100, Tobin C. Harding wrote: > > On Mon, Oct 30, 2017 at 03:03:21PM -0700, Kees Cook wrote: > > > On Wed, Oct 25, 2017 at 7:53 PM, Tobin C. Harding wrote: > > > > Here

Re: [PATCH V8 0/2] printk: hash addresses printed with %p

2017-10-31 Thread Tobin C. Harding
On Fri, Oct 27, 2017 at 10:33:01PM +0900, Sergey Senozhatsky wrote: > On (10/26/17 13:53), Tobin C. Harding wrote: > > Currently there are many places in the kernel where addresses are being > > printed using an unadorned %p. Kernel pointers should be printed using > > %pK

Re: [PATCH V9] printk: hash addresses printed with %p

2017-10-31 Thread Tobin C. Harding
On Tue, Oct 31, 2017 at 04:39:44PM +0100, Petr Mladek wrote: > On Mon 2017-10-30 09:59:16, Tobin C. Harding wrote: > > Currently there are many places in the kernel where addresses are being > > printed using an unadorned %p. Kernel pointers should be printed using > > %pK

[PATCH V10 0/2] printk: hash addresses printed with %p

2017-10-31 Thread Tobin C. Harding
as been fragmented. There are three threads associated with this patch. Email threads by subject: [PATCH] printk: hash addresses printed with %p [PATCH 0/3] add %pX specifier [kernel-hardening] [RFC V2 0/6] add more kernel pointer filter options Tobin C. Harding (2): kasan: use %pK to print addresses ins

[PATCH V10 1/2] kasan: use %pK to print addresses instead of %p

2017-10-31 Thread Tobin C. Harding
In preparation for hashing addresses printed using %p. We need the actual address for error reporting in kasan. Use %pK instead of %p to print addresses. Signed-off-by: Tobin C. Harding --- mm/kasan/report.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/kasan

[PATCH V10 2/2] printk: hash addresses printed with %p

2017-10-31 Thread Tobin C. Harding
d function ptr_to_id() to map an address to a 32 bit unique identifier. Hash any unadorned usage of specifier %p and any malformed specifiers. Signed-off-by: Tobin C. Harding --- Documentation/printk-formats.txt | 17 +++- lib/test_printf.c| 108 +++

[PATCH v2] scripts: add leaking_addresses.pl

2017-11-01 Thread Tobin C. Harding
bit kernels have '' as the leading bit pattern making greping possible. On 32 kernels we don't have this luxury. Exclude vsyscall addresses. Suggested-by: Tim Starling Signed-off-by: Tobin C. Harding --- v2: - Add regex's to prevent false positives. - Clean up white

Re: [PATCH v2] scripts: add leaking_addresses.pl

2017-11-01 Thread Tobin C. Harding
On Wed, Nov 01, 2017 at 09:48:19PM +1100, Tobin C. Harding wrote: > Currently we are leaking addresses from the kernel to user space. This > script is an attempt to find those leakages. Script parses `dmesg` > output and /proc and /sys files for hex strings that look like kernel &g

Re: [PATCH V8 0/2] printk: hash addresses printed with %p

2017-11-02 Thread Tobin C. Harding
On Thu, Nov 02, 2017 at 05:23:44PM +0900, Sergey Senozhatsky wrote: > On (11/01/17 10:35), Tobin C. Harding wrote: > [..] > > Yes. The question has been raised will we be here again in 6 years time > > trying to fix all the uses of %x. And there are already 29K uses of > >

Re: [PATCH v7] printk: hash addresses printed with %p

2017-10-24 Thread Tobin C. Harding
On Tue, Oct 24, 2017 at 01:25:52PM +0200, Jason A. Donenfeld wrote: > On Tue, Oct 24, 2017 at 2:31 AM, Tobin C. Harding wrote: > > On Tue, Oct 24, 2017 at 01:00:03AM +0200, Jason A. Donenfeld wrote: > >> Provided you've tested this and the static_key guard stuff actually

Re: [PATCH v7] printk: hash addresses printed with %p

2017-10-24 Thread Tobin C. Harding
On Tue, Oct 24, 2017 at 01:25:52PM +0200, Jason A. Donenfeld wrote: > On Tue, Oct 24, 2017 at 2:31 AM, Tobin C. Harding wrote: > > On Tue, Oct 24, 2017 at 01:00:03AM +0200, Jason A. Donenfeld wrote: > >> Provided you've tested this and the static_key guard stuff actually

Re: [PATCH v7] printk: hash addresses printed with %p

2017-10-25 Thread Tobin C. Harding
On Wed, Oct 25, 2017 at 06:00:21AM +0200, Jason A. Donenfeld wrote: > On Wed, Oct 25, 2017 at 5:49 AM, Tobin C. Harding wrote: > > static_branch_disable(&no_ptr_secret) : Doesn't sleep, just atomic read > > and set and maybe a WARN_ONCE. > > Are you sure about t

Re: [PATCH v7] printk: hash addresses printed with %p

2017-10-25 Thread Tobin C. Harding
On Wed, Oct 25, 2017 at 09:02:34PM +0200, Rasmus Villemoes wrote: > On 25 October 2017 at 01:57, Tobin C. Harding wrote: > > On Tue, Oct 24, 2017 at 09:25:20PM +0200, Rasmus Villemoes wrote: > >> > >> I haven't followed the discussion too closely, but has it bee

Re: [PATCH v7] printk: hash addresses printed with %p

2017-10-25 Thread Tobin C. Harding
On Wed, Oct 25, 2017 at 06:00:21AM +0200, Jason A. Donenfeld wrote: > On Wed, Oct 25, 2017 at 5:49 AM, Tobin C. Harding wrote: > > static_branch_disable(&no_ptr_secret) : Doesn't sleep, just atomic read > > and set and maybe a WARN_ONCE. > > Are you sure about t

Re: [PATCH v7] printk: hash addresses printed with %p

2017-10-25 Thread Tobin C. Harding
On Thu, Oct 26, 2017 at 12:59:08AM +0200, Jason A. Donenfeld wrote: > On Thu, Oct 26, 2017 at 12:27 AM, Tobin C. Harding wrote: > > How good is unlikely()? > > It places that branch way at the bottom of the function so that it's > less likely to pollute the icache. > &

[PATCH V8 1/2] printk: remove tabular output for NULL pointer

2017-10-25 Thread Tobin C. Harding
ers with a correct width. Signed-off-by: Tobin C. Harding --- lib/vsprintf.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 86c3385b9eb3..16a587aed40e 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1710,15 +1710,8 @@ char *poi

[PATCH V8 0/2] printk: hash addresses printed with %p

2017-10-25 Thread Tobin C. Harding
this patch. Email threads by subject: [PATCH] printk: hash addresses printed with %p [PATCH 0/3] add %pX specifier [kernel-hardening] [RFC V2 0/6] add more kernel pointer filter options Tobin C. Harding (2): printk: remove tabular output for NULL pointer printk: hash addresses printed with %p lib/

[PATCH V8 2/2] printk: hash addresses printed with %p

2017-10-25 Thread Tobin C. Harding
d function ptr_to_id() to map an address to a 32 bit unique identifier. Signed-off-by: Tobin C. Harding --- lib/vsprintf.c | 157 +++-- 1 file changed, 107 insertions(+), 50 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 1

Re: [PATCH V8 2/2] printk: hash addresses printed with %p

2017-10-25 Thread Tobin C. Harding
On Thu, Oct 26, 2017 at 01:53:56PM +1100, Tobin C. Harding wrote: > Currently there are many places in the kernel where addresses are being > printed using an unadorned %p. Kernel pointers should be printed using > %pK allowing some control via the kptr_restrict sysctl. Exposing addresse

[PATCH] scripts: add leaking_addresses.pl

2017-10-25 Thread Tobin C. Harding
bit kernels have '' as the leading bit pattern making greping possible. On 32 kernels we don't have this luxury. Signed-off-by: Tobin C. Harding --- Changes since RFC V2 - Refactor the code that skips directories and files into helper functions. - Add documentation. -

Re: [PATCH V8 1/2] printk: remove tabular output for NULL pointer

2017-10-25 Thread Tobin C. Harding
Hi Joe, thanks for your review. On Wed, Oct 25, 2017 at 09:57:23PM -0700, Joe Perches wrote: > On Thu, 2017-10-26 at 13:53 +1100, Tobin C. Harding wrote: > > Currently pointer() checks for a NULL pointer argument and then if so > > attempts to print "(null)" with _s

Re: [PATCH v7] printk: hash addresses printed with %p

2017-10-26 Thread Tobin C. Harding
On Thu, Oct 26, 2017 at 09:00:03AM +0200, Greg KH wrote: > On Thu, Oct 26, 2017 at 12:59:08AM +0200, Jason A. Donenfeld wrote: > > On Thu, Oct 26, 2017 at 12:27 AM, Tobin C. Harding wrote: > > > How good is unlikely()? > > > > It places that branch way at the botto

Re: [PATCH V8 1/2] printk: remove tabular output for NULL pointer

2017-10-26 Thread Tobin C. Harding
On Thu, Oct 26, 2017 at 01:05:39AM -0700, Joe Perches wrote: > On Thu, 2017-10-26 at 17:27 +1100, Tobin C. Harding wrote: > > Hi Joe, > > > > thanks for your review. > > > > On Wed, Oct 25, 2017 at 09:57:23PM -0700, Joe Perches wrote: > > > On Thu, 2

Re: [PATCH V8 1/2] printk: remove tabular output for NULL pointer

2017-10-26 Thread Tobin C. Harding
On Thu, Oct 26, 2017 at 07:47:19AM -0700, Joe Perches wrote: > On Thu, 2017-10-26 at 20:37 +1100, Tobin C. Harding wrote: > > On Thu, Oct 26, 2017 at 01:05:39AM -0700, Joe Perches wrote: > > > On Thu, 2017-10-26 at 17:27 +1100, Tobin C. Harding wrote: > > > > Hi Jo

Re: [kernel-hardening] [PATCH v4] scripts: add leaking_addresses.pl

2017-11-12 Thread Tobin C. Harding
On Sun, Nov 12, 2017 at 10:02:55AM -0800, Frank Rowand wrote: > Hi Michael, > > On 11/12/17 03:49, Michael Ellerman wrote: > > Hi Frank, > > > > Frank Rowand writes: > >> Hi Michael, Tobin, > >> > >> On 11/08/17 04:10, Michael Ellerman wro

Re: [kernel-hardening] [PATCH v4] scripts: add leaking_addresses.pl

2017-11-12 Thread Tobin C. Harding
On Fri, Nov 10, 2017 at 07:26:34PM +0530, kaiwan.billimo...@gmail.com wrote: > On Tue, 2017-11-07 at 21:32 +1100, Tobin C. Harding wrote: > > Currently we are leaking addresses from the kernel to user space. > > This > > script is an attempt to find some of those leakages. Scr

Re: [PATCH v4] scripts: add leaking_addresses.pl

2017-11-12 Thread Tobin C. Harding
On Sun, Nov 12, 2017 at 02:10:07AM +0300, Kirill A. Shutemov wrote: > On Tue, Nov 07, 2017 at 09:32:11PM +1100, Tobin C. Harding wrote: > > Currently we are leaking addresses from the kernel to user space. This > > script is an attempt to find some of those leakages. Script pa

Re: [PATCH v4] scripts: add leaking_addresses.pl

2017-11-12 Thread Tobin C. Harding
On Mon, Nov 13, 2017 at 06:37:28AM +0300, Kirill A. Shutemov wrote: > On Mon, Nov 13, 2017 at 10:06:46AM +1100, Tobin C. Harding wrote: > > On Sun, Nov 12, 2017 at 02:10:07AM +0300, Kirill A. Shutemov wrote: > > > On Tue, Nov 07, 2017 at 09:32:11PM +1100, Tobin C. Harding wrote:

Re: [kernel-hardening] [PATCH v4] scripts: add leaking_addresses.pl

2017-11-12 Thread Tobin C. Harding
On Mon, Nov 13, 2017 at 11:16:28AM +0530, kaiwan.billimo...@gmail.com wrote: > On Mon, 2017-11-13 at 09:21 +1100, Tobin C. Harding wrote: > > On Fri, Nov 10, 2017 at 07:26:34PM +0530, kaiwan.billimo...@gmail.com > > wrote: > > > On Tue, 2017-11-07 at 21:32 +1100

[GIT PULL] leaking_addresses updates for 4.15

2017-11-13 Thread Tobin C. Harding
options; add summary reporting functionality. We add a timeout to stop the script blocking indefinitely and add SigIgn to false positive checks. We also add infrastructure to handle multiple architectures and add support for ppc64. Signed-off-by: Tobin C. Harding

[GIT PULL resend] leaking_addresses updates for 4.15

2017-11-13 Thread Tobin C. Harding
command line options; add summary reporting functionality. We add a timeout to stop the script blocking indefinitely and add SigIgn to false positive checks. We also add infrastructure to handle multiple architectures and add support for ppc64. Signed-off-by: Tobin C. Harding

[GIT PULL 2nd resend] leaking_addresses updates for 4.15

2017-11-13 Thread Tobin C. Harding
infrastructure to handle multiple architectures and add support for ppc64. Signed-off-by: Tobin C. Harding -- Tobin C. Harding (9): leaking_addresses: use tabs instead of spaces leaking_addresses: remove dead/unused

Re: [GIT PULL 2nd resend] leaking_addresses updates for 4.15

2017-11-14 Thread Tobin C. Harding
On Tue, Nov 14, 2017, at 10:04, Tobin C. Harding wrote: > The following changes since commit: > bebc6082da0a9f5d47a1ea2edc099bf671058bd4 > > Linux 4.14 (2017-11-12 10:46:13 -0800) > > are available in the git repository at: > > https://github.com/tcharding/linux tag

Re: git pull

2017-11-14 Thread Tobin C. Harding
Added Linus to To: header. On Tue, Nov 14, 2017 at 12:05:00PM +0100, Greg Kroah-Hartman wrote: > Adding lkml and linux-doc mailing lists... > > On Tue, Nov 14, 2017 at 10:11:55AM +1100, Tobin C. Harding wrote: > > Hi Greg, > > > > This is totally asking a favour, feel

Re: git pull

2017-11-14 Thread Tobin C. Harding
On Tue, Nov 14, 2017 at 12:05:00PM +0100, Greg Kroah-Hartman wrote: > Adding lkml and linux-doc mailing lists... > > On Tue, Nov 14, 2017 at 10:11:55AM +1100, Tobin C. Harding wrote: > > Hi Greg, > > > > This is totally asking a favour, feel free to ignore. How do yo

[PATCH] docs: add submitting-pull-requests.rst

2017-11-14 Thread Tobin C. Harding
at I do, and it seems to work well, so maybe we should turn it into the start of the documentation for how to do it. Create document from email thread on LKML (referenced in document). Signed-off-by: Tobin C. Harding --- Is it rude to send this during the merge window? Can resend after it clo

Re: [PATCH] docs: add submitting-pull-requests.rst

2017-11-14 Thread Tobin C. Harding
On Tue, Nov 14, 2017 at 04:48:16PM -0700, Jonathan Corbet wrote: Awesome comments Jon, I knew there would be more to writing docs than first met the eye. > On Wed, 15 Nov 2017 09:54:21 +1100 > "Tobin C. Harding" wrote: > > > There is currently no documentation on how

checkpatch potential false positive

2017-11-05 Thread Tobin C. Harding
Hi, When parsing drivers/staging/unisys/visorbus/visorchipset.c in Greg's staging tree checkpatch emits -- visorchipset.c -- WARNING: char * array declaration might be better as static const #1050: FILE: visorchipset.c:1050: + char *envp[] = { env_cmd, env_id, env_st

[PATCH v3] scripts: add leaking_addresses.pl

2017-11-05 Thread Tobin C. Harding
on 64 bit kernels have '' as the leading bit pattern making greping possible. On 32 kernels we don't have this luxury. Scripts is _slightly_ smarter than a straight grep, we check for false positives (all 0's or all 1's, and vsyscall start/finish addresses). Signed

Re: [PATCH 3/3] staging: ccree: simplify ioread/iowrite

2017-11-06 Thread Tobin C. Harding
On Mon, Nov 06, 2017 at 06:55:52AM +, Gilad Ben-Yossef wrote: > Registers ioread/iowrite operations were done via macros, > sometime using a "magical" implicit parameter. > > Replace all register access with simple inline macros. > > Signed-off-by: Gilad Ben-Yossef Hi, Nice work. I had a l

Re: [PATCH 3/3] staging: ccree: simplify ioread/iowrite

2017-11-06 Thread Tobin C. Harding
On Mon, Nov 06, 2017 at 04:46:54PM +0100, Greg Kroah-Hartman wrote: > On Mon, Nov 06, 2017 at 10:59:47AM +0200, Gilad Ben-Yossef wrote: > > On Mon, Nov 6, 2017 at 10:37 AM, Tobin C. Harding wrote: > > > On Mon, Nov 06, 2017 at 06:55:52AM +, Gilad Ben-Yossef wrote: >

Re: checkpatch potential false positive

2017-11-06 Thread Tobin C. Harding
On Mon, Nov 06, 2017 at 07:29:18AM -0800, Joe Perches wrote: > On Mon, 2017-11-06 at 08:33 +, Andy Whitcroft wrote: > > On Mon, Nov 06, 2017 at 03:19:14PM +1100, Tobin C. Harding wrote: > > > Hi, > > Hello. > > > > When parsing drivers/staging/unis

Re: [kernel-hardening] Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-06 Thread Tobin C. Harding
On Mon, Nov 06, 2017 at 09:25:33PM +0300, Pavel Vasilyev wrote: >  ./leaking_addresses.pl --dont_walk_abs /proc --dont_walk_abs /sys > Unknown option: dont_walk_abs > Unknown option: dont_walk_abs Oh thanks. Documentation is out of sync with the code, what are the odds. v4 to come. thanks, Tobin

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-06 Thread Tobin C. Harding
On Mon, Nov 06, 2017 at 09:41:09AM -0800, Linus Torvalds wrote: > On Mon, Nov 6, 2017 at 9:27 AM, Linus Torvalds > wrote: > > > > Lovely. This is great. It shows just how much totally pointless stuff > > we leak, and to normal users that really shouldn't need it. > > Side note: it would be good t

Re: [PATCH v2] printk: hash addresses printed with %p

2017-10-17 Thread Tobin C. Harding
On Wed, Oct 18, 2017 at 02:27:43AM +0200, Jason A. Donenfeld wrote: [snip] Thank you for your extensive comments Jason. I had v3 in flight before I received your email, please don't think I ignored your suggestions. v4 to come! thanks, Tobin.

Re: [PATCH v2] printk: hash addresses printed with %p

2017-10-17 Thread Tobin C. Harding
On Tue, Oct 17, 2017 at 05:13:10PM -0700, Kees Cook wrote: > On Tue, Oct 17, 2017 at 4:15 PM, Tobin C. Harding wrote: > > On Tue, Oct 17, 2017 at 09:31:19AM -0400, Steven Rostedt wrote: > >> On Tue, 17 Oct 2017 15:52:51 +1100 > >> "Tobin C. Harding" wrote:

Re: [kernel-hardening] [PATCH v3] printk: hash addresses printed with %p

2017-10-17 Thread Tobin C. Harding
On Wed, Oct 18, 2017 at 02:59:17AM +0200, Jason A. Donenfeld wrote: > Hi Tobin, > > You submitted v3 without replying to my v2 comments. I'll give a > condensed version of those here for convenience. Wow, thanks for taking the time to do this. Lesson learned: recheck emails right before submitti

Re: [PATCH v2] staging: ccree: Fix bool comparison

2017-10-17 Thread Tobin C. Harding
On Wed, Oct 18, 2017 at 07:40:14AM +0530, suni...@techveda.org wrote: > From: Suniel Mahesh > > Comparision operator "equal to" not required on a variable > "foo" of type "bool". Bool has only two values, can be used > directly or with logical not. > > This fixes the following coccinelle warning

Re: [PATCH v2] staging: ccree: fix boolreturn.cocci warning

2017-10-17 Thread Tobin C. Harding
On Wed, Oct 18, 2017 at 07:42:53AM +0530, suni...@techveda.org wrote: > From: Suniel Mahesh > > Return "false" instead of 0. > > This fixes the following coccinelle warning: > WARNING: return of 0/1 in function 'ssi_is_hw_key' with return type bool. So close! The order of problem description and

[PATCH v4] printk: hash addresses printed with %p

2017-10-17 Thread Tobin C. Harding
d function ptr_to_id() to map an address to a 32 bit unique identifier. Signed-off-by: Tobin C. Harding --- V4: - Remove changes to siphash.{ch} - Do word size check, and return value cast, directly in ptr_to_id(). - Use add_ready_random_callback() to guard call to get_random_bytes(

Re: [PATCH v4] printk: hash addresses printed with %p

2017-10-17 Thread Tobin C. Harding
On Wed, Oct 18, 2017 at 02:44:31PM +0900, Sergey Senozhatsky wrote: > On (10/18/17 15:21), Tobin C. Harding wrote: > [..] > > diff --git a/lib/vsprintf.c b/lib/vsprintf.c > > index 86c3385b9eb3..4609738cd2cd 100644 > > --- a/lib/vsprintf.c > > +++ b/lib

Re: [PATCH v3] staging: ccree: fix boolreturn.cocci warning

2017-10-18 Thread Tobin C. Harding
*tfm) > { > - return 0; > + return false; > } > > #endif /* CRYPTO_TFM_REQ_HW_KEY */ > -- > 1.9.1 > For what it's worth, Reviewed-by: Tobin C. Harding As stated I am being particularly 'nit picky', the commit log is _probably_ good enough to

[PATCH v5] printk: hash addresses printed with %p

2017-10-18 Thread Tobin C. Harding
d function ptr_to_id() to map an address to a 32 bit unique identifier. Signed-off-by: Tobin C. Harding --- V5: - Remove spin lock. - Add Jason A. Donenfeld to CC list by request. - Add Theodore Ts'o to CC list due to comment on previous version. V4: - Remove changes to siphash.{ch} -

Re: [PATCH v5] printk: hash addresses printed with %p

2017-10-18 Thread Tobin C. Harding
On Wed, Oct 18, 2017 at 03:31:16PM -0700, Kees Cook wrote: > On Wed, Oct 18, 2017 at 2:30 PM, Tobin C. Harding wrote: > > Currently there are many places in the kernel where addresses are being > > printed using an unadorned %p. Kernel pointers should be printed using > &

Re: [PATCH v5] printk: hash addresses printed with %p

2017-10-18 Thread Tobin C. Harding
On Thu, Oct 19, 2017 at 03:36:20AM +0200, Jason A. Donenfeld wrote: > On Thu, Oct 19, 2017 at 3:31 AM, Sergey Senozhatsky > wrote: > > On (10/19/17 03:03), Jason A. Donenfeld wrote: > > [..] > >> 1) Go back to the spinlock yourself. > > > > so we ruled out NMI deadlocks? > > Oh, right. No, I have

[RFC] scripts: add leaking_addresses.pl

2017-10-18 Thread Tobin C. Harding
Currently we are leaking addresses from the kernel to user space. This script as an attempt to find those leakages. Script parses `dmesg` output and /proc and /sys files for suspicious entries. Signed-off-by: Tobin C. Harding --- My usual disclaimer; I am a long way from being a Perl monger

Re: [RFC] scripts: add leaking_addresses.pl

2017-10-19 Thread Tobin C. Harding
On Thu, Oct 19, 2017 at 08:44:31AM -0400, Steven Rostedt wrote: > On Thu, 19 Oct 2017 17:34:44 +1100 > "Tobin C. Harding" wrote: > > > > > My usual disclaimer; I am a long way from being a Perl monger, any tips, > > I'm a semi Perl monger. > >

Re: [RFC] scripts: add leaking_addresses.pl

2017-10-19 Thread Tobin C. Harding
On Thu, Oct 19, 2017 at 05:19:49PM +0200, Petr Mladek wrote: > On Thu 2017-10-19 17:34:44, Tobin C. Harding wrote: [snip] Good tips, thank you. Will merge every ones suggestions. V2 to come. thanks, Tobin.

[PATCH V9] printk: hash addresses printed with %p

2017-10-29 Thread Tobin C. Harding
d function ptr_to_id() to map an address to a 32 bit unique identifier. Hash any unadorned usage of specifier %p and any malformed specifiers. Signed-off-by: Tobin C. Harding --- It seems we don't have consensus on a couple of things 1. The size of the hashed address on 64 bit architectur

Re: [PATCH v7] printk: hash addresses printed with %p

2017-10-30 Thread Tobin C. Harding
On Mon, Oct 30, 2017 at 04:22:44PM -0400, Steven Rostedt wrote: > On Wed, 25 Oct 2017 14:49:34 +1100 > "Tobin C. Harding" wrote: > > > > First, the static_key stuff. > > > > DEFINE_STATIC_KEY_TRUE(no_ptr_secret) : Doesn't sleep, just a > >

Re: [PATCH V8 0/2] printk: hash addresses printed with %p

2017-10-30 Thread Tobin C. Harding
On Mon, Oct 30, 2017 at 03:03:21PM -0700, Kees Cook wrote: > On Wed, Oct 25, 2017 at 7:53 PM, Tobin C. Harding wrote: > > Here is the behaviour that this set implements. > > > > For kpt_restrict==0 > > > > Randomness not ready: > > printed with %p:

Re: [PATCH V8 2/2] printk: hash addresses printed with %p

2017-10-30 Thread Tobin C. Harding
On Mon, Oct 30, 2017 at 05:33:22PM -0400, Steven Rostedt wrote: > On Thu, 26 Oct 2017 13:58:38 +1100 > "Tobin C. Harding" wrote: > > > > +static bool have_filled_random_ptr_key; > > > +static siphash_key_t ptr_key __read_mostly; > > > +

Re: [PATCH V9] printk: hash addresses printed with %p

2017-10-30 Thread Tobin C. Harding
On Mon, Oct 30, 2017 at 03:31:41PM -0700, Kees Cook wrote: > On Sun, Oct 29, 2017 at 3:59 PM, Tobin C. Harding wrote: > > Currently there are many places in the kernel where addresses are being > > printed using an unadorned %p. Kernel pointers should be printed using > &

Re: [PATCH V8 2/2] printk: hash addresses printed with %p

2017-10-30 Thread Tobin C. Harding
On Mon, Oct 30, 2017 at 08:00:46PM -0400, Steven Rostedt wrote: > On Tue, 31 Oct 2017 09:41:02 +1100 > "Tobin C. Harding" wrote: > > > > Cool. So I think we need > > > > get_random_bytes(&ptr_key, sizeof(ptr_key)); > > You'll need to

Re: [lkp-robot] [printk] 7f7c60e066: BUG:KASAN:slab-out-of-bounds

2017-10-30 Thread Tobin C. Harding
t; > > > commit: 7f7c60e0663645e757e520245606fde9c6e326bb ("printk: hash addresses > > printed with %p") > > url: > > https://github.com/0day-ci/linux/commits/Tobin-C-Harding/printk-hash-addresses-printed-with-p/20171024-231922 > > It's not clear to me whic

Re: [PATCH bpf-next 05/13] docs: net: Fix indentation issues for code snippets

2018-08-05 Thread Tobin C. Harding
On Fri, Aug 03, 2018 at 10:44:23AM +0200, Daniel Borkmann wrote: > On 08/01/2018 07:09 AM, Tobin C. Harding wrote: > [...] > > -Starting bpf_dbg is trivial and just requires issuing: > > +Starting bpf_dbg is trivial and just requires issuing:: > > > > -

Re: [PATCH bpf-next 12/13] docs: net: Fix various minor typos

2018-08-05 Thread Tobin C. Harding
On Fri, Aug 03, 2018 at 10:41:12AM +0200, Daniel Borkmann wrote: > On 08/01/2018 07:09 AM, Tobin C. Harding wrote: > > There are a few minor typos and grammatical issues. We should however > > try to keep the current flavour of the document. > > > > Fix typos and gr

Re: [PATCH v8 4/4] vsprintf: Add command line option debug_boot_weak_hash

2018-06-20 Thread Tobin C. Harding
On Wed, Jun 20, 2018 at 09:09:49AM -0700, Randy Dunlap wrote: > On 06/19/2018 09:20 PM, Tobin C. Harding wrote: > > Currently printing [hashed] pointers requires enough entropy to be > > available. Early in the boot sequence this may not be the case > > result

Re: [PATCH v8 4/4] vsprintf: Add command line option debug_boot_weak_hash

2018-06-20 Thread Tobin C. Harding
On Wed, Jun 20, 2018 at 03:36:44PM -0700, Randy Dunlap wrote: > On 06/20/2018 03:30 PM, Tobin C. Harding wrote: > > On Wed, Jun 20, 2018 at 09:09:49AM -0700, Randy Dunlap wrote: > >> On 06/19/2018 09:20 PM, Tobin C. Harding wrote: > >>> Currently printing [hashed] po

Re: [PATCH v8 4/4] vsprintf: Add command line option debug_boot_weak_hash

2018-06-20 Thread Tobin C. Harding
On Wed, Jun 20, 2018 at 04:38:05PM -0700, Randy Dunlap wrote: > On 06/20/2018 04:22 PM, Tobin C. Harding wrote: > > On Wed, Jun 20, 2018 at 03:36:44PM -0700, Randy Dunlap wrote: > >> On 06/20/2018 03:30 PM, Tobin C. Harding wrote: > >>> On Wed, Jun 20, 2018 at 09:09:

Re: [PATCH v8 4/4] vsprintf: Add command line option debug_boot_weak_hash

2018-06-20 Thread Tobin C. Harding
On Wed, Jun 20, 2018 at 09:09:49PM -0700, Randy Dunlap wrote: > On 06/20/2018 08:15 PM, Tobin C. Harding wrote: > > On Wed, Jun 20, 2018 at 04:38:05PM -0700, Randy Dunlap wrote: > >> On 06/20/2018 04:22 PM, Tobin C. Harding wrote: > >>> On Wed, Jun 20, 2018 at 03:36:

[PATCH v9 0/4] enable early printing of hashed pointers

2018-06-21 Thread Tobin C. Harding
d solves original problem for Anna-Maria). - Added Acked-by tag from Ted (patch 1 and 2) Tobin C. Harding (4): random: Fix whitespace pre random-bytes work random: Return nbytes filled from hw RNG vsprintf: Use hw RNG for ptr_key vsprintf: Add command line option debug_boot_weak_hash

[PATCH v9 1/4] random: Fix whitespace pre random-bytes work

2018-06-21 Thread Tobin C. Harding
There are a couple of whitespace issues around the function get_random_bytes_arch(). In preparation for patching this function let's clean them up. Acked-by: Theodore Ts'o Signed-off-by: Tobin C. Harding --- drivers/char/random.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletion

[PATCH v9 3/4] vsprintf: Use hw RNG for ptr_key

2018-06-21 Thread Tobin C. Harding
Currently we must wait for enough entropy to become available before hashed pointers can be printed. We can remove this wait by using the hw RNG if available. Use hw RNG to get keying material. Reviewed-by: Steven Rostedt (VMware) Suggested-by: Kees Cook Signed-off-by: Tobin C. Harding

[PATCH v9 4/4] vsprintf: Add command line option debug_boot_weak_hash

2018-06-21 Thread Tobin C. Harding
dt (VMware) Signed-off-by: Tobin C. Harding --- Documentation/admin-guide/kernel-parameters.txt | 8 lib/vsprintf.c | 17 + 2 files changed, 25 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/a

[PATCH v9 2/4] random: Return nbytes filled from hw RNG

2018-06-21 Thread Tobin C. Harding
bytes_arch(). Only get random bytes from the hw RNG, make function return the number of bytes retrieved from the hw RNG. Acked-by: Theodore Ts'o Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Tobin C. Harding --- drivers/char/random.c | 16 +--- include/linux/random.h |

Re: [PATCH net-next 0/2] docs: net: Convert netdev-FAQ to RST

2018-07-24 Thread Tobin C. Harding
On Wed, Jul 25, 2018 at 12:50:03PM +1000, Tobin C. Harding wrote: Please drop this. I've forgotten to deal with the links from Documentation/*.rst to Documentation/networking/netdev-FAQ.txt Since I've already botched it can I ask for guidance here. The problem is updating the l

Re: [RFC] doc: fix code snippet build warnings

2018-01-10 Thread Tobin C. Harding
On Wed, Jan 10, 2018 at 08:37:02AM -0800, Paul E. McKenney wrote: > On Wed, Jan 10, 2018 at 03:04:53PM +1100, Tobin C. Harding wrote: > > Posting as RFC in the hope that someone knows how to massage sphinx > > correctly to fix this patch. > > I would welcome that. ;-) >

Re: [RFC] doc: fix code snippet build warnings

2018-01-10 Thread Tobin C. Harding
On Wed, Jan 10, 2018 at 02:59:58PM -0700, Jonathan Corbet wrote: > On Wed, 10 Jan 2018 15:04:53 +1100 > "Tobin C. Harding" wrote: > > > Posting as RFC in the hope that someone knows how to massage sphinx > > correctly to fix this patch. > > > > Cur

Re: [RFC] doc: fix code snippet build warnings

2018-01-10 Thread Tobin C. Harding
On Thu, Jan 11, 2018 at 09:25:31AM +1100, Tobin C. Harding wrote: > On Wed, Jan 10, 2018 at 02:59:58PM -0700, Jonathan Corbet wrote: > > On Wed, 10 Jan 2018 15:04:53 +1100 > > "Tobin C. Harding" wrote: > > > > > Posting as RFC in the hope that someone kno

Re: [PATCH v2] drivers/fbtft: Fix indentation

2018-01-10 Thread Tobin C. Harding
On Wed, Jan 10, 2018 at 06:30:35PM +0100, Jonny Schaefer wrote: > From: Luis Gerhorst > > This fixes the checkpatch message: > > CHECK: Alignment should match open parenthesis > #1380: FILE: drivers/staging/fbtft/fbtft-core.c:1380: > + dev_warn(dev, > + "n

[GIT PULL] leaking_addresses.pl changes for 4.16-rc1

2018-01-30 Thread Tobin C. Harding
(kernel 4.4 and 4.15), ppc64 (kernel 4.4) and ARM 32-bit (kernel 4.9). Signed-off-by: Tobin C. Harding Tobin C. Harding (10): leaking_addresses: fix typo function not called leaking_addresses: remove mention of

checkpatch changes for 4.16

2018-01-31 Thread Tobin C. Harding
Hi Joe, Can I please bother you with a maintainer question. I know everyone is super busy right now, I'm asking for a smidgen of your time instead of doing it wrong and taking up some of Linus' time since it's merge window and all that. I have the checkpatch set queued ready to do a GIT PULL to

Re: checkpatch changes for 4.16

2018-01-31 Thread Tobin C. Harding
On Wed, Jan 31, 2018 at 02:48:56PM -0800, Joe Perches wrote: > On Thu, 2018-02-01 at 08:46 +1100, Tobin C. Harding wrote: > > Hi Joe, > > > > Can I please bother you with a maintainer question. I know everyone is > > super busy right now, I'm asking for a

Re: checkpatch changes for 4.16

2018-01-31 Thread Tobin C. Harding
On Wed, Jan 31, 2018 at 03:56:19PM -0800, Joe Perches wrote: > On Thu, 2018-02-01 at 10:23 +1100, Tobin C. Harding wrote: > > On Wed, Jan 31, 2018 at 02:48:56PM -0800, Joe Perches wrote: > > > On Thu, 2018-02-01 at 08:46 +1100, Tobin C. Harding wrote: > > > > Hi Joe,

Re: [GIT PULL] leaking_addresses.pl changes for 4.16-rc1

2018-02-01 Thread Tobin C. Harding
On Wed, Jan 31, 2018 at 01:42:36PM +1100, Tobin C. Harding wrote: > The following changes since commit d8a5b80568a9cb66810e75b182018e9edb68e8ff: > > Linux 4.15 (2018-01-28 13:20:33 -0800) > > are available in the git repository at: > > git://github.com/tcharding/linu

Re: [PATCH v5] leaking_addresses: add generic 32-bit support

2018-01-05 Thread Tobin C. Harding
++ > 1 file changed, 156 insertions(+), 34 deletions(-) > > diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl > index a29e13e577a7..b0807b3a3c7c 100755 > --- a/scripts/leaking_addresses.pl > +++ b/scripts/leaking_addresses.pl > @@ -1,10 +1

[PATCH] leaking_addresses: add files to skip

2018-01-05 Thread Tobin C. Harding
Script currently times out when parsing the following files: /proc/kallsyms /proc/sched_debug /proc/PID/smaps None of these files leak kernel addresses. We can skip parsing them. Add entries to list of files to skip. Signed-off-by: Tobin C. Harding --- scripts

[PATCH 0/2] fix kernel-docs for struct iio_trigger

2018-01-05 Thread Tobin C. Harding
ield has a description but lacks a field identifier. Tobin C. Harding (2): iio: add kernel-doc for field @owner iio: add field identifier for @use_count kernel-doc include/linux/iio/trigger.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4

[PATCH] docs: add index entry for networking/msg_zerocopy

2018-01-05 Thread Tobin C. Harding
networking/ toctree. Signed-off-by: Tobin C. Harding --- Documentation/networking/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 66e620866245..19e8a927d79b 100644 --- a/Documentation/networking/index.rst

[PATCH 2/2 RESEND] iio: add field identifier for @use_count kernel-doc

2018-01-05 Thread Tobin C. Harding
Kernel-doc for @use_count does not currently have a field identifier. All the rest of the fields do. @use_count is used internally and should not be accessed directly by the driver so it should be marked as so. Add [INTERN] identifier to @use_count field. Signed-off-by: Tobin C. Harding

[PATCH 1/2 RESEND] iio: add kernel-doc for field @owner

2018-01-05 Thread Tobin C. Harding
When building kernel documentation sphinx emits the following warning warning: No description found for parameter 'owner' Add description for struct member 'owner'. Signed-off-by: Tobin C. Harding --- include/linux/iio/trigger.h | 1 + 1 file changed, 1 insert

[PATCH 0/2 RESEND] fix kernel-docs for struct iio_trigger

2018-01-05 Thread Tobin C. Harding
ield has a description but lacks a field identifier. Tobin C. Harding (2): iio: add kernel-doc for field @owner iio: add field identifier for @use_count kernel-doc include/linux/iio/trigger.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4

Re: [PATCH] leaking_addresses: add files to skip

2018-01-05 Thread Tobin C. Harding
On Fri, Jan 05, 2018 at 04:11:07PM -0800, Kees Cook wrote: > On Fri, Jan 5, 2018 at 2:59 PM, Tobin C. Harding wrote: > > Script currently times out when parsing the following files: > > > > /proc/kallsyms > > /proc/sched_debug > > /proc/P

  1   2   3   4   5   6   7   8   9   10   >