Re: [PATCH v2] proc: fix /proc/*/map_files lookup some more

From: Cyrill Gorcunov
Date: Sun Mar 04 2018 - 15:53:24 EST


On Sun, Mar 04, 2018 at 12:51:30AM +0300, Alexey Dobriyan wrote:
> I totally forgot that _parse_integer() accepts arbitrary amount of
> leading zeroes leading to the following lookups:
>
> OK
> # readlink /proc/1/map_files/56427ecba000-56427eddc000
> /lib/systemd/systemd
>
> bogus
> # readlink /proc/1/map_files/00000000000056427ecba000-56427eddc000
> /lib/systemd/systemd
> # readlink /proc/1/map_files/56427ecba000-00000000000056427eddc000
> /lib/systemd/systemd
>
> Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Reviewed-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>