lkml.org 
[lkml]   [2018]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6 3/8] sysctl: Warn when a clamped sysctl parameter is set out of range
I like this series overall, thanks! No objections from me. One thing I
noted, though:

On Fri, Apr 27, 2018 at 2:00 PM, Waiman Long <longman@redhat.com> wrote:
> if (param->min && *param->min > val) {
> if (clamp) {
> val = *param->min;
> + clamped = true;
> } else {
> return -EINVAL;
> }

This appears as a common bit of logic in many places in the series. It
seems like it'd make sense to make this a helper of some kind?

-Kees

--
Kees Cook
Pixel Security

\
 
 \ /
  Last update: 2018-05-01 00:41    [W:0.089 / U:3.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site