[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111123145020.GA3258@mwanda>
Date: Wed, 23 Nov 2011 17:50:20 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Xi Wang <xi.wang@...il.com>
Cc: linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
Mori Hess <fmhess@...rs.sourceforge.net>, security@...nel.org,
Lucas De Marchi <lucas.demarchi@...fusion.mobi>,
Greg Kroah-Hartman <gregkh@...e.de>,
Ian Abbott <abbotti@....co.uk>,
Franky Lin <frankyl@...adcom.com>,
Greg Dietsche <Gregory.Dietsche@....edu>,
Mark Pearson <markpearson_de@...oo.de>
Subject: Re: [PATCH] comedi: integer overflow in do_insnlist_ioctl()
On Wed, Nov 23, 2011 at 08:59:52AM -0500, Xi Wang wrote:
> Thanks for the pointer. However you cannot do the overflow check using
>
> if (sizeof(struct comedi_insn) * insnlist.n_insns < insnlist.n_insns)
>
> Let's assume 32-bit system, sizeof(struct comedi_insn) = 32, and
> insnlist.n_insns = 0x7fffffff.
>
> Note that 32 * 0x7fffffff = 0xffffffe0 overflows but bypasses your check.
>
Argh... You're right, my check is wrong. What I like about my patch
though is that it doesn't introduce an arbitrary limit. Could you
redo your check without the MAX_INSNS?
regards,
dan carpenter
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists