netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] irda: small read beyond end of array in debug code
@ 2013-02-27  5:15 Dan Carpenter
  2013-02-27 18:12 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-02-27  5:15 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: David S. Miller, netdev, kernel-janitors

charset comes from skb->data.  It's a number in the 0-255 range.
If we have debugging turned on then this could cause a read beyond
the end of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index e71e85b..29340a9 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -495,8 +495,11 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
 /*		case CS_ISO_8859_9: */
 /*		case CS_UNICODE: */
 		default:
-			IRDA_DEBUG(0, "%s(), charset %s, not supported\n",
-				   __func__, ias_charset_types[charset]);
+			IRDA_DEBUG(0, "%s(), charset [%d] %s, not supported\n",
+				   __func__, charset,
+				   charset < ARRAY_SIZE(ias_charset_types) ?
+					ias_charset_types[charset] :
+					"(unknown)");
 
 			/* Aborting, close connection! */
 			iriap_disconnect_request(self);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] irda: small read beyond end of array in debug code
  2013-02-27  5:15 [patch] irda: small read beyond end of array in debug code Dan Carpenter
@ 2013-02-27 18:12 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-02-27 18:12 UTC (permalink / raw)
  To: dan.carpenter; +Cc: samuel, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 27 Feb 2013 08:15:02 +0300

> charset comes from skb->data.  It's a number in the 0-255 range.
> If we have debugging turned on then this could cause a read beyond
> the end of the array.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-27 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-27  5:15 [patch] irda: small read beyond end of array in debug code Dan Carpenter
2013-02-27 18:12 ` David Miller

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).