[asterisk-bugs] [Zaptel 0009364]: [patch] ZT_CHANDIAG: allocate in heap, and enable by default

noreply at bugs.digium.com noreply at bugs.digium.com
Sat Jun 7 12:49:28 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=9364 
====================================================================== 
Reported By:                tzafrir
Assigned To:                russell
====================================================================== 
Project:                    Zaptel
Issue ID:                   9364
Category:                   Core/General
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     closed
Zaptel Version:             1.4.1 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        Yes 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             03-24-2007 04:36 CDT
Last Modified:              06-07-2008 12:49 CDT
====================================================================== 
Summary:                    [patch] ZT_CHANDIAG: allocate in heap, and enable by
default
Description: 
when the ioctl ZT_CHANDIAG is called, zaptel copies the zt_chan structure
aside and dumps it with printk-s. However it currently allocates the struct
on the stack. 

This big allocation on the stack gives a good chance for stack overrun,
and it seems that for that reason ZT_CHANDIAG is disabled by default. As it
is disabled, ztdiag does nothing.

The attached patch allocates the struct on the stack, and removes the
ifdef around that code.
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 06-07-08 12:49  
---------------------------------------------------------------------- 
Repository: dahdi
Revision: 2384

U   trunk/zaptel.c

------------------------------------------------------------------------
r2384 | russell | 2008-06-07 12:49:27 -0500 (Sat, 07 Jun 2008) | 5 lines

The ZT_CHANDIAG ioctl was disabled by default because the large zt_chan
struct
that was being allocated on the stack is too big for some systems (those
with
4k stacks).  So, change the code to allocate the struct on the heap, and
let
the ioctl be always enabled.  (issue http://bugs.digium.com/view.php?id=9364,
patch by tzafrir, with minor
mods)

------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=2384 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-07-08 12:49  svnbot         Checkin                                      
06-07-08 12:49  svnbot         Note Added: 0088273                          
======================================================================




More information about the asterisk-bugs mailing list