BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005634 [BusyBox] Kernel Module Support minor always 10-22-08 00:46 10-22-08 04:59
Reporter zaphod View Status public  
Assigned To uClibc
Priority normal Resolution open  
Status assigned   Product Version svn
Summary 0005634: rmmod hangs when trying to remove a busy kernel module using delete_module() from µClibc
Description Busybox uses delete_module() to remove a kernel module. It assumes delete_module() to be a function with the following prototype:

    int delete_module(const char *module, unsigned int flags);

Unfortunatly µClibc provides delete_module() as follows:

    int delete_module(const char *name);

The flags containing O_NONBLOCK gets lost on the way to the kernel and rmmod hangs.

To fix this simply fall back to busybox own implementation, which is used in all cases except for µClibc:

#ifdef __UCLIBC__
extern int delete_module(const char *module, unsigned int flags);
#else
# include <sys/syscall.h>
# define delete_module(mod, flags) syscall(__NR_delete_module, mod, flags)
#endif

Additional Information in all linux-2.4.x delete_module was a syscall1 (as opposed to later kernels). I'll take a look.
Attached Files

- Relationships

- Notes
(0013974)
zaphod
10-22-08 04:35

In a note in the µClibc delete_module report you asked, whether I could check the syscall2 version of delete_module under a 2.4 kernel. The following is from strace rmmod under 2.4.32:

delete_module("ip_conntrack_ftp", O_RDONLY|O_EXCL|O_NONBLOCK) = -1 EBUSY (Device
 or resource busy)

rmmod sets the flags to O_NONBLOCK|O_EXCL, O_RDONLY is defined as 0, so delete_module passes the right flags to the kernel and the kernel ignores them as expected.
 
(0013984)
bernhardf
10-22-08 04:59

thanks. If relly needed that #ifndef could be extended to
#if defined __UCLIBC__ && (__UCLIBC_MAJOR__ == 0 && __UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 30)
 

- Issue History
Date Modified Username Field Change
10-22-08 00:46 zaphod New Issue
10-22-08 00:46 zaphod Status new => assigned
10-22-08 00:46 zaphod Assigned To  => BusyBox
10-22-08 01:13 bernhardf Assigned To BusyBox => uClibc
10-22-08 01:13 bernhardf Additional Information Updated
10-22-08 04:35 zaphod Note Added: 0013974
10-22-08 04:59 bernhardf Note Added: 0013984


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker