From: Dave Hansen <dave@sr71.net>
To: linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, x86@kernel.org, luto@amacapital.net,
Dave Hansen <dave@sr71.net>,
mtk.manpages@gmail.com, dave.hansen@linux.intel.com
Subject: [PATCH 3/3] x86 mpx: strictly enforce empty prctl() args
Date: Thu, 08 Jan 2015 14:30:22 -0800 [thread overview]
Message-ID: <20150108223022.7F56FD13@viggo.jf.intel.com> (raw)
In-Reply-To: <20150108223018.A57DEE63@viggo.jf.intel.com>
From: Dave Hansen <dave.hansen@linux.intel.com>
Description from Michael Kerrisk. He suggested an identical patch
to one I had already coded up and tested.
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.
Suggested-by: Andy Lutomirski <luto@amacapital.net>
Suggested-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---
b/kernel/sys.c | 4 ++++
1 file changed, 4 insertions(+)
diff -puN kernel/sys.c~x86-mpx-strictly-enforce-empty-prctl-args kernel/sys.c
--- a/kernel/sys.c~x86-mpx-strictly-enforce-empty-prctl-args 2015-01-08 12:48:09.868898228 -0800
+++ b/kernel/sys.c 2015-01-08 12:48:09.872898408 -0800
@@ -2210,9 +2210,13 @@ SYSCALL_DEFINE5(prctl, int, option, unsi
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:
_
next prev parent reply other threads:[~2015-01-08 22:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 22:30 [PATCH 0/3] x86, mpx: Fixes for 3.19 Dave Hansen
2015-01-08 22:30 ` [PATCH 1/3] x86, mpx: explicitly disable 32-bit MPX support on 64-bit kernels Dave Hansen
2015-01-22 20:12 ` [tip:x86/urgent] x86, mpx: Explicitly " tip-bot for Dave Hansen
2015-01-08 22:30 ` [PATCH 2/3] x86 mpx: fix potential performance issue on unmaps Dave Hansen
2015-01-22 20:13 ` [tip:x86/urgent] x86, mpx: Fix " tip-bot for Dave Hansen
2015-01-08 22:30 ` Dave Hansen [this message]
2015-01-22 20:13 ` [tip:x86/urgent] x86, mpx: Strictly enforce empty prctl() args tip-bot for Dave Hansen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150108223022.7F56FD13@viggo.jf.intel.com \
--to=dave@sr71.net \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mtk.manpages@gmail.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox