mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Liu, Chuansheng" <chuansheng.liu@intel.com>
To: "Bi, Chao" <chao.bi@intel.com>,
	"alan@linux.intel.com" <alan@linux.intel.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"pavan_savoy@ti.com" <pavan_savoy@ti.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] ST_CORE: Error triggered by convert "char" to "int"
Date: Thu, 10 Jan 2013 08:45:05 +0000	[thread overview]
Message-ID: <27240C0AC20F114CBF8149A2696CBE4A2005F1@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1357806449.8296.32.camel@bichao>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1367 bytes --]



> -----Original Message-----
> From: Bi, Chao
> Sent: Thursday, January 10, 2013 4:27 PM
> To: alan@linux.intel.com; gregkh@linuxfoundation.org;
> akpm@linux-foundation.org; pavan_savoy@ti.com
> Cc: Liu, Chuansheng; linux-kernel@vger.kernel.org
> Subject: [PATCH] ST_CORE: Error triggered by convert "char" to "int"
> 
> 
> When st driver decodes protocol index received from raw data,
> it does a value convert from "char" to "int". Because it's sign
> extension from bit8 to bit32, the "int" value maybe minus, in
> another word, the protocol index might be minus, but driver doesn't
> filter such case and may continue access memory pointed by this
> minus index.
> 
> This patch is to change the variable type of index from "int"
> to "unsigned char", so that it avoids do such kind of type
> conversion.
> 
Some infos:
when the type is minus, it will cause panic, because the below code
just consider type >= ST_MAX_CHANNELS case, no type < 0 case,
but it really happened.
			if ((type >= ST_MAX_CHANNELS) ||
					(st_gdata->list[type] == NULL)) {

Changing type from int to unsigned char can get benefit from the above
code.
If possible:
Acked-by: liu chuansheng <chuansheng.liu@intel.com>

Thanks.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

      reply	other threads:[~2013-01-10  8:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10  8:27 channing
2013-01-10  8:45 ` Liu, Chuansheng [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=27240C0AC20F114CBF8149A2696CBE4A2005F1@SHSMSX101.ccr.corp.intel.com \
    --to=chuansheng.liu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@linux.intel.com \
    --cc=chao.bi@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavan_savoy@ti.com \
    /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

all inboxes | Powered by JetHome®