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>] [day] [month] [year] [list]
Message-ID: <CALAqxLWKGEhzqXir8KoeS5EBcbokAY5+=mHrqy0-G9aGraqXXA@mail.gmail.com>
Date:   Tue, 1 Oct 2019 13:50:45 -0700
From:   John Stultz <john.stultz@...aro.org>
To:     Hillf Danton <hdanton@...a.com>
Cc:     lkml <linux-kernel@...r.kernel.org>,
        Laura Abbott <labbott@...hat.com>,
        Benjamin Gaignard <benjamin.gaignard@...aro.org>,
        Sumit Semwal <sumit.semwal@...aro.org>,
        Liam Mark <lmark@...eaurora.org>,
        Pratik Patel <pratikp@...eaurora.org>,
        Brian Starkey <Brian.Starkey@....com>,
        Vincent Donnefort <Vincent.Donnefort@....com>,
        Sudipto Paul <Sudipto.Paul@....com>,
        "Andrew F . Davis" <afd@...com>,
        Christoph Hellwig <hch@...radead.org>,
        Chenbo Feng <fengc@...gle.com>,
        Alistair Strachan <astrachan@...gle.com>,
        Hridya Valsaraju <hridya@...gle.com>,
        dri-devel <dri-devel@...ts.freedesktop.org>
Subject: Re: [RESEND][PATCH v8 3/5] dma-buf: heaps: Add system heap to dmabuf heaps

On Mon, Sep 30, 2019 at 12:43 AM Hillf Danton <hdanton@...a.com> wrote:
>
>
> On Fri,  6 Sep 2019 18:47:09 +0000 John Stultz wrote:
> >
> > +static int system_heap_allocate(struct dma_heap *heap,
> > +                             unsigned long len,
> > +                             unsigned long fd_flags,
> > +                             unsigned long heap_flags)
> > +{
> > +     struct heap_helper_buffer *helper_buffer;
> > +     struct dma_buf *dmabuf;
> > +     int ret = -ENOMEM;
> > +     pgoff_t pg;
> > +
> > +     helper_buffer = kzalloc(sizeof(*helper_buffer), GFP_KERNEL);
> > +     if (!helper_buffer)
> > +             return -ENOMEM;
> > +
> > +     init_heap_helper_buffer(helper_buffer, system_heap_free);
> > +     helper_buffer->flags = heap_flags;
> > +     helper_buffer->heap = heap;
> > +     helper_buffer->size = len;
> > +
> A couple of lines looks needed to handle len if it is not
> PAGE_SIZE aligned.

Hey! Thanks so much for the review!

dma_heap_buffer_alloc() sets "len = PAGE_ALIGN(len);" before calling
into the heap allocation hook.
So hopefully this isn't a concern, or am I missing something?

thanks
-john

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ