summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2014-10-11 07:46:29 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-14 15:05:33 -0400
commit097933ddcd28ef99c116651b20fd2e06717e0f0d (patch)
treedaba40194d81bd13eb0689e3668bae0988137a8d /drivers/isdn/gigaset
parentee7ff5fed25711a26da7826071e6ede8af049ad2 (diff)
isdn/gigaset: limit raw CAPI message dump length
In dump_rawmsg, the length field from a received data package was used unscrutinized, allowing an attacker to control the size of the allocated buffer and the number of times the output loop iterates. Fix by limiting to a reasonable value. Spotted with Coverity. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset')
-rw-r--r--drivers/isdn/gigaset/capi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c
index 044392cba262..47e2a913a6ef 100644
--- a/drivers/isdn/gigaset/capi.c
+++ b/drivers/isdn/gigaset/capi.c
@@ -250,6 +250,8 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,
250 l -= 12; 250 l -= 12;
251 if (l <= 0) 251 if (l <= 0)
252 return; 252 return;
253 if (l > 64)
254 l = 64; /* arbitrary limit */
253 dbgline = kmalloc(3 * l, GFP_ATOMIC); 255 dbgline = kmalloc(3 * l, GFP_ATOMIC);
254 if (!dbgline) 256 if (!dbgline)
255 return; 257 return;