Re: [PATCH] kmod: Check for NULL at call_usermodehelper_exec().

From: Tetsuo Handa
Date: Sun Sep 15 2013 - 13:02:45 EST


Oleg Nesterov wrote:
> It looks a bit ugly to check ->path under helper_lock(), just add
>
> if (!sub_info->path)
> retval = -ENOENT;
>
> at the start. Otherwise the code looks as if there is a subtle
> reason to take the lock before this check.

Did you mean this?

DECLARE_COMPLETION_ONSTACK(done);
int retval = 0;

+ if (!sub_info->path) {
+ call_usermodehelper_freeinfo(sub_info);
+ return -ENOENT;
+ }
helper_lock();
if (!khelper_wq || usermodehelper_disabled) {
retval = -EBUSY;
goto out;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/