We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cce47b7 commit 2453548Copy full SHA for 2453548
1 file changed
kernel/fork.c
@@ -2707,11 +2707,11 @@ __latent_entropy struct task_struct *copy_process(
2707
hlist_del_init(&delayed.node);
2708
spin_unlock_irq(¤t->sighand->siglock);
2709
/*
2710
- * The error path returns ERR_PTR(retval), which requires a negative
2711
- * errno. Normalize unexpected values to avoid returning non-error
2712
- * pointers to callers.
+ * The error path returns ERR_PTR(retval), which requires retval to be a
+ * negative errno in the range [-MAX_ERRNO, -1]. Normalize unexpected
+ * values to avoid returning non-error pointers to callers.
2713
*/
2714
- if (unlikely(retval >= 0))
+ if (unlikely(retval >= 0 || retval < -MAX_ERRNO))
2715
retval = -EINVAL;
2716
return ERR_PTR(retval);
2717
}
0 commit comments