* [uml-devel] Deadlock when calling securityfs_create_dir
@ 2007-06-29 19:14 kototama kototama
2007-07-03 15:47 ` Blaisorblade
0 siblings, 1 reply; 2+ messages in thread
From: kototama kototama @ 2007-06-29 19:14 UTC (permalink / raw)
To: UML-user
[-- Attachment #1.1: Type: text/plain, Size: 1542 bytes --]
Hello,
After mounting securityfs like this:
uml# mount securityfs -t securityfs /sys/kernel/security
I load a module which performs these operations:
static void securityfs_init(void)
{
struct dentry *de;
printk(KERN_ALERT "securityfs_init\n");
de = securityfs_create_dir("berlinfw2", NULL);
if(!de) {
printk(KERN_ALERT "Can't create security directory\n");
}
}
Then I've got a deadlock, interruption uml, and showing the stackstrace
gives that:
#0 hard_handler (sig=11) at arch/um/os-Linux/sys-i386/signal.c:11
#1 <signal handler called>
#2 0x081b76da in mutex_lock (lock=0x40162068) at
include/asm/arch/atomic.h:189
#3 0x0812dfbb in create_by_name (name=0xa81b09c "<1>securityfs_init\n",
mode=16877, parent=0x95a3f1c,
dentry=0x95a3ec8) at security/inode.c:173
#4 0x0812e0e0 in securityfs_create_file (name=0xa81b09c
"<1>securityfs_init\n", mode=16877, parent=0x95a3f1c,
data=0x0, fops=0x0) at security/inode.c:231
#5 0x0812e160 in securityfs_create_dir (name=0xa81b09c
"<1>securityfs_init\n", parent=0x95a3f1c)
at security/inode.c:272
#6 0x0a81b04a in ?? ()
#7 0x0a81b09c in ?? ()
#8 0x095a3f1c in ?? ()
#9 0x0809de76 in sys_init_module (umod=0x821aab4, len=1, uargs=0xa81b440
"\001") at kernel/module.c:1991
The module works fine on the host. The host kernel is
2.6.20-16-generic(ubuntu feisty fawn), the uml kernel is compiled from
ubuntu sources.
It seems there is a memory problem in the frame #5, the argument of the call
is wrong!
Any ideas ?
[-- Attachment #1.2: Type: text/html, Size: 2130 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 194 bytes --]
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [uml-devel] Deadlock when calling securityfs_create_dir
2007-06-29 19:14 [uml-devel] Deadlock when calling securityfs_create_dir kototama kototama
@ 2007-07-03 15:47 ` Blaisorblade
0 siblings, 0 replies; 2+ messages in thread
From: Blaisorblade @ 2007-07-03 15:47 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: kototama kototama
[-- Attachment #1.1: Type: text/plain, Size: 3145 bytes --]
On venerdì 29 giugno 2007, kototama kototama wrote:
> Hello,
>
> After mounting securityfs like this:
>
> uml# mount securityfs -t securityfs /sys/kernel/security
>
> I load a module which performs these operations:
>
>
> static void securityfs_init(void)
> {
> struct dentry *de;
>
>
> printk(KERN_ALERT "securityfs_init\n");
> de = securityfs_create_dir("berlinfw2", NULL);
> if(!de) {
> printk(KERN_ALERT "Can't create security directory\n");
> }
> }
>
>
> Then I've got a deadlock, interruption uml, and showing the stackstrace
> gives that:
>
> #0 hard_handler (sig=11) at arch/um/os-Linux/sys-i386/signal.c:11
> #1 <signal handler called>
> #2 0x081b76da in mutex_lock (lock=0x40162068) at
> include/asm/arch/atomic.h:189
> #3 0x0812dfbb in create_by_name (name=0xa81b09c "<1>securityfs_init\n",
> mode=16877, parent=0x95a3f1c,
> dentry=0x95a3ec8) at security/inode.c:173
> #4 0x0812e0e0 in securityfs_create_file (name=0xa81b09c
> "<1>securityfs_init\n", mode=16877, parent=0x95a3f1c,
> data=0x0, fops=0x0) at security/inode.c:231
> #5 0x0812e160 in securityfs_create_dir (name=0xa81b09c
> "<1>securityfs_init\n", parent=0x95a3f1c)
> at security/inode.c:272
> #6 0x0a81b04a in ?? ()
> #7 0x0a81b09c in ?? ()
> #8 0x095a3f1c in ?? ()
> #9 0x0809de76 in sys_init_module (umod=0x821aab4, len=1, uargs=0xa81b440
> "\001") at kernel/module.c:1991
>
> The module works fine on the host.
Hmm, it's possible, but this does not seem UML's fault either. Have you tried
to get a backtrace through uml_mconsole?
A note: the check for errors is wrong, you should also check IS_ERR(de).
Actually I also see this cannot cause a deadlock (nor can the NULL argument).
When CONFIG_SECURITY is disabled, this implementation from
include/linux/security.h is used:
static inline struct dentry *securityfs_create_dir(const char *name,
struct dentry *parent)
{
return ERR_PTR(-ENODEV);
}
Possibly you just disabled CONFIG_SECURITY on the host (well, the default
Ubuntu kernel has it enabled).
> The host kernel is
> 2.6.20-16-generic(ubuntu feisty fawn), the uml kernel is compiled from
> ubuntu sources.
>
> It seems there is a memory problem in the frame #5, the argument of the
> call is wrong!
Never fully trust gdb output, when running optimized binaries. It may help to
compile UML replacing -O2 with -O1 or even -O0 (in the latter case, it may
even not compile successfully).
If you add a breakpoint on securityfs_create_dir and singlestep to look at
what happens (which you should do), you'll probably see that a bit after the
breakpoint gdb shows the correct value (it often does not at breakpoint's
time), and later the value will change when the space is reused.
Btw, breakpoints will work better if you attach to UML after boot rather than
starting UML from inside gdb.
Bye
--
Inform me of my mistakes, so I can add them to my list!
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 194 bytes --]
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-03 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-29 19:14 [uml-devel] Deadlock when calling securityfs_create_dir kototama kototama
2007-07-03 15:47 ` Blaisorblade
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox