Re: [Suggestion] drivers/tty: drivers/char/: forMAX_ASYNC_BUFFER_SIZE

From: Alan Cox
Date: Thu Nov 29 2012 - 08:36:21 EST


On Thu, 29 Nov 2012 13:07:28 +0800
Chen Gang <gang.chen@xxxxxxxxxxx> wrote:

> Hello Greg Kroah-Hartman:
>
> for MAX_ASYNC_BUFFER_SIZE:
> it is defined as 4096;
> but for the max buffer size which it processes, is 65535.
> so suggest to #define MAX_ASYNC_BUFFER_SIZE 0x10000 (better than 0xffff)

I don't see the need to change this. Possibly some of the old synclink
drivers need to check more carefully for overflows if configured for very
large frame sizes ?

>
> ---------------------------------------------------------------------------------
> Step 3:
>
> one sample in drivers/tty/n_gsm.c (same for another implementation)
>
> receive_buf is a function ptr which may be gsmld_receive_buf at line 2819.
> it does not check the length of count whether larger than MAX_ASYNC_BUFFER_SIZE.
> if count is larger than MAX_ASYNC_BUFFER_SIZE, will cause issue.

Why should it - MAX_ASYNC_BUFFER_SIZE is an internal detail of the
synclink drivers.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/