Re: [PATCH v6 3/8] sysctl: Warn when a clamped sysctl parameter is set out of range
From: Waiman Long <longman@redhat.com>
Date: 2018-05-01 13:41:03
Also in:
linux-fsdevel, lkml
From: Waiman Long <longman@redhat.com>
Date: 2018-05-01 13:41:03
Also in:
linux-fsdevel, lkml
On 04/30/2018 06:40 PM, Kees Cook wrote:
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 [off-list ref] wrote:quoted
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
We can't have an inline helper function because the types are different. We may be able to use a helper macro, but helper macro like that may be not well accepted by the kernel community. Cheers, Longman -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html