Re: [PATCH v15 04/13] task_isolation: add initial support

From: Chris Metcalf
Date: Thu Feb 02 2017 - 13:12:44 EST


On 2/2/2017 11:13 AM, Eugene Syromiatnikov wrote:
case PR_GET_FP_MODE:
error = GET_FP_MODE(me);
break;
+#ifdef CONFIG_TASK_ISOLATION
+ case PR_SET_TASK_ISOLATION:
+ error = task_isolation_set(arg2);
+ break;
+ case PR_GET_TASK_ISOLATION:
+ error = me->task_isolation_flags;
+ break;
+#endif
default:
error = -EINVAL;
break;
It is not a very good idea to ignore the values of unused arguments; it
prevents future their usage, as user space can pass some garbage values
here. Check out the code for newer prctl handlers, like
PR_SET_NO_NEW_PRIVS, PR_SET_THP_DISABLE, or PR_MPX_ENABLE_MANAGEMENT
(PR_[SG]_FP_MODE is an unfortunate recent omission).

The other thing is the usage of #ifdef's, which is generally avoided
there. Also, the patch for man-pages, describing the new prctl calls, is
missing.

Thanks, I appreciate the feedback. I'll fold this into the next spin of the series!

--
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com