Re: [PATCH] psi: Fix OOB write when writing 0 bytes to psi files
From: Johannes Weiner
Date: Tue Feb 04 2020 - 13:55:37 EST
On Mon, Feb 03, 2020 at 01:22:16PM -0800, Suren Baghdasaryan wrote:
> Issuing write() with count parameter set to 0 on any file under
> /proc/pressure/ will cause an OOB write because of the access to
> buf[buf_size-1] when NUL-termination is performed. Fix this by checking
> for buf_size to be non-zero.
>
> Signed-off-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>
Thanks Suren.