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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ed4a98e3d8c0efe58d888cf8fc6e913b40281f11.camel@alliedtelesis.co.nz>
Date:   Tue, 22 Oct 2019 20:05:38 +0000
From:   Chris Packham <Chris.Packham@...iedtelesis.co.nz>
To:     "corbet@....net" <corbet@....net>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "willy@...radead.org" <willy@...radead.org>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH] docs/core-api: memory-allocation: mention size helpers

Hi Jon,

On Tue, 2019-10-22 at 07:19 -0600, Jonathan Corbet wrote:
> On Tue, 22 Oct 2019 10:27:47 +1300
> Chris Packham <chris.packham@...iedtelesis.co.nz> wrote:
> 
> > Mention struct_size(), array_size() and array3_size() in the same place
> > as kmalloc() and friends.
> > 
> > Signed-off-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
> > ---
> >  Documentation/core-api/memory-allocation.rst | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/core-api/memory-allocation.rst b/Documentation/core-api/memory-allocation.rst
> > index e59779aa7615..6a131767becd 100644
> > --- a/Documentation/core-api/memory-allocation.rst
> > +++ b/Documentation/core-api/memory-allocation.rst
> > @@ -91,7 +91,9 @@ The most straightforward way to allocate memory is to use a function
> >  from the :c:func:`kmalloc` family. And, to be on the safe side it's
> >  best to use routines that set memory to zero, like
> >  :c:func:`kzalloc`. If you need to allocate memory for an array, there
> > -are :c:func:`kmalloc_array` and :c:func:`kcalloc` helpers.
> > +are :c:func:`kmalloc_array` and :c:func:`kcalloc` helpers. The helpers
> > +:c:func:`struct_size`, :c:func:`array_size` and :c:func:`array3_size` can be
> > +used to safely calculate object sizes without overflowing.
> 
> Quick comment: we don't need :c:func: anymore; the markup happens anyway.
> So rather than adding more of them, could I ask you to please take out the
> ones that are there now?

So just with backquotes i.e. :c:func:`kmalloc` becomes `kmalloc`?

> 
> Thanks,
> 
> jon

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ