Re: [RFC PATCH iproute2-next] man: Add devlink health man page

2018-09-13 Thread Tobin C. Harding
On Thu, Sep 13, 2018 at 02:58:52PM +0300, Eran Ben Elisha wrote: > > > On 9/13/2018 1:27 PM, Tobin C. Harding wrote: > > On Thu, Sep 13, 2018 at 11:18:16AM +0300, Eran Ben Elisha wrote: > > > Add devlink-health man page. Devlink-health tool will control device > >

Re: [RFC PATCH iproute2-next] man: Add devlink health man page

2018-09-13 Thread Tobin C. Harding
On Thu, Sep 13, 2018 at 11:18:16AM +0300, Eran Ben Elisha wrote: > Add devlink-health man page. Devlink-health tool will control device > health attributes, sensors, actions and logging. > > Signed-off-by: Eran Ben Elisha > > --- > Copy paste

Re: [PATCH net-next RFC] virtio_net: ethtool tx napi configuration

2018-09-13 Thread Tobin C. Harding
On Wed, Sep 12, 2018 at 07:29:11PM -0400, Willem de Bruijn wrote: > From: Willem de Bruijn > > Implement ethtool .set_priv_flags and .get_priv_flags handlers > and use ethtool private flags to toggle transmit napi: > > ethtool --set-priv-flags eth0 tx-napi on > ethtool --show-priv-flags

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 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 0/4] docs: e100[0] fix build errors

2018-06-24 Thread Tobin C. Harding
On Mon, Jun 25, 2018 at 01:11:33AM +, Kirsher, Jeffrey T wrote: > > > > On Jun 24, 2018, at 16:41, Tobin C. Harding wrote: > > > >> On Fri, Jun 22, 2018 at 01:22:37PM -0700, Randy Dunlap wrote: > >> Hi Tobin, > >> > >>> On 06/21

Re: [PATCH net-next] erspan: set bso bit based on mirrored packet's len

2018-05-16 Thread Tobin C. Harding
On Wed, May 16, 2018 at 07:05:34AM -0700, William Tu wrote: > On Mon, May 14, 2018 at 10:33 PM, Tobin C. Harding <to...@apporbit.com> wrote: > > On Mon, May 14, 2018 at 04:54:36PM -0700, William Tu wrote: > >> Before the patch, the erspan BSO bit (Bad/Short/Oversized) is no

Re: [PATCH RFC net-next 0/7] net/ipv6: Fix route append and replace use cases

2018-05-15 Thread Tobin C. Harding
On Tue, May 15, 2018 at 12:25:03AM -0600, David Ahern wrote: > On 5/15/18 12:12 AM, Tobin C. Harding wrote: > > Queue questions on how to run your selftests ;) > > copy tools/testing/selftests/net/fib_tests.sh to test environment. > > Run it with no options to run all tes

Re: [PATCH RFC net-next 0/7] net/ipv6: Fix route append and replace use cases

2018-05-15 Thread Tobin C. Harding
On Mon, May 14, 2018 at 11:54:08PM -0600, David Ahern wrote: > On 5/14/18 11:21 PM, Tobin C. Harding wrote: > > Hi David, > > > > On Mon, May 14, 2018 at 07:51:05PM -0700, David Ahern wrote: > >> This patch set fixes a few append and replace uses cases for

Re: [PATCH net-next] erspan: set bso bit based on mirrored packet's len

2018-05-14 Thread Tobin C. Harding
On Mon, May 14, 2018 at 04:54:36PM -0700, William Tu wrote: > Before the patch, the erspan BSO bit (Bad/Short/Oversized) is not > handled. BSO has 4 possible values: > 00 --> Good frame with no error, or unknown integrity > 11 --> Payload is a Bad Frame with CRC or Alignment Error > 01 -->

Re: [PATCH RFC net-next 0/7] net/ipv6: Fix route append and replace use cases

2018-05-14 Thread Tobin C. Harding
Hi David, On Mon, May 14, 2018 at 07:51:05PM -0700, David Ahern wrote: > This patch set fixes a few append and replace uses cases for IPv6 and > adds test cases that codifies the expectations of how append and replace > are expected to work. Nood question: what commit does this apply on top of

Re: [PATCH] isdn: eicon: fix a missing-check bug

2018-05-09 Thread Tobin C. Harding
On Wed, May 09, 2018 at 12:30:18AM -0500, Wenwen Wang wrote: > Hello > > Could you please review this patch? We need a confirmation because we > are working on an approaching deadline. I didn't know 'we' had deadlines :) Tobin

Re: [PATCH ghak81 RFC V1 4/5] audit: use inline function to set audit context

2018-05-08 Thread Tobin C. Harding
On Fri, May 04, 2018 at 04:54:37PM -0400, Richard Guy Briggs wrote: > Recognizing that the audit context is an internal audit value, use an > access function to set the audit context pointer for the task > rather than reaching directly into the task struct to set it. > > Signed-off-by: Richard

Re: [RFC PATCH 1/3] arcnet: com20020: Add memory map of com20020

2018-05-08 Thread Tobin C. Harding
On Tue, May 08, 2018 at 11:36:51AM +0200, Andrea Greco wrote: > On 05/07/2018 04:55 AM, Tobin C. Harding wrote: > >On Sat, May 05, 2018 at 11:34:45PM +0200, Andrea Greco wrote: > >>From: Andrea Greco <a.gr...@4sigma.it> > > > >Hi Andrea, > > > >Here

Re: [RFC PATCH 3/3] arcnet: com20020: Add ethtool support

2018-05-06 Thread Tobin C. Harding
On Sat, May 05, 2018 at 11:35:29PM +0200, Andrea Greco wrote: > From: Andrea Greco > > Setup ethtols for export com20020 diag register > > Signed-off-by: Andrea Greco > --- > drivers/net/arcnet/com20020-isa.c| 1 + >

Re: [RFC PATCH 2/3] arcnet: com20020: Fixup missing SLOWARB bit

2018-05-06 Thread Tobin C. Harding
On Sat, May 05, 2018 at 11:37:54PM +0200, Andrea Greco wrote: > From: Andrea Greco > > If com20020 clock is major of 40Mhz SLOWARB bit is requested. > > Signed-off-by: Andrea Greco > --- > drivers/net/arcnet/com20020.c | 4 > 1 file changed, 4

Re: [RFC PATCH 1/3] arcnet: com20020: Add memory map of com20020

2018-05-06 Thread Tobin C. Harding
On Sat, May 05, 2018 at 11:34:45PM +0200, Andrea Greco wrote: > From: Andrea Greco Hi Andrea, Here are some (mostly stylistic) suggestions to help you get your driver merged. > Add support for com20022I/com20020, memory mapped chip version. > Support bus: Intel 80xx and

Re: [PATCH v2 bpf-next 2/2] bpf: add selftest for stackmap with build_id in NMI context

2018-05-03 Thread Tobin C. Harding
On Wed, May 02, 2018 at 04:20:30PM -0700, Song Liu wrote: > This new test captures stackmap with build_id with hardware event > PERF_COUNT_HW_CPU_CYCLES. > > Because we only support one ips-to-build_id lookup per cpu in NMI > context, stack_amap will not be able to do the lookup in this test.

Re: [PATCH v2 bpf-next 1/2] bpf: enable stackmap with build_id in nmi context

2018-05-03 Thread Tobin C. Harding
On Wed, May 02, 2018 at 04:20:29PM -0700, Song Liu wrote: > Currently, we cannot parse build_id in nmi context because of > up_read(>mm->mmap_sem), this makes stackmap with build_id > less useful. This patch enables parsing build_id in nmi by putting > the up_read() call in irq_work. To avoid

Re: [PATCH 2/2] drivers core: multi-threading device shutdown

2018-05-02 Thread Tobin C. Harding
This code was a pleasure to read, super clean. On Wed, May 02, 2018 at 11:59:31PM -0400, Pavel Tatashin wrote: > When system is rebooted, halted or kexeced device_shutdown() is > called. > > This function shuts down every single device by calling either: > dev->bus->shutdown(dev) >

[PATCH v2] rsi: Remove stack VLA usage

2018-03-14 Thread Tobin C. Harding
(and re-initialization) so this overhead should not degrade performance. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- This applies onto tip of wireless-drivers next, commit (28bf8312a983 mwifiex: get_channel from firmware v2: - Use k

Re: [RESEND] rsi: Remove stack VLA usage

2018-03-14 Thread Tobin C. Harding
On Wed, Mar 14, 2018 at 11:19:53AM +0200, Kalle Valo wrote: > "Tobin C. Harding" <m...@tobin.cc> writes: > > > Added Konstantin in case he is in charge of administering > > patchwork.kernel.org? > > > > On Tue, Mar 13, 2018 at 07:53:34PM -0700, Kees

Re: [RESEND] rsi: Remove stack VLA usage

2018-03-13 Thread Tobin C. Harding
Added Konstantin in case he is in charge of administering patchwork.kernel.org? On Tue, Mar 13, 2018 at 07:53:34PM -0700, Kees Cook wrote: > On Tue, Mar 13, 2018 at 7:11 PM, Tobin C. Harding <m...@tobin.cc> wrote: > > On Tue, Mar 13, 2018 at 11:00:47PM +0200, Andy Shevchenko wro

Re: [RESEND] rsi: Remove stack VLA usage

2018-03-13 Thread Tobin C. Harding
On Tue, Mar 13, 2018 at 11:00:47PM +0200, Andy Shevchenko wrote: > On Tue, Mar 13, 2018 at 10:17 PM, tcharding wrote: > > On Mon, Mar 12, 2018 at 09:46:06AM +, Kalle Valo wrote: > >> tcharding wrote: > > I'm pretty much sure it depends on the original email

Re: [RESEND PATCH] rsi: Remove stack VLA usage

2018-03-13 Thread Tobin C. Harding
On Sun, Mar 11, 2018 at 09:06:10PM -0500, Larry Finger wrote: > On 03/11/2018 08:43 PM, Tobin C. Harding wrote: > >The kernel would like to have all stack VLA usage removed[1]. rsi uses > >a VLA based on 'blksize'. Elsewhere in the SDIO code maximum block size > >is defined

[RESEND PATCH] rsi: Remove stack VLA usage

2018-03-11 Thread Tobin C. Harding
the array in case of programmer error. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- RESEND: add wireless mailing list to CC's (requested by Kalle) drivers/net/wireless/rsi/rsi_91x_hal.c | 13 +++-- drivers/net/wireless/rsi/rsi_91x_sdio.

Re: [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-11 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 01:10:30PM -0800, Linus Torvalds wrote: > On Fri, Mar 9, 2018 at 12:05 PM, Kees Cook wrote: > > When max() is used in stack array size calculations from literal values > > (e.g. "char foo[max(sizeof(struct1), sizeof(struct2))]", the compiler > >

Re: [PATCH] rsi: Remove stack VLA usage

2018-03-11 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 12:37:06PM +0200, Kalle Valo wrote: > "Tobin C. Harding" <m...@tobin.cc> writes: > > > The kernel would like to have all stack VLA usage removed[1]. rsi uses > > a VLA based on 'blksize'. Elsewhere in the SDIO code maximum block size &

[PATCH] rsi: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
the array in case of programmer error. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- drivers/net/wireless/rsi/rsi_91x_hal.c | 13 +++-- drivers/net/wireless/rsi/rsi_91x_sdio.c | 9 +++-- 2 files changed, 14 insertions(+), 8 del

[PATCH v3 1/3] kallsyms: don't leak address when symbol not found

2017-12-19 Thread Tobin C. Harding
is not enabled return an error value instead of printing the raw address. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- kernel/kallsyms.c | 31 +-- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index d5fa41

[PATCH v3 3/3] trace: print address if symbol not found

2017-12-19 Thread Tobin C. Harding
behaviour. We should not break tracing when applying the previous patch. We can maintain the original behaviour by checking the return code on calls to sprint_symbol() and friends. Check return code and print actual address on error (i.e symbol not found). Signed-off-by: Tobin C. Harding <

[PATCH v3 0/3] kallsyms: don't leak address

2017-12-19 Thread Tobin C. Harding
aviour in ftrace. thanks, Tobin. v3: - Remove const string and use ternary operator (suggested by Joe Perches) v2: - Add kernel command-line parameter. - Remove unnecessary function. - Fix broken ftrace code (and actually build and test ftrace code). All code tested. Tobin C. Hard

[PATCH v3 2/3] vsprintf: print if symbol not found

2017-12-19 Thread Tobin C. Harding
haviour so that sprint_symbol() returns an error if symbol not found. With this patch in place we can print a sanitized message '' instead of leaking the address. Print '' for printk specifier %p[sSB] if symbol look up fails. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- lib/vsprintf.c | 9 + 1

Re: [PATCH v2 2/3] vsprintf: print if symbol not found

2017-12-18 Thread Tobin C. Harding
On Mon, Dec 18, 2017 at 10:18:27PM -0800, Joe Perches wrote: > On Tue, 2017-12-19 at 14:28 +1100, Tobin C. Harding wrote: > > Depends on: commit 40eee173a35e ("kallsyms: don't leak address when > > symbol not found") > > > > Currently vsprintf for speci

Re: [PATCH 3/3] trace: print address if symbol not found

2017-12-18 Thread Tobin C. Harding
On Mon, Dec 18, 2017 at 10:37:38PM -0500, Steven Rostedt wrote: > On Tue, 19 Dec 2017 14:00:11 +1100 > "Tobin C. Harding" <m...@tobin.cc> wrote: > > > I ran through these as outlined here for the new version (v4). This hits > > the modified code bu

[PATCH v2 2/3] vsprintf: print if symbol not found

2017-12-18 Thread Tobin C. Harding
haviour so that sprint_symbol() returns an error if symbol not found. With this patch in place we can print a sanitized message '' instead of leaking the address. Print '' for printk specifier %p[sSB] if symbol look up fails. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- lib/vsprintf.c | 11 ---

[PATCH v2 1/3] kallsyms: don't leak address when symbol not found

2017-12-18 Thread Tobin C. Harding
is not enabled return an error value instead of printing the raw address. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- kernel/kallsyms.c | 31 +-- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index d5fa41

[PATCH v2 3/3] trace: print address if symbol not found

2017-12-18 Thread Tobin C. Harding
behaviour. We should not break tracing when applying the previous patch. We can maintain the original behaviour by checking the return code on calls to sprint_symbol() and friends. Check return code and print actual address on error (i.e symbol not found). Signed-off-by: Tobin C. Harding <

[PATCH v2 0/3] kallsyms: don't leak address

2017-12-18 Thread Tobin C. Harding
aviour in ftrace. thanks, Tobin. v2: - Add kernel command-line parameter. - Remove unnecessary function. - Fix broken ftrace code (and actually build and test ftrace code). Patch 1 and 2 tested. Patch 3 (ftrace) tested but not all code paths executed (discussed with Steve in another thread). T

Re: [PATCH 3/3] trace: print address if symbol not found

2017-12-18 Thread Tobin C. Harding
On Tue, Dec 19, 2017 at 02:00:11PM +1100, Tobin C. Harding wrote: > On Mon, Dec 18, 2017 at 06:51:43PM -0500, Steven Rostedt wrote: > > On Tue, 19 Dec 2017 08:16:14 +1100 > > "Tobin C. Harding" <m...@tobin.cc> wrote: > > > > > > > #endif /* _L

Re: [PATCH 3/3] trace: print address if symbol not found

2017-12-18 Thread Tobin C. Harding
On Mon, Dec 18, 2017 at 06:51:43PM -0500, Steven Rostedt wrote: > On Tue, 19 Dec 2017 08:16:14 +1100 > "Tobin C. Harding" <m...@tobin.cc> wrote: > > > > > #endif /* _LINUX_KERNEL_TRACE_H */ > > > > diff --git a/kernel/trace/trace_events_h

Re: [PATCH 1/3] kallsyms: don't leak address when symbol not found

2017-12-18 Thread Tobin C. Harding
On Mon, Dec 18, 2017 at 06:43:24PM -0500, Steven Rostedt wrote: > On Tue, 19 Dec 2017 09:41:29 +1100 > "Tobin C. Harding" <m...@tobin.cc> wrote: > > > Current suggestion on list is to remove this function. Do you have a use > > case in mind where deb

Re: [PATCH 3/3] trace: print address if symbol not found

2017-12-18 Thread Tobin C. Harding
On Mon, Dec 18, 2017 at 06:51:43PM -0500, Steven Rostedt wrote: > On Tue, 19 Dec 2017 08:16:14 +1100 > "Tobin C. Harding" <m...@tobin.cc> wrote: > > > > > #endif /* _LINUX_KERNEL_TRACE_H */ > > > > diff --git a/kernel/trace/trace_events_h

Re: [PATCH 1/3] kallsyms: don't leak address when symbol not found

2017-12-18 Thread Tobin C. Harding
On Mon, Dec 18, 2017, at 20:55, Felix Fietkau wrote: > On 2017-12-18 00:53, Tobin C. Harding wrote: > > Currently if kallsyms_lookup() fails to find the symbol then the address > > is printed. This potentially leaks sensitive information. Instead of > > printing the address w

Re: [PATCH 3/3] trace: print address if symbol not found

2017-12-18 Thread Tobin C. Harding
On Mon, Dec 18, 2017 at 11:49:47AM -0500, Steven Rostedt wrote: > On Mon, 18 Dec 2017 10:53:32 +1100 > "Tobin C. Harding" <m...@tobin.cc> wrote: > > > Fixes behaviour modified by: commit bd6b239cdbb2 ("kallsyms: don't leak > > address when symbol n

Re: [PATCH 3/3] trace: print address if symbol not found

2017-12-18 Thread Tobin C. Harding
On Mon, Dec 18, 2017 at 11:49:47AM -0500, Steven Rostedt wrote: > On Mon, 18 Dec 2017 10:53:32 +1100 > "Tobin C. Harding" <m...@tobin.cc> wrote: > > > Fixes behaviour modified by: commit bd6b239cdbb2 ("kallsyms: don't leak > > address when symbol n

Re: [kernel-hardening] [PATCH 0/3] kallsyms: don't leak address

2017-12-18 Thread Tobin C. Harding
On Mon, Dec 18, 2017 at 05:00:48PM +1100, Tobin C. Harding wrote: > On Mon, Dec 18, 2017 at 04:31:25PM +1100, Michael Ellerman wrote: > > "Tobin C. Harding" <m...@tobin.cc> writes: > > > > > This set plugs a kernel address leak that occurs if kalls

Re: [kernel-hardening] [PATCH 0/3] kallsyms: don't leak address

2017-12-17 Thread Tobin C. Harding
On Mon, Dec 18, 2017 at 04:31:25PM +1100, Michael Ellerman wrote: > "Tobin C. Harding" <m...@tobin.cc> writes: > > > This set plugs a kernel address leak that occurs if kallsyms symbol > > look up fails. This set was prompted by a leaking address found usin

Re: [PATCH 2/3] vsprintf: print if symbol not found

2017-12-17 Thread Tobin C. Harding
On Sun, Dec 17, 2017 at 04:04:14PM -0800, Joe Perches wrote: > On Mon, 2017-12-18 at 10:53 +1100, Tobin C. Harding wrote: > > Depends on: commit bd6b239cdbb2 ("kallsyms: don't leak address when > > symbol not found") > > > > Currently vsprintf for speci

[PATCH 2/3] vsprintf: print if symbol not found

2017-12-17 Thread Tobin C. Harding
int_symbol() returns an error if symbol not found. With this patch in place we can print a sanitized message '' instead of leaking the address. Print '' for printk specifier %s[sSB] if no symbol is found. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- include/linux/kernel.h | 2 ++

[PATCH 0/3] kallsyms: don't leak address

2017-12-17 Thread Tobin C. Harding
been in flight for 3 weeks with no negative response. Patch 1 - return error code if symbol look up fails. Patch 2 - print to buffer if symbol look up returns an error. Patch 3 - maintain current behaviour in ftrace. Patch 3 (the ftrace stuff) is untested. thanks, Tobin. Tobin C. Harding (3

[PATCH 1/3] kallsyms: don't leak address when symbol not found

2017-12-17 Thread Tobin C. Harding
of printing address to argument buffer. Leave buffer in a sane state. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- kernel/kallsyms.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index d5fa4116688a..23b9336c1461

[PATCH 3/3] trace: print address if symbol not found

2017-12-17 Thread Tobin C. Harding
behaviour. We should not break tracing when applying the previous patch. We can maintain the original behaviour by checking the return code on calls to sprint_symbol() and friends. Check return code and print actual address on error (i.e symbol not found). Signed-off-by: Tobin C. Harding <

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Tobin C. Harding
On Wed, Dec 06, 2017 at 05:45:37PM +0900, Sergey Senozhatsky wrote: > On (12/06/17 09:32), Geert Uytterhoeven wrote: > [..] > > >> show_fault_oops(struct pt_regs *regs, unsigned long error_code, > > >> unsigned long address) > > >> ... > > >> printk(KERN_CONT " at %p\n",

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Tobin C. Harding
On Wed, Dec 06, 2017 at 09:32:14AM +0100, Geert Uytterhoeven wrote: > Hi Linus, > > On Wed, Dec 6, 2017 at 2:59 AM, Linus Torvalds > wrote: > > On Tue, Dec 5, 2017 at 5:36 PM, Sergey Senozhatsky > > wrote: > >> I see some %p-s

Re: [PATCH V11 3/5] printk: hash addresses printed with %p

2017-12-05 Thread Tobin C. Harding
On Tue, Dec 05, 2017 at 09:20:57PM +0100, Geert Uytterhoeven wrote: > Hi Tobin, > > On Wed, Nov 29, 2017 at 3:05 AM, Tobin C. Harding <m...@tobin.cc> wrote: > > Currently there exist approximately 14 000 places in the kernel where > > addresses are being pr

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Tobin C. Harding
On Wed, Nov 29, 2017 at 08:41:36PM -0800, Joe Perches wrote: > On Thu, 2017-11-30 at 15:18 +1100, Tobin C. Harding wrote: > > On Wed, Nov 29, 2017 at 07:58:26PM -0800, Joe Perches wrote: > > > On Thu, 2017-11-30 at 10:26 +1100, Tobin C. Harding wrote: > > > > On W

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Tobin C. Harding
On Wed, Nov 29, 2017 at 07:58:26PM -0800, Joe Perches wrote: > On Thu, 2017-11-30 at 10:26 +1100, Tobin C. Harding wrote: > > On Wed, Nov 29, 2017 at 03:20:58PM -0800, Andrew Morton wrote: > > > On Wed, 29 Nov 2017 13:05:04 +1100 "Tobin C. Harding"

Re: [RFC 1/3] kallsyms: don't leak address when symbol not found

2017-11-29 Thread Tobin C. Harding
I reordered the To's and CC's, I hope this doesn't break threading. (clearly I haven't groked email yet :( ) On Tue, Nov 28, 2017 at 09:30:17AM +1100, Tobin C. Harding wrote: > Currently if kallsyms_lookup() fails to find the symbol then the address > is printed. This potentially leaks sen

Re: [kernel-hardening] Re: [RFC 0/3] kallsyms: don't leak address when printing symbol

2017-11-29 Thread Tobin C. Harding
On Tue, Nov 28, 2017 at 08:58:44AM +0530, Kaiwan N Billimoria wrote: > On Tue, Nov 28, 2017 at 7:20 AM, Tobin C. Harding <m...@tobin.cc> wrote: > > > > Noob question: how do we _know_ this. In other words how do we know no > > userland tools rely on the current behaviou

[PATCH 0/2] replace %pK with %p

2017-11-29 Thread Tobin C. Harding
always revert this patch if it turns out to be worthless, right? Patch 1 was created using for file in $(git grep -l '%pK') do perl -pi -e 's/%pK/%p/g' $file done thanks, Tobin. Tobin C. Harding (2): tree-wide: replace all users of %pK with %p printk: add specifier %pz, for zeroed

[PATCH 2/2] printk: add specifier %pz, for zeroed address

2017-11-29 Thread Tobin C. Harding
C. Harding <m...@tobin.cc> --- Documentation/printk-formats.txt | 11 +++ lib/vsprintf.c | 18 ++ 2 files changed, 29 insertions(+) diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt index aa0a776c817a..f88b06485378

[PATCH 1/2] tree-wide: replace all users of %pK with %p

2017-11-29 Thread Tobin C. Harding
(and kptr_restrict). Search and replace all uses of %pK with %p. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- arch/arm/mm/physaddr.c | 2 +- arch/arm64/mm/physaddr.c | 2 +- arch/mips/kernel/relocate.c

Re: [PATCH V11 0/5] hash addresses printed with %p

2017-11-29 Thread Tobin C. Harding
On Wed, Nov 29, 2017 at 03:20:40PM -0800, Andrew Morton wrote: > On Wed, 29 Nov 2017 13:05:00 +1100 "Tobin C. Harding" <m...@tobin.cc> wrote: > > > Currently there exist approximately 14 000 places in the Kernel where > > addresses are being printed using

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Tobin C. Harding
On Wed, Nov 29, 2017 at 03:20:58PM -0800, Andrew Morton wrote: > On Wed, 29 Nov 2017 13:05:04 +1100 "Tobin C. Harding" <m...@tobin.cc> wrote: > > > printk specifier %p now hashes all addresses before printing. Sometimes > > we need to see the actual unmodified a

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-28 Thread Tobin C. Harding
On Tue, Nov 28, 2017 at 06:29:02PM -0800, Linus Torvalds wrote: > On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding <m...@tobin.cc> wrote: > > > >Let's add specifier %px as a > > clear, opt-in, way to print a pointer and maintain some level of > > isolati

Re: [PATCH V11 2/5] vsprintf: refactor %pK code out of pointer()

2017-11-28 Thread Tobin C. Harding
On Tue, Nov 28, 2017 at 09:39:57PM -0500, Steven Rostedt wrote: > On Wed, 29 Nov 2017 13:05:02 +1100 > "Tobin C. Harding" <m...@tobin.cc> wrote: > > > + /* > > +* kptr_restrict==1 cannot be used in IRQ context > > +

[PATCH V11 2/5] vsprintf: refactor %pK code out of pointer()

2017-11-28 Thread Tobin C. Harding
Currently code to handle %pK is all within the switch statement in pointer(). This is the wrong level of abstraction. Each of the other switch clauses call a helper function, pK should do the same. Refactor code out of pointer() to new function restricted_pointer(). Signed-off-by: Tobin C

[PATCH V11 1/5] docs: correct documentation for %pK

2017-11-28 Thread Tobin C. Harding
Current documentation indicates that %pK prints a leading '0x'. This is not the case. Correct documentation for printk specifier %pK. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- Documentation/printk-formats.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[PATCH V11 0/5] hash addresses printed with %p

2017-11-28 Thread Tobin C. Harding
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 (5): docs: correct documentation for %pK vsprintf: refactor %pK code out of pointer() printk: hash addresses printed with %p vsprintf: add print

[PATCH V11 3/5] printk: hash addresses printed with %p

2017-11-28 Thread Tobin C. Harding
ty 166 sound 152 tools 2 virt Add 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 <m...@tobin.cc> --- Documentation/printk-formats.txt | 12 - l

[PATCH V11 5/5] kasan: use %px to print addresses instead of %p

2017-11-28 Thread Tobin C. Harding
Pointers printed with %p are now hashed by default. Kasan needs the actual address. We can use the new printk specifier %px for this purpose. Use %px instead of %p to print addresses. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- mm/kasan/report.c | 8 1 file chan

[PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-28 Thread Tobin C. Harding
the already existent 50 000 %lx call sites. Let's add specifier %px as a clear, opt-in, way to print a pointer and maintain some level of isolation from all the other hex integer output within the Kernel. Add printk specifier %px to print the actual unmodified address. Signed-off-by: Tobin C. Harding &l

Re: [RFC 0/3] kallsyms: don't leak address when printing symbol

2017-11-27 Thread Tobin C. Harding
On Mon, Nov 27, 2017 at 04:52:21PM -0800, Kees Cook wrote: > On Mon, Nov 27, 2017 at 2:30 PM, Tobin C. Harding <m...@tobin.cc> wrote: > > This is an RFC for two reasons. > > > > 1) I don't know who this patch set may break? > > 2) Patch set includes a func

[RFC 0/3] kallsyms: don't leak address when printing symbol

2017-11-27 Thread Tobin C. Harding
stuff) untested :) thanks, Tobin. Tobin C. Harding (3): kallsyms: don't leak address when symbol not found vsprintf: print if symbol not found trace: print address if symbol not found include/linux/kernel.h | 2 ++ kernel/kallsyms.c| 6 -- kernel/trace

[RFC 1/3] kallsyms: don't leak address when symbol not found

2017-11-27 Thread Tobin C. Harding
of printing address to argument buffer. Leave buffer in a sane state. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- kernel/kallsyms.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 531ffa984bc2..4bfa4ee3ce93

[RFC 3/3] trace: print address if symbol not found

2017-11-27 Thread Tobin C. Harding
behaviour. We should not break tracing when applying the previous patch. We can maintain the original behaviour by checking the return code on calls to sprint_symbol() and friends. Check return code and print actual address on error (i.e symbol not found). Signed-off-by: Tobin C. Harding <

[RFC 2/3] vsprintf: print if symbol not found

2017-11-27 Thread Tobin C. Harding
_no_symbol(). Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- include/linux/kernel.h | 2 ++ lib/vsprintf.c | 18 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index ce51455e2adf..89e

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

2017-11-19 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: [snip] > Finally, unsure if am working against the latest ver of your script Tobin, > apologies if not. The latest version of leaking_addresses.

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

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: [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: [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: [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 <frowand.l...@gmail.com> writes: > >> Hi Michael, Tobin, > >> > >> On 11/08/1

Re: [PATCH] kallsyms: don't leak address when printing symbol

2017-11-08 Thread Tobin C. Harding
On Wed, Nov 08, 2017 at 10:35:55PM -0500, Steven Rostedt wrote: > On Thu, 9 Nov 2017 12:50:29 +1100 > "Tobin C. Harding" <m...@tobin.cc> wrote: > > > Currently if a pointer is printed using %p[ssB] and the symbol is not > > found (kallsyms_lookup() fa

[PATCH v2 0/8] scripts/leaking_addresses: add summary reporting

2017-11-08 Thread Tobin C. Harding
: - Basically everything except the summary reporting, including re-write of the cover-letter. Tobin C. Harding (8): scripts/leaking_addresses: use tabs not spaces scripts/leaking_addresses: remove dead code scripts/leaking_addresses: remove command line options scripts/leaking_addresses: fix

[PATCH v2 2/8] scripts/leaking_addresses: remove dead code

2017-11-08 Thread Tobin C. Harding
debug_arrays is not called. Also, %seen hash is not used. We should remove unused code. Remove dead code. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- scripts/leaking_addresses.pl | 9 - 1 file changed, 9 deletions(-) diff --git a/scripts/leaking_addresses.pl b/s

[PATCH v2 1/8] scripts/leaking_addresses: use tabs not spaces

2017-11-08 Thread Tobin C. Harding
Current code uses spaces instead of tabs in places. Use tabs instead of spaces. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- scripts/leaking_addresses.pl | 54 ++-- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/s

[PATCH v2 5/8] scripts/leaking_addresses: add to exclude files/paths

2017-11-08 Thread Tobin C. Harding
There are a couple more files that cause the script to stall. /sys/firmware/devicetree and its symlink /proc/device-tree, reported by Michael Ellerman. usbmon should be skipped were ever it appears. Reported by Kees Cook Add files to be excluded from parsing. Signed-off-by: Tobin C. Harding &l

[PATCH v2 7/8] scripts/leaking_addresses: add support for ppc64

2017-11-08 Thread Tobin C. Harding
Currently script is targeted at x86_64. We can support other architectures by using the correct regular expressions for each architecture. Add the infrastructure to support multiple architectures. Add support for ppc64. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- s

[PATCH v2 4/8] scripts/leaking_addresses: fix comment typo

2017-11-08 Thread Tobin C. Harding
Fix typo in comment string. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- scripts/leaking_addresses.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index 719ed0aaede7..3f8c6e230962 100755 --- a/s

[PATCH v2 3/8] scripts/leaking_addresses: remove command line options

2017-11-08 Thread Tobin C. Harding
Currently script accepts files to skip. This was added to make running the script faster (for repeat runs). We can remove this functionality in preparation for adding sub commands (scan and format) to the script. Remove command line options. Signed-off-by: Tobin C. Harding <m...@tobin

[PATCH v2 8/8] scripts/leaking_addresses: add timeout on file read

2017-11-08 Thread Tobin C. Harding
-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- scripts/leaking_addresses.pl | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index 1d6ab7f1b10c..

[PATCH v2 6/8] scripts/leaking_addresses: add summary reporting

2017-11-08 Thread Tobin C. Harding
the process by writing the results to file for subsequent viewing. Add command line options to enable summary reporting, including options to write to and read from file. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- scripts/leaking_addresses.pl

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

2017-11-08 Thread Tobin C. Harding
On Thu, Nov 09, 2017 at 11:49:52AM +1100, Michael Ellerman wrote: > "Tobin C. Harding" <m...@tobin.cc> writes: > > > On Wed, Nov 08, 2017 at 11:10:56PM +1100, Michael Ellerman wrote: > >> "Tobin C. Harding" <m...@tobin.cc> writes: > &g

[PATCH] kallsyms: don't leak address when printing symbol

2017-11-08 Thread Tobin C. Harding
Currently if a pointer is printed using %p[ssB] and the symbol is not found (kallsyms_lookup() fails) then we print the actual address. This leaks kernel addresses. We should instead print something _safe_. Print "" instead of kernel address. Signed-off-by: Tobin C. Harding <

Re: [PATCH 5/7] scripts/leaking_addresses: add emailing results

2017-11-08 Thread Tobin C. Harding
On Wed, Nov 08, 2017 at 12:51:20PM +0100, Greg KH wrote: > On Wed, Nov 08, 2017 at 11:16:43AM +0100, Petr Mladek wrote: > > On Wed 2017-11-08 14:37:37, Tobin C. Harding wrote: > > > Developers may not have the time (or inclination) to investigate script > > > output. T

Re: [PATCH 4/7] scripts/leaking_addresses: add reporting

2017-11-08 Thread Tobin C. Harding
On Wed, Nov 08, 2017 at 11:42:21AM +0100, Petr Mladek wrote: > On Wed 2017-11-08 14:37:36, Tobin C. Harding wrote: > > Currently script just dumps all results found. Potentially, this risks > > loosing single results among multiple duplicate results. We need some > > way of r

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

2017-11-08 Thread Tobin C. Harding
On Wed, Nov 08, 2017 at 11:10:56PM +1100, Michael Ellerman wrote: > "Tobin C. Harding" <m...@tobin.cc> writes: [snip] Hi Michael, I'm working an adding support for ppc64 to leaking_addresses.pl, I've added the kernel address regular expression that you suggested. I'd li

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

2017-11-08 Thread Tobin C. Harding
On Wed, Nov 08, 2017 at 11:10:56PM +1100, Michael Ellerman wrote: > "Tobin C. Harding" <m...@tobin.cc> writes: > > Currently we are leaking addresses from the kernel to user space. This > > script is an attempt to find some of those leakages. Script parses > &

  1   2   >