]> git.baikalelectronics.ru Git - kernel.git/commit
caif: add a sanity check to the tty name
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 3 Sep 2013 09:02:32 +0000 (12:02 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Sep 2013 04:27:27 +0000 (00:27 -0400)
commit9797fe4dc96a86f6aed9cd5d7a6b85c614bd9f1b
tree09a1fd1803efce93d399bd741d5f63a2f809890b
parent4013432500bc9d343500294880463300c31d7944
caif: add a sanity check to the tty name

"tty->name" and "name" are a 64 character buffers.  My static checker
complains because we add the "cf" on the front so it look like we are
copying a 66 character string into a 64 character buffer.

Also if the name is larger than IFNAMSIZ (16) it triggers a BUG_ON()
inside the call to alloc_netdev().

This is all under CAP_SYS_ADMIN so it's not a security fix, it just adds
a little robustness.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/caif/caif_serial.c