* Adding bridge interface to non-default network namespace crashes kernel
@ 2009-09-07 15:07 Atis Elsts
2009-09-08 8:40 ` Daniel Lezcano
0 siblings, 1 reply; 2+ messages in thread
From: Atis Elsts @ 2009-09-07 15:07 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA; +Cc: containers-qjLDD68F18O7TbgM5vRIOg
[-- Attachment #1: Type: text/plain, Size: 491 bytes --]
Trying to add bridge interface from userspace program, after moving the
program to a new network namespace, causes kernel to crash. I am using latest
kernel version from git (2.6.31-rc9).
The bug is easy to reproduce - just compile and run the attached C program.
I see that bridge interface has NETIF_F_NETNS_LOCAL flag, but as I understand,
this flag simply means that a device cannot be *moved* across network
namespaces, not that it cannot be *created* in other namespaces.
--Atis
[-- Attachment #2: crash.c --]
[-- Type: text/x-csrc, Size: 571 bytes --]
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <linux/sched.h>
#include <linux/sockios.h>
int main() {
if (unshare(CLONE_NEWNET)) {
perror("unshare");
return -1;
}
int fd = socket(AF_INET, SOCK_DGRAM, 0);
if (fd < 0) {
perror("socket");
return -1;
}
const char *name = "lobridge";
if (ioctl(fd, SIOCBRADDBR, name) < 0) {
perror("ioctl SIOCBRADDBR");
return -1;
}
system("ip addr");
for (;;) {
printf("still running\n");
sleep(5);
}
}
[-- Attachment #3: syslog --]
[-- Type: text/plain, Size: 3289 bytes --]
Sep 7 16:06:19 debian kernel: [ 91.040000] ------------[ cut here ]------------
Sep 7 16:06:19 debian kernel: [ 91.040000] kernel BUG at fs/sysfs/group.c:65!
Sep 7 16:06:19 debian kernel: [ 91.040000] invalid opcode: 0000 [#1] SMP
Sep 7 16:06:19 debian kernel: [ 91.040000] last sysfs file: /sys/devices/virtual/net/lo/operstate
Sep 7 16:06:19 debian kernel: [ 91.040000] Modules linked in:
Sep 7 16:06:19 debian kernel: [ 91.040000]
Sep 7 16:06:19 debian kernel: [ 91.040000] Pid: 1667, comm: a.out Not tainted (2.6.31-rc9 #16)
Sep 7 16:06:19 debian kernel: [ 91.040000] EIP: 0060:[<c0218c5e>] EFLAGS: 00000246 CPU: 0
Sep 7 16:06:19 debian kernel: [ 91.040000] EIP is at internal_create_group+0x14e/0x180
Sep 7 16:06:19 debian kernel: [ 91.040000] EAX: 00000000 EBX: c71fb000 ECX: c053aae0 EDX: 00000000
Sep 7 16:06:19 debian kernel: [ 91.040000] ESI: 00000000 EDI: c71fb25c EBP: c6dede58 ESP: c6dede30
Sep 7 16:06:19 debian kernel: [ 91.040000] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Sep 7 16:06:19 debian kernel: [ 91.040000] Process a.out (pid: 1667, ti=c6dec000 task=c6df1920 task.ti=c6dec000)
Sep 7 16:06:19 debian kernel: [ 91.040000] Stack:
Sep 7 16:06:19 debian kernel: [ 91.040000] c71fb008 c053aae0 00000000 c71fb25c 00000000 00000000 c6dede58 c71fb000
Sep 7 16:06:19 debian kernel: [ 91.040000] <0> 00000000 c71fb25c c6dede60 c0218cbc c6dede84 c03c6bc3 00000000 00000000
Sep 7 16:06:19 debian kernel: [ 91.040000] <0> 00000000 c7102000 c71fb000 00000000 c7102000 c6dedea0 c03c348f 00000001
Sep 7 16:06:19 debian kernel: [ 91.040000] Call Trace:
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c0218cbc>] ? sysfs_create_group+0xc/0x10
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c03c6bc3>] ? br_sysfs_addbr+0x23/0xf0
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c03c348f>] ? br_add_bridge+0x18f/0x1a0
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c03c4328>] ? br_ioctl_deviceless_stub+0x1f8/0x210
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c03c4130>] ? br_ioctl_deviceless_stub+0x0/0x210
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c032e0cf>] ? sock_ioctl+0xbf/0x220
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c032e010>] ? sock_ioctl+0x0/0x220
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c01d4e28>] ? vfs_ioctl+0x28/0x80
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c01d4faa>] ? do_vfs_ioctl+0x6a/0x520
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c032d2a3>] ? sock_map_fd+0x43/0x70
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c032db22>] ? sys_socket+0x52/0x70
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c0118138>] ? do_page_fault+0x168/0x310
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c01d54b3>] ? sys_ioctl+0x53/0x70
Sep 7 16:06:19 debian kernel: [ 91.040000] [<c0102c04>] ? sysenter_do_call+0x12/0x22
Sep 7 16:06:19 debian kernel: [ 91.040000] Code: bd 8b 5d e0 83 45 ec 01 85 db 0f 84 63 ff ff ff 8b 12 89 f8 e8 e4 ce ff ff 8b 16 e9 53 ff ff ff 8b 40 18 85 c0 0f 85 e9 fe ff ff <0f> 0b eb fe 89 f8 e8 47 ea ff ff 8b 45 e8 83 c4 1c 5b 5e 5f 5d
Sep 7 16:06:19 debian kernel: [ 91.040000] EIP: [<c0218c5e>] internal_create_group+0x14e/0x180 SS:ESP 0068:c6dede30
Sep 7 16:06:19 debian kernel: [ 91.040000] ---[ end trace beadcfdb06c985eb ]---
[-- Attachment #4: Type: text/plain, Size: 206 bytes --]
_______________________________________________
Containers mailing list
Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Adding bridge interface to non-default network namespace crashes kernel
2009-09-07 15:07 Adding bridge interface to non-default network namespace crashes kernel Atis Elsts
@ 2009-09-08 8:40 ` Daniel Lezcano
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Lezcano @ 2009-09-08 8:40 UTC (permalink / raw)
To: Atis Elsts; +Cc: netdev, containers
Atis Elsts wrote:
> Trying to add bridge interface from userspace program, after moving the
> program to a new network namespace, causes kernel to crash. I am using latest
> kernel version from git (2.6.31-rc9).
> The bug is easy to reproduce - just compile and run the attached C program.
>
> I see that bridge interface has NETIF_F_NETNS_LOCAL flag, but as I understand,
> this flag simply means that a device cannot be *moved* across network
> namespaces, not that it cannot be *created* in other namespaces.
>
Yep, very easy to reproduce :/
The sysfs has not been disabled for the bridge. I will try to fix it as
soon as I can.
Thanks
-- Daniel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-08 8:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-07 15:07 Adding bridge interface to non-default network namespace crashes kernel Atis Elsts
2009-09-08 8:40 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox