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-prev] [day] [month] [year] [list]
Message-ID: <CAHX4x85RUfLG8caUY0fvN11qSNWiuzDjud_3Do8mUwM69M1OCg@mail.gmail.com>
Date:   Mon, 1 Apr 2019 15:12:23 -0600
From:   Nick Crews <ncrews@...omium.org>
To:     Joe Perches <joe@...ches.com>
Cc:     Jonathan Corbet <corbet@....net>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-doc <linux-doc@...r.kernel.org>
Subject: Re: [PATCH] coding-style.rst: Generic alloc functions do not need OOM logging

Thanks Joe, this is a great detail to add.

On Sat, Mar 30, 2019 at 11:25 AM Joe Perches <joe@...ches.com> wrote:
>
> Generic allocation functions already emit a dump_stack()
> so additional error logging isn't useful.
>
> Document it as such and add a reference to the allocation
> API.
>
> Signed-off-by: Joe Perches <joe@...ches.com>
> ---
>  Documentation/process/coding-style.rst | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
> index 8ea913e99fa1..fa864a51e6ea 100644
> --- a/Documentation/process/coding-style.rst
> +++ b/Documentation/process/coding-style.rst
> @@ -843,7 +843,8 @@ used.
>  The kernel provides the following general purpose memory allocators:
>  kmalloc(), kzalloc(), kmalloc_array(), kcalloc(), vmalloc(), and
>  vzalloc().  Please refer to the API documentation for further information
> -about them.
> +about them.  :ref:`Documentation/core-api/memory-allocation.rst
> +<memory_allocation>`
>
>  The preferred form for passing a size of a struct is the following:
>
> @@ -874,6 +875,9 @@ The preferred form for allocating a zeroed array is the following:
>  Both forms check for overflow on the allocation size n * sizeof(...),
>  and return NULL if that occurred.
>
> +These generic allocation functions all emit a stack dump on failure when used
> +without __GFP_NOWARN so there is no use in emitting an additional failure
> +message when NULL is returned.
>
>  15) The inline disease
>  ----------------------
>

Acked-by: Nick Crews <ncrews@...omium.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ