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

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Jun 14 03:31:26 CDT 2009


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:                     new
====================================================================== 
Date Submitted:             2009-04-01 18:38 CDT
Last Modified:              2009-06-14 03:31 CDT
====================================================================== 
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 :-)
====================================================================== 

---------------------------------------------------------------------- 
 (0106371) tzafrir (manager) - 2009-06-14 03:31
 https://issues.asterisk.org/view.php?id=14808#c106371 
---------------------------------------------------------------------- 
One small patch - don't forget to mark pareameters to dahdi_read and
dahdi_write as __user . We'll need to go over them as well.

As an aside - the various dahdi_ioctl subfunctions tend to use the
userspace parameter through an explicit cast, and thus avoid the check. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-06-14 03:31 tzafrir        Note Added: 0106371                          
======================================================================




More information about the asterisk-bugs mailing list