Re: Re: [PATCH] proc/sysctl: fix return error for proc_doulongvec_minmax

From: Kees Cook
Date: Wed Dec 05 2018 - 18:31:06 EST


On Mon, Dec 3, 2018 at 12:14 PM Luis Chamberlain <mcgrof@xxxxxxxxxx> wrote:
> Since this worked before I do agree that we need to keep it working now,
> and I can't think of an issue with returning 0 now. Since this is about
> semantics though I'd like a bit more review from at last one more
> person.
>
> Kees, Eric, Andrew?

This is a weird one: it would return an error _AND_ still perform the
write. :( I think this patch is right, and I struggle to imagine a
case where removing the failure is a problem.

A quick question, though, do we want to instead do the reverse? (Not
update, and keep the error?) Are there any examples of doing partial
writes like this in real software?

The proposed change is the safest change, though...

--
Kees Cook