Re: [PATCH v3 1/2] sc16is7xx: Prevent TX buffer overrun, prevent crash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 5 Nov 2015 09:40:10 +0100, Florian Achleitner wrote:
> On Wednesday, November 04, 2015 10:41:41 PM Jakub Kicinski wrote:
> > > [....]
> > 
> > Doesn't the second patch make this one unnecessary?
> 
> In my actual scenario, this is true. But without this bounds check, a 
> peripherial device can cause a buffer overflow and crash the kernel, by just 
> reporting some value.
> 
> I would argue that this must not be possible, and thus we need this check.

If read the code correctly you cap the txlen at FIFO_SIZE and to_send
is min of txlen and number of bytes to send therefore to_send cannot be
larger than FIFO_SIZE.

Also there is not buffer overflow possible on the TX side, did you mean
to insert this check on the RX side, maybe?
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux