Re: [PATCH v2 9/9] test_sysctl: test against int proc_dointvec() array support

From: Luis R. Rodriguez
Date: Tue May 16 2017 - 18:40:46 EST


On Mon, Feb 13, 2017 at 02:07:53PM -0800, Kees Cook wrote:
> On Fri, Feb 10, 2017 at 4:36 PM, Luis R. Rodriguez <mcgrof@xxxxxxxxxx> wrote:
> > diff --git a/tools/testing/selftests/sysctl/sysctl.sh b/tools/testing/selftests/sysctl/sysctl.sh
> > index eedfba6f0a57..963d572155b1 100755
> > --- a/tools/testing/selftests/sysctl/sysctl.sh
> > +++ b/tools/testing/selftests/sysctl/sysctl.sh
> > @@ -137,6 +142,12 @@ verify()
> > return 0
> > }
> >
> > +verify_diff_w()
> > +{
> > + echo "$TEST_STR" | diff -w -u - $1 2>&1 > /dev/null
>
> Instead of shell redirection, just use -q ?

Will try.

> I love seeing these tests added. I have one other change I'd like to
> add to sysctl,

Upon a glance again at this stuff I can think of a few other checks
but one battle at a time...

> but I haven't had time to make sure it doesn't break
> stuff. I haven't been able to prove it to myself, but I think it's
> safe; I just need to update the tests to handle it:
>
> http://git.kernel.org/cgit/linux/kernel/git/kees/linux.git/commit/?h=sysctl/writes_strict&id=b63a38ca45bd9fb61545ce6ce66093147eb96a7c
>
> It'd need an update for the uint handler...

That would also expands on the definition of the strict mode. I think this is
fair if we take it for granted strict will always aim for correctness, but we
also have to be fair and be clear on possible impact and ensure nothing will
bust. I have a feeling though that we'd keep on going with these semantics on
and on and on... which really is just irritating and it tells me something more
wrong about this crap interface.

Just a rant here...

Luis