linux/drivers/isdn
Dan Carpenter f9f80fa975 isdnloop: several buffer overflows
[ Upstream commit 7563487cbf ]

There are three buffer overflows addressed in this patch.

1) In isdnloop_fake_err() we add an 'E' to a 60 character string and
then copy it into a 60 character buffer.  I have made the destination
buffer 64 characters and I'm changed the sprintf() to a snprintf().

2) In isdnloop_parse_cmd(), p points to a 6 characters into a 60
character buffer so we have 54 characters.  The ->eazlist[] is 11
characters long.  I have modified the code to return if the source
buffer is too long.

3) In isdnloop_command() the cbuf[] array was 60 characters long but the
max length of the string then can be up to 79 characters.  I made the
cbuf array 80 characters long and changed the sprintf() to snprintf().
I also removed the temporary "dial" buffer and changed it to use "p"
directly.

Unfortunately, we pass the "cbuf" string from isdnloop_command() to
isdnloop_writecmd() which truncates anything over 60 characters to make
it fit in card->omsg[].  (It can accept values up to 255 characters so
long as there is a '\n' character every 60 characters).  For now I have
just fixed the memory corruption bug and left the other problems in this
driver alone.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14 06:50:04 -07:00
..
act2000 isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
capi isdn/capi: Make Middleware depend on CAPI2.0 2014-03-18 15:02:57 -04:00
divert ISDN:divert: beautify code: useless 'break', 'return (0)', additional comments. 2013-04-02 14:31:24 -04:00
gigaset Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-01 17:51:54 -07:00
hardware isdn: remove deprecated IRQF_DISABLED 2013-10-17 15:13:20 -04:00
hisax isdn/hisax: hex vs decimal typo in prfeatureind() 2014-02-06 21:18:06 -08:00
hysdn procfs: new helper - PDE_DATA(inode) 2013-04-09 14:13:32 -04:00
i4l isdn: slight optimization of addr compare 2013-12-26 13:31:34 -05:00
icn isdn: icn: NULL dereference printing error message 2013-11-07 19:11:13 -05:00
isdnloop isdnloop: several buffer overflows 2014-04-14 06:50:04 -07:00
mISDN Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
pcbit isdn: Fix typo in drivers/isdn 2012-11-09 17:10:16 -05:00
sc isdn: use strlcpy() instead strcpy() 2013-12-18 17:53:59 -05:00
Kconfig tty: Added a CONFIG_TTY option to allow removal of TTY 2013-01-18 16:15:27 -08:00
Makefile mISDN fix main ISDN Makefile 2008-08-02 16:28:20 +02:00