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