13 Jul, 2017

4 commits

  • Add a few initial respective tests for an array:

    o Echoing values separated by spaces works
    o Echoing only first elements will set first elements
    o Confirm PAGE_SIZE limit still applies even if an array is used

    Link: http://lkml.kernel.org/r/20170630224431.17374-7-mcgrof@kernel.org
    Signed-off-by: Luis R. Rodriguez
    Cc: Kees Cook
    Cc: "Eric W. Biederman"
    Cc: Shuah Khan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Luis R. Rodriguez
     
  • Test against a simple proc_douintvec() case. While at it, add a test
    against UINT_MAX. Make sure UINT_MAX works, and UINT_MAX+1 will fail
    and that negative values are not accepted.

    Link: http://lkml.kernel.org/r/20170630224431.17374-6-mcgrof@kernel.org
    Signed-off-by: Luis R. Rodriguez
    Cc: Kees Cook
    Cc: "Eric W. Biederman"
    Cc: Shuah Khan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Luis R. Rodriguez
     
  • Test against a simple proc_dointvec() case. While at it, add a test
    against INT_MAX. Make sure INT_MAX works, and INT_MAX+1 will fail.
    Also test negative values work.

    Link: http://lkml.kernel.org/r/20170630224431.17374-5-mcgrof@kernel.org
    Signed-off-by: Luis R. Rodriguez
    Cc: Kees Cook
    Cc: "Eric W. Biederman"
    Cc: Shuah Khan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Luis R. Rodriguez
     
  • The existing tools/testing/selftests/sysctl/ tests include two test
    cases, but these use existing production kernel sysctl interfaces. We
    want to expand test coverage but we can't just be looking for random
    safe production values to poke at, that's just insane!

    Instead just dedicate a test driver for debugging purposes and port the
    existing scripts to use it. This will make it easier for further tests
    to be added.

    Subsequent patches will extend our test coverage for sysctl.

    The stress test driver uses a new license (GPL on Linux, copyleft-next
    outside of Linux). Linus was fine with this [0] and later due to Ted's
    and Alans's request ironed out an "or" language clause to use [1] which
    is already present upstream.

    [0] https://lkml.kernel.org/r/CA+55aFyhxcvD+q7tp+-yrSFDKfR0mOHgyEAe=f_94aKLsOu0Og@mail.gmail.com
    [1] https://lkml.kernel.org/r/1495234558.7848.122.camel@linux.intel.com

    Link: http://lkml.kernel.org/r/20170630224431.17374-2-mcgrof@kernel.org
    Signed-off-by: Luis R. Rodriguez
    Acked-by: Kees Cook
    Cc: "Eric W. Biederman"
    Cc: Shuah Khan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Luis R. Rodriguez