public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Chou <acc@CS.Stanford.EDU>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: acc@cs.stanford.edu,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	mc@cs.stanford.edu
Subject: Re: [CHECKER] 24 more buffer overruns in 2.5.48
Date: Thu, 2 Jan 2003 19:06:26 -0800	[thread overview]
Message-ID: <20030103030626.GA2272@Xenon.stanford.edu> (raw)
In-Reply-To: <1041558816.24900.112.camel@irongate.swansea.linux.org.uk>

> > [BUG] Possibly the caller's fault.
> > /u1/acc/linux/2.5.48/drivers/ide/ide-lib.c:380:ide_get_best_pio_mode: ERROR:BUFFER:380:380:Array bounds error: ide_pio_timings[6] indexed with [255] [Callstack: /u1/acc/linux/2.5.48/drivers/ide/legacy/qd65xx.c:272:ide_get_best_pio_mode(_, _, 255, _)] 
> > 		pio_mode = max_mode;
> > 		cycle_time = 0;
> > 	}
> > 	if (d) {
> > 		d->pio_mode = pio_mode;
> > 
> > Error --->
> > 		d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time;
> > 		d->use_iordy = use_iordy;
> > 		d->overridden = overridden;
> > 		d->blacklisted = blacklisted;
> 
> I can't construct a scenario in which this can occur.

In ide/legacy/qd65xx.c:272 there's a call where max_mode is 255.  Right 
before the piece of code that the checker warns about is the segment:

	if (pio_mode > max_mode) {
		pio_mode = max_mode;
		cycle_time = 0;
	}

Now, it may be that pio_mode can never be >= 255 in this scenario.  But if 
it can be, then this sets pio_mode to 255.


> > [BUG] [GEM] The caller is probably at fault: look at the call chain.
> > /u1/acc/linux/2.5.48/drivers/video/fbgen.c:180:do_install_cmap: ERROR:BUFFER:180:180:Array bounds error: fb_display[63] indexed with [-1] [Callstack: /u1/acc/linux/2.5.48/drivers/video/aty128fb.c:1746:aty128fb_set_var(_, -1, _) -> /u1/acc/linux/2.5.48/drivers/video/aty128fb.c:1406:do_install_cmap(-1, _)] 
> > 
> > void do_install_cmap(int con, struct fb_info *info)
> > {
> >     if (con != info->currcon)
> > 	return;
> 
> currcon can never be -1. I don't think the compiler can ever deduce that
> detail though.

Then there's some odd code, such as in fbgen.c:gen_switch():

	if (info->currcon >= 0) {
		...
	}
	
	info->currcon = con;

-Andy

  reply	other threads:[~2003-01-03  2:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-03  0:37 [CHECKER] 24 more buffer overruns in 2.5.48 Andy Chou
2003-01-03  1:53 ` Alan Cox
2003-01-03  3:06   ` Andy Chou [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-01-03 11:34 Petr Vandrovec

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=20030103030626.GA2272@Xenon.stanford.edu \
    --to=acc@cs.stanford.edu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mc@cs.stanford.edu \
    /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