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: <CAHp75VcxYPCLYq1J8qqjPdgDdQnWDgZKkavmyEWD8GNxcW2mWg@mail.gmail.com>
Date:   Sat, 16 Jun 2018 21:45:37 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Yury Norov <ynorov@...iumnetworks.com>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        agk@...hat.com, Mike Snitzer <snitzer@...hat.com>,
        dm-devel@...hat.com, shli@...nel.org, linux-raid@...r.kernel.org,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        linux-input <linux-input@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>
Subject: Re: [PATCH v2 5/5] Input: evdev - Switch to bitmap_zalloc()

On Sat, Jun 16, 2018 at 12:46 AM Yury Norov <ynorov@...iumnetworks.com> wrote:
> On Fri, Jun 15, 2018 at 04:20:17PM +0300, Andy Shevchenko wrote:
> > Switch to bitmap_zalloc() to show clearly what we are allocating.
> > Besides that it returns pointer of bitmap type instead of opaque void *.


> > +       mem = bitmap_alloc(maxbit, GFP_KERNEL);
> >         if (!mem)
> >                 return -ENOMEM;
>
> But in commit message you say you switch to bitmap_zalloc(). IIUC
> bitmap_alloc() is OK here. But could you please update comment to
> avoid confusing.

There are two places, one with alloc, another with zalloc.
I will clarify this in commit message of next version.

> > +       mask = bitmap_zalloc(cnt, GFP_KERNEL);
> >         if (!mask)
> >                 return -ENOMEM;
> >
> >         error = bits_from_user(mask, cnt - 1, codes_size, codes, compat);
>
> If my understanding of bits_from_user() correct, here you can also use
> bitmap_alloc(), true?

While it might be true, it's a material for separate change.
Original code uses zalloc version.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ