Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 13:01, Geert Uytterhoeven wrote: > Hi Rasmus, > > On Thu, Sep 27, 2018 at 12:55 PM Rasmus Villemoes > wrote: >> On 2018-09-27 01:13, Kees Cook wrote: >> >> Just drop devm_kfree_const and teach devm_kfree to ignore >> is_kernel_rodata(). That avoids the 50-100 bytes of overhead for

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 13:01, Geert Uytterhoeven wrote: > Hi Rasmus, > > On Thu, Sep 27, 2018 at 12:55 PM Rasmus Villemoes > wrote: >> On 2018-09-27 01:13, Kees Cook wrote: >> >> Just drop devm_kfree_const and teach devm_kfree to ignore >> is_kernel_rodata(). That avoids the 50-100 bytes of overhead for

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Geert Uytterhoeven
Hi Rasmus, On Thu, Sep 27, 2018 at 12:55 PM Rasmus Villemoes wrote: > On 2018-09-27 01:13, Kees Cook wrote: > > On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: > >> Provide a resource managed version of kstrdup_const(). This variant > >> internally calls devm_kstrdup() on pointers

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Geert Uytterhoeven
Hi Rasmus, On Thu, Sep 27, 2018 at 12:55 PM Rasmus Villemoes wrote: > On 2018-09-27 01:13, Kees Cook wrote: > > On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: > >> Provide a resource managed version of kstrdup_const(). This variant > >> internally calls devm_kstrdup() on pointers

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 01:13, Kees Cook wrote: > On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: >> Provide a resource managed version of kstrdup_const(). This variant >> internally calls devm_kstrdup() on pointers that are outside of >> .rodata section and returns the string as is otherwise.

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 01:13, Kees Cook wrote: > On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: >> Provide a resource managed version of kstrdup_const(). This variant >> internally calls devm_kstrdup() on pointers that are outside of >> .rodata section and returns the string as is otherwise.

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Bartosz Golaszewski
czw., 27 wrz 2018 o 01:20 Kees Cook napisał(a): > > On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: > > Provide a resource managed version of kstrdup_const(). This variant > > internally calls devm_kstrdup() on pointers that are outside of > > .rodata section and returns the string

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Bartosz Golaszewski
czw., 27 wrz 2018 o 01:20 Kees Cook napisał(a): > > On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: > > Provide a resource managed version of kstrdup_const(). This variant > > internally calls devm_kstrdup() on pointers that are outside of > > .rodata section and returns the string

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-26 Thread Kees Cook
On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: > Provide a resource managed version of kstrdup_const(). This variant > internally calls devm_kstrdup() on pointers that are outside of > .rodata section and returns the string as is otherwise. > > Also provide a corresponding version of

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-26 Thread Kees Cook
On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: > Provide a resource managed version of kstrdup_const(). This variant > internally calls devm_kstrdup() on pointers that are outside of > .rodata section and returns the string as is otherwise. > > Also provide a corresponding version of

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-24 Thread Mike Rapoport
On Mon, Sep 24, 2018 at 12:11:49PM +0200, Bartosz Golaszewski wrote: > Provide a resource managed version of kstrdup_const(). This variant > internally calls devm_kstrdup() on pointers that are outside of > .rodata section and returns the string as is otherwise. > > Also provide a corresponding

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-24 Thread Mike Rapoport
On Mon, Sep 24, 2018 at 12:11:49PM +0200, Bartosz Golaszewski wrote: > Provide a resource managed version of kstrdup_const(). This variant > internally calls devm_kstrdup() on pointers that are outside of > .rodata section and returns the string as is otherwise. > > Also provide a corresponding

[PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-24 Thread Bartosz Golaszewski
Provide a resource managed version of kstrdup_const(). This variant internally calls devm_kstrdup() on pointers that are outside of .rodata section and returns the string as is otherwise. Also provide a corresponding version of devm_kfree(). Signed-off-by: Bartosz Golaszewski Reviewed-by: Bjorn

[PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-24 Thread Bartosz Golaszewski
Provide a resource managed version of kstrdup_const(). This variant internally calls devm_kstrdup() on pointers that are outside of .rodata section and returns the string as is otherwise. Also provide a corresponding version of devm_kfree(). Signed-off-by: Bartosz Golaszewski Reviewed-by: Bjorn