Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-30 Thread Rasmus Villemoes
On Tue, Sep 29 2015, Kees Cook wrote: > On Tue, Sep 29, 2015 at 12:10 AM, Rasmus Villemoes > wrote: > >> I guess I could, but do we really want to intentionally trigger >> WARN_ON_ONCEs? Say some distro chooses to load this module at boot >> time, then we'd both spam the kernel log with "false

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-30 Thread Rasmus Villemoes
On Wed, Sep 30 2015, Andy Shevchenko wrote: > It's still better to distinguish what function does by names > test vs. __test confuses me. Think of test() as the ordinary "public" interface and __test() as "private, but we expose it because you might need it, if you know what you're doing".

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-30 Thread Andy Shevchenko
On Mon, 2015-09-28 at 22:55 +0200, Rasmus Villemoes wrote: > On Mon, Sep 28 2015, Andy Shevchenko < > andriy.shevche...@linux.intel.com> wrote: > > > On Fri, 2015-09-25 at 19:41 +0200, Rasmus Villemoes wrote: > > > This adds a simple module for testing the kernel's printf > > > facilities.

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-30 Thread Andy Shevchenko
On Mon, 2015-09-28 at 22:55 +0200, Rasmus Villemoes wrote: > On Mon, Sep 28 2015, Andy Shevchenko < > andriy.shevche...@linux.intel.com> wrote: > > > On Fri, 2015-09-25 at 19:41 +0200, Rasmus Villemoes wrote: > > > This adds a simple module for testing the kernel's printf > > > facilities.

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-30 Thread Rasmus Villemoes
On Wed, Sep 30 2015, Andy Shevchenko wrote: > It's still better to distinguish what function does by names > test vs. __test confuses me. Think of test() as the ordinary "public" interface and __test() as "private, but we expose it because you might need it,

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-30 Thread Rasmus Villemoes
On Tue, Sep 29 2015, Kees Cook wrote: > On Tue, Sep 29, 2015 at 12:10 AM, Rasmus Villemoes > wrote: > >> I guess I could, but do we really want to intentionally trigger >> WARN_ON_ONCEs? Say some distro chooses to load this module at boot >>

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-29 Thread Kees Cook
On Tue, Sep 29, 2015 at 12:10 AM, Rasmus Villemoes wrote: > On Tue, Sep 29 2015, Kees Cook wrote: > >>> +static void __init >>> +test_string(void) >>> +{ >>> + test("", "%s%.0s", "", "123"); >>> + test("ABCD|abc|123", "%s|%.3s|%.*s", "ABCD", "abcdef", 3, "123456"); >>> +

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-29 Thread Rasmus Villemoes
On Tue, Sep 29 2015, Kees Cook wrote: >> +static void __init >> +test_string(void) >> +{ >> + test("", "%s%.0s", "", "123"); >> + test("ABCD|abc|123", "%s|%.3s|%.*s", "ABCD", "abcdef", 3, "123456"); >> + test("1 | 2|3 | 4|5 ", "%-3s|%3s|%-*s|%*s|%*s", "1", "2", 3, >> "3",

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-29 Thread Rasmus Villemoes
On Tue, Sep 29 2015, Kees Cook wrote: >> +static void __init >> +test_string(void) >> +{ >> + test("", "%s%.0s", "", "123"); >> + test("ABCD|abc|123", "%s|%.3s|%.*s", "ABCD", "abcdef", 3, "123456"); >> + test("1 | 2|3 | 4|5 ",

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-29 Thread Kees Cook
On Tue, Sep 29, 2015 at 12:10 AM, Rasmus Villemoes wrote: > On Tue, Sep 29 2015, Kees Cook wrote: > >>> +static void __init >>> +test_string(void) >>> +{ >>> + test("", "%s%.0s", "", "123"); >>> + test("ABCD|abc|123", "%s|%.3s|%.*s",

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-28 Thread Kees Cook
On Fri, Sep 25, 2015 at 10:41 AM, Rasmus Villemoes wrote: > This adds a simple module for testing the kernel's printf > facilities. Previously, some %p extensions have caused a wrong return > value in case the entire output didn't fit and/or been unusable in > kasprintf(). This should help catch

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-28 Thread Rasmus Villemoes
On Mon, Sep 28 2015, Andy Shevchenko wrote: > On Fri, 2015-09-25 at 19:41 +0200, Rasmus Villemoes wrote: >> This adds a simple module for testing the kernel's printf >> facilities. Previously, some %p extensions have caused a wrong return >> value in case the entire output didn't fit and/or been

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-28 Thread Andy Shevchenko
On Fri, 2015-09-25 at 19:41 +0200, Rasmus Villemoes wrote: > This adds a simple module for testing the kernel's printf > facilities. Previously, some %p extensions have caused a wrong return > value in case the entire output didn't fit and/or been unusable in > kasprintf(). This should help catch

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-28 Thread Andy Shevchenko
On Fri, 2015-09-25 at 19:41 +0200, Rasmus Villemoes wrote: > This adds a simple module for testing the kernel's printf > facilities. Previously, some %p extensions have caused a wrong return > value in case the entire output didn't fit and/or been unusable in > kasprintf(). This should help catch

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-28 Thread Kees Cook
On Fri, Sep 25, 2015 at 10:41 AM, Rasmus Villemoes wrote: > This adds a simple module for testing the kernel's printf > facilities. Previously, some %p extensions have caused a wrong return > value in case the entire output didn't fit and/or been unusable in >

Re: [PATCH 4/4] test_printf: test printf family at runtime

2015-09-28 Thread Rasmus Villemoes
On Mon, Sep 28 2015, Andy Shevchenko wrote: > On Fri, 2015-09-25 at 19:41 +0200, Rasmus Villemoes wrote: >> This adds a simple module for testing the kernel's printf >> facilities. Previously, some %p extensions have caused a wrong return >> value in case the

[PATCH 4/4] test_printf: test printf family at runtime

2015-09-25 Thread Rasmus Villemoes
This adds a simple module for testing the kernel's printf facilities. Previously, some %p extensions have caused a wrong return value in case the entire output didn't fit and/or been unusable in kasprintf(). This should help catch such issues. Also, it should help ensure that changes to the

[PATCH 4/4] test_printf: test printf family at runtime

2015-09-25 Thread Rasmus Villemoes
This adds a simple module for testing the kernel's printf facilities. Previously, some %p extensions have caused a wrong return value in case the entire output didn't fit and/or been unusable in kasprintf(). This should help catch such issues. Also, it should help ensure that changes to the