[asterisk-bugs] [DAHDI-linux 0014808]: [patch] ioctls from 32bit userspace on 64bit kernel

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Jan 6 13:16:53 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=14808 
====================================================================== 
Reported By:                tzafrir
Assigned To:                
====================================================================== 
Project:                    DAHDI-linux
Issue ID:                   14808
Category:                   General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     ready for testing
JIRA:                        
Reviewboard Link:            
====================================================================== 
Date Submitted:             2009-04-01 18:38 CDT
Last Modified:              2010-01-06 13:16 CST
====================================================================== 
Summary:                    [patch] ioctls from 32bit userspace on 64bit kernel
Description: 
Create a 32bit system on (chroot_dir/ , for this example) of a 64bit
system. 
Connect a DAHDI device and load its drivers.

On Debian/Ubuntu amd64:

  debootstrap --arch=i386
--insclude=build-essential,subversion,libreadline5-dev,libssl-dev,libnewt-dev
SUITE chroot_dir
  chroot chroot_dir
  # and build asterisk

(SUITE is the name of the distro to install: lenny, sid, testing,
unstable, jaunty, hardy, etc.)

Now run:

  mount -o bind /dev chroot_dir/dev
  chroot chroot_dir
  mount /proc
  mount /sys
  dahdi_genconf
  dahdi_cfg

The last command will generate errors:

DAHDI_CHANCONFIG failed on channel 1: Invalid argument (22)

Such a case should probably be handled through a compat_ioctl
(linux/compat.h). More reading is needed :-)
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
has duplicate       0015884 MeetMe conference does break immediatel...
====================================================================== 

---------------------------------------------------------------------- 
 (0116148) svnbot (reporter) - 2010-01-06 13:16
 https://issues.asterisk.org/view.php?id=14808#c116148 
---------------------------------------------------------------------- 
Repository: dahdi
Revision: 7769

U   linux/trunk/drivers/dahdi/dahdi-base.c

------------------------------------------------------------------------
r7769 | tzafrir | 2010-01-06 13:16:52 -0600 (Wed, 06 Jan 2010) | 16 lines

Use unlocked_ioctl and compat_ioctl instead of ioctl.

* dahdi-base needs compat_ioctl in order to allow 32-bit userspace
  applications to call the DAHDI ioctls in a 64-bit kernel.
* add a separate dahdi_ioctl_compat() to handle functions whose parameters
  will need some tweaks (currently: only reject DAHDI_SFCONFIG).

(closes issue https://issues.asterisk.org/view.php?id=14808)

* 0002-dahdi-base-Use-unlocked_ioctl-and-compat_ioctl-inste.patch uploaded
  by sruffell (license 456)
* 0003-add-a-separate-dahdi_ioctl_compat.patch uploaded by tzafrir
  (license 46)

Tested by: sruffell, tzafrir

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-01-06 13:16 svnbot         Checkin                                      
2010-01-06 13:16 svnbot         Note Added: 0116148                          
======================================================================




More information about the asterisk-bugs mailing list