lkml.org 
[lkml]   [2015]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] x86, mpx: Ensure unused arguments of prctl() MPX requests are 0
Date
"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> writes:

> From: Michael Kerrisk <mtk.manpages@gmail.com>
>
> commit fe8c7f5cbf91124987106faa3bdf0c8b955c4cf7 added two new prctl()
> operations, PR_MPX_ENABLE_MANAGEMENT and PR_MPX_DISABLE_MANAGEMENT.
> However, no checks were included to ensure that unused arguments
> are zero, as is done in many existing prctl()s and as should be
> done for all new prctl()s. This patch adds the required checks.

This will break the existing gcc run time, which doesn't zero these
arguments.

-ANdi

>
> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
> ---
> kernel/sys.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/sys.c b/kernel/sys.c
> index a8c9f5a..ea9c881 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -2210,9 +2210,13 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
> up_write(&me->mm->mmap_sem);
> break;
> case PR_MPX_ENABLE_MANAGEMENT:
> + if (arg2 || arg3 || arg4 || arg5)
> + return -EINVAL;
> error = MPX_ENABLE_MANAGEMENT(me);
> break;
> case PR_MPX_DISABLE_MANAGEMENT:
> + if (arg2 || arg3 || arg4 || arg5)
> + return -EINVAL;
> error = MPX_DISABLE_MANAGEMENT(me);
> break;
> default:
> --
> 1.9.3

--
ak@linux.intel.com -- Speaking for myself only


\
 
 \ /
  Last update: 2015-01-09 18:41    [W:0.070 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site