[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jL4V9sL7Ai1SVTNkg8OE70c6kLJBdqNtj9Z06MOb4zG0g@mail.gmail.com>
Date: Wed, 20 Jun 2018 16:43:14 -0700
From: Kees Cook <keescook@...omium.org>
To: Darren Hart <dvhart@...radead.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Andy Shevchenko <andy@...radead.org>,
Platform Driver <platform-driver-x86@...r.kernel.org>,
Mihai Donțu <mihai.dontu@...il.com>,
Mario.Limonciello@...l.com
Subject: Re: [PATCH] platform/x86: wmi: Do not mix pages and kmalloc
On Wed, Jun 20, 2018 at 4:37 PM, Darren Hart <dvhart@...radead.org> wrote:
> On Wed, Jun 20, 2018 at 02:31:41PM -0700, Kees Cook wrote:
>> The probe handler_data was being allocated with __get_free_pages()
>> for no reason I could find. The error path was using kfree(). Since
>
> v4 of Mario's series used kmalloc:
> https://patchwork.kernel.org/patch/9985827/
>
> This was changed in v10 to use __get_free_pages:
> https://patchwork.kernel.org/patch/10018023/
>
> But... I'm not finding the discussion that led to this change.... Mario,
> do you recall? Something about contiguous memory? We had a similar
> discussion on an earlier series:
>
> https://patchwork.kernel.org/patch/9975277/
FWIW, kmalloc gets you contiguous memory...
But if the reason is found and needs to stay, the probe error path's
kfree() needs to be fixed, and __GFP_COMP needs to be added to the
free page flags.
-Kees
--
Kees Cook
Pixel Security
Powered by blists - more mailing lists