mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Jan Beulich <JBeulich@suse.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	jbeulich@suse.com, JBeulich@suse.com, alex.shi@intel.com,
	tglx@linutronix.de
Subject: [tip:x86/mm] x86/mm: Fix range check in tlbflush debugfs interface
Date: Fri, 7 Sep 2012 02:04:41 -0700	[thread overview]
Message-ID: <tip-d4c9dbc61fe0ca042b835c6f234af12fa5f18310@git.kernel.org> (raw)
In-Reply-To: <5049B65C020000780009990C@nat28.tlf.novell.com>

Commit-ID:  d4c9dbc61fe0ca042b835c6f234af12fa5f18310
Gitweb:     http://git.kernel.org/tip/d4c9dbc61fe0ca042b835c6f234af12fa5f18310
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Fri, 7 Sep 2012 07:54:52 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 7 Sep 2012 10:56:02 +0200

x86/mm: Fix range check in tlbflush debugfs interface

Since the shift count settable there is used for shifting values
of type "unsigned long", its value must not match or exceed
BITS_PER_LONG (otherwise the shift operations are undefined).

Similarly, the value must not be negative (but -1 must be
permitted, as that's the value used to distinguish the case of
the fine grained flushing being disabled).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Alex Shi <alex.shi@intel.com>
Link: http://lkml.kernel.org/r/5049B65C020000780009990C@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/mm/tlb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 613cd83..a085c56 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -320,7 +320,7 @@ static ssize_t tlbflush_write_file(struct file *file,
 	if (kstrtos8(buf, 0, &shift))
 		return -EINVAL;
 
-	if (shift > 64)
+	if (shift < -1 || shift >= BITS_PER_LONG)
 		return -EINVAL;
 
 	tlb_flushall_shift = shift;

      reply	other threads:[~2012-09-07  9:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07  6:54 [PATCH] x86: fix " Jan Beulich
2012-09-07  9:04 ` tip-bot for Jan Beulich [this message]

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=tip-d4c9dbc61fe0ca042b835c6f234af12fa5f18310@git.kernel.org \
    --to=jbeulich@suse.com \
    --cc=alex.shi@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome