lkml.org 
[lkml]   [2019]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/6] bitmap_parselist: rework input string parser
From
Date


On 3/26/2019 2:09 PM, Yuri Norov wrote:
> + Mike Travis <travis@sgi.com>
> + Thomas Gleixner <tglx@linutronix.de>
>
> ----------------------------------------------------------------------
> On Tue, Mar 26, 2019 at 12:07:45AM +0300, Yury Norov wrote:
>>> The requirement for this rework is to keep the __bitmap_parselist()
>>> copy-less and single-pass but make it more readable and maintainable by
>>> splitting into logical parts and removing explicit nested cycles and
>>> opaque local variables.
>>>
>>> __bitmap_parselist() can parse userspace inputs and therefore we cannot
>>> use simple_strtoul() to parse numbers.
>
>> So, all above depends to what memory we access kernel / user space.
>> Perhaps we can get copy of memory of a given size and then parse it in kernel space always?
>
>> --
>> With Best Regards,
>> Andy Shevchenko
>
> What I missed during rework is that we have only one caller of *parselist_user  -
> it's write_irq_affinity() introduced by Mike Travis in kernel/irq/proc.c. It doesn't look
> like a hot path as it's file operations handler. If no objections from Mike or Thomas,

No objections from me as long as you can still change irq affinity using
a cpulist instead of a cpumask.

Thanks,
Mike Travis


> I think it would make sense to copy_from_user() the userspace data at the beginning
> in sake of simplicity of __bitmap_parselist(), as you suggested above.
>
> Yury
>

\
 
 \ /
  Last update: 2019-03-26 23:00    [W:0.073 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site