diff options
author | Karsten Keil <kkeil@suse.de> | 2007-02-28 23:13:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-01 17:53:39 -0500 |
commit | 17f0cd2f350b90b28301e27fe0e39f34bfe7e730 (patch) | |
tree | 6baba85d4f3b83398dc5a412b328bfcef1633548 /include/linux | |
parent | 34bbd704051c9d053d69e90569a3a2365f4c7b50 (diff) |
[PATCH] Fix buffer overflow and races in capi debug functions
The CAPI trace debug functions were using a fixed size buffer, which can be
overflowed if wrong formatted CAPI messages were sent to the kernel capi
layer. The code was also not protected against multiple callers. This fix
bug 8028.
Additionally the patch make the CAPI trace functions optional.
Signed-off-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/isdn/capiutil.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/isdn/capiutil.h b/include/linux/isdn/capiutil.h index 2e79f816703b..63bd9cf821a7 100644 --- a/include/linux/isdn/capiutil.h +++ b/include/linux/isdn/capiutil.h | |||
@@ -174,9 +174,26 @@ char *capi_info2str(__u16 reason); | |||
174 | /* | 174 | /* |
175 | * Debugging / Tracing functions | 175 | * Debugging / Tracing functions |
176 | */ | 176 | */ |
177 | |||
177 | char *capi_cmd2str(__u8 cmd, __u8 subcmd); | 178 | char *capi_cmd2str(__u8 cmd, __u8 subcmd); |
178 | char *capi_cmsg2str(_cmsg * cmsg); | 179 | |
179 | char *capi_message2str(__u8 * msg); | 180 | typedef struct { |
181 | u_char *buf; | ||
182 | u_char *p; | ||
183 | size_t size; | ||
184 | size_t pos; | ||
185 | } _cdebbuf; | ||
186 | |||
187 | #define CDEBUG_SIZE 1024 | ||
188 | #define CDEBUG_GSIZE 4096 | ||
189 | |||
190 | _cdebbuf *cdebbuf_alloc(void); | ||
191 | void cdebbuf_free(_cdebbuf *cdb); | ||
192 | int cdebug_init(void); | ||
193 | void cdebug_exit(void); | ||
194 | |||
195 | _cdebbuf *capi_cmsg2str(_cmsg *cmsg); | ||
196 | _cdebbuf *capi_message2str(__u8 *msg); | ||
180 | 197 | ||
181 | /*-----------------------------------------------------------------------*/ | 198 | /*-----------------------------------------------------------------------*/ |
182 | 199 | ||