I'll leave it to you.
But if you want to allow args->nlen == CTL_MAXNAME,
you also need to update do_sysctl().
int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
...
if (nlen <= 0 || nlen >= CTL_MAXNAME)
return -ENOTDIR;
...
}
Thanks.
-