linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Utkin <andrey.krieger.utkin@gmail.com>
To: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	kgdb-bugreport@lists.sourceforge.net
Cc: dcb314@hotmail.com, jason.wessel@windriver.com, wharms@bfs.de,
	Andrey Utkin <andrey.krieger.utkin@gmail.com>
Subject: [PATCH] kernel/debug/kdb/kdb_bp.c: fix argument range check
Date: Fri, 18 Jul 2014 20:40:24 +0300	[thread overview]
Message-ID: <1405705224-32171-1-git-send-email-andrey.krieger.utkin@gmail.com> (raw)

Dropped negativity check; enhanced upper limit check as proposed by
Walter Harms <wharms@bfs.de>

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80591
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
---
 kernel/debug/kdb/kdb_bp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/debug/kdb/kdb_bp.c b/kernel/debug/kdb/kdb_bp.c
index 70a5046..371150f 100644
--- a/kernel/debug/kdb/kdb_bp.c
+++ b/kernel/debug/kdb/kdb_bp.c
@@ -39,7 +39,7 @@ static char *kdb_rwtypes[] = {
 
 static char *kdb_bptype(kdb_bp_t *bp)
 {
-	if (bp->bp_type < 0 || bp->bp_type > 4)
+	if (bp->bp_type >= ARRAY_SIZE(kdb_rwtypes))
 		return "";
 
 	return kdb_rwtypes[bp->bp_type];
-- 
1.8.5.5


             reply	other threads:[~2014-07-18 17:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18 17:40 Andrey Utkin [this message]
2014-07-22  7:53 ` [PATCH] kernel/debug/kdb/kdb_bp.c: fix argument range check Dan Carpenter

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=1405705224-32171-1-git-send-email-andrey.krieger.utkin@gmail.com \
    --to=andrey.krieger.utkin@gmail.com \
    --cc=dcb314@hotmail.com \
    --cc=jason.wessel@windriver.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wharms@bfs.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;
as well as URLs for NNTP newsgroup(s).