aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/mm/hash_utils_64.c2
-rw-r--r--arch/sparc/kernel/vmlinux.lds.S18
-rw-r--r--arch/sparc64/kernel/vmlinux.lds.S18
-rw-r--r--arch/um/os-Linux/start_up.c22
-rw-r--r--arch/um/os-Linux/user_syms.c5
-rw-r--r--arch/um/sys-i386/Makefile8
-rw-r--r--arch/um/sys-x86_64/Makefile5
-rw-r--r--arch/x86_64/mm/init.c2
-rw-r--r--drivers/char/drm/radeon_cp.c6
-rw-r--r--drivers/char/vc_screen.c2
-rw-r--r--drivers/input/mouse/sermouse.c2
-rw-r--r--drivers/media/video/saa7134/Kconfig4
-rw-r--r--drivers/net/ppp_generic.c3
-rw-r--r--drivers/net/tg3.c13
-rw-r--r--drivers/net/tg3.h7
-rw-r--r--drivers/usb/input/aiptek.c2
-rw-r--r--fs/hostfs/hostfs_kern.c9
-rw-r--r--include/net/if_inet6.h1
-rw-r--r--net/bridge/br_netfilter.c2
-rw-r--r--net/core/filter.c4
-rw-r--r--net/ipv6/addrconf.c9
-rw-r--r--net/ipv6/mcast.c142
22 files changed, 187 insertions, 99 deletions
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index a33583f3b0e7..a606504678bd 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -514,7 +514,7 @@ void __init htab_initialize(void)
514#undef KB 514#undef KB
515#undef MB 515#undef MB
516 516
517void __init htab_initialize_secondary(void) 517void htab_initialize_secondary(void)
518{ 518{
519 if (!platform_is_lpar()) 519 if (!platform_is_lpar())
520 mtspr(SPRN_SDR1, _SDR1); 520 mtspr(SPRN_SDR1, _SDR1);
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index 38938d2e63aa..346c19a949fd 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -85,19 +85,9 @@ SECTIONS
85 } 85 }
86 _end = . ; 86 _end = . ;
87 PROVIDE (end = .); 87 PROVIDE (end = .);
88 /* Stabs debugging sections. */
89 .stab 0 : { *(.stab) }
90 .stabstr 0 : { *(.stabstr) }
91 .stab.excl 0 : { *(.stab.excl) }
92 .stab.exclstr 0 : { *(.stab.exclstr) }
93 .stab.index 0 : { *(.stab.index) }
94 .stab.indexstr 0 : { *(.stab.indexstr) }
95 .comment 0 : { *(.comment) }
96 .debug 0 : { *(.debug) }
97 .debug_srcinfo 0 : { *(.debug_srcinfo) }
98 .debug_aranges 0 : { *(.debug_aranges) }
99 .debug_pubnames 0 : { *(.debug_pubnames) }
100 .debug_sfnames 0 : { *(.debug_sfnames) }
101 .line 0 : { *(.line) }
102 /DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) } 88 /DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) }
89
90 STABS_DEBUG
91
92 DWARF_DEBUG
103} 93}
diff --git a/arch/sparc64/kernel/vmlinux.lds.S b/arch/sparc64/kernel/vmlinux.lds.S
index 2af0cf0a8640..467d13a0d5c1 100644
--- a/arch/sparc64/kernel/vmlinux.lds.S
+++ b/arch/sparc64/kernel/vmlinux.lds.S
@@ -90,19 +90,9 @@ SECTIONS
90 } 90 }
91 _end = . ; 91 _end = . ;
92 PROVIDE (end = .); 92 PROVIDE (end = .);
93 /* Stabs debugging sections. */
94 .stab 0 : { *(.stab) }
95 .stabstr 0 : { *(.stabstr) }
96 .stab.excl 0 : { *(.stab.excl) }
97 .stab.exclstr 0 : { *(.stab.exclstr) }
98 .stab.index 0 : { *(.stab.index) }
99 .stab.indexstr 0 : { *(.stab.indexstr) }
100 .comment 0 : { *(.comment) }
101 .debug 0 : { *(.debug) }
102 .debug_srcinfo 0 : { *(.debug_srcinfo) }
103 .debug_aranges 0 : { *(.debug_aranges) }
104 .debug_pubnames 0 : { *(.debug_pubnames) }
105 .debug_sfnames 0 : { *(.debug_sfnames) }
106 .line 0 : { *(.line) }
107 /DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) } 93 /DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) }
94
95 STABS_DEBUG
96
97 DWARF_DEBUG
108} 98}
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 37517d49c4ae..29a9e3f43763 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -116,16 +116,16 @@ static int stop_ptraced_child(int pid, void *stack, int exitcode,
116 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) { 116 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
117 int exit_with = WEXITSTATUS(status); 117 int exit_with = WEXITSTATUS(status);
118 if (exit_with == 2) 118 if (exit_with == 2)
119 printk("check_ptrace : child exited with status 2. " 119 printf("check_ptrace : child exited with status 2. "
120 "Serious trouble happening! Try updating your " 120 "Serious trouble happening! Try updating your "
121 "host skas patch!\nDisabling SYSEMU support."); 121 "host skas patch!\nDisabling SYSEMU support.");
122 printk("check_ptrace : child exited with exitcode %d, while " 122 printf("check_ptrace : child exited with exitcode %d, while "
123 "expecting %d; status 0x%x", exit_with, 123 "expecting %d; status 0x%x", exit_with,
124 exitcode, status); 124 exitcode, status);
125 if (mustpanic) 125 if (mustpanic)
126 panic("\n"); 126 panic("\n");
127 else 127 else
128 printk("\n"); 128 printf("\n");
129 ret = -1; 129 ret = -1;
130 } 130 }
131 131
@@ -183,7 +183,7 @@ static void __init check_sysemu(void)
183 void *stack; 183 void *stack;
184 int pid, n, status, count=0; 184 int pid, n, status, count=0;
185 185
186 printk("Checking syscall emulation patch for ptrace..."); 186 printf("Checking syscall emulation patch for ptrace...");
187 sysemu_supported = 0; 187 sysemu_supported = 0;
188 pid = start_ptraced_child(&stack); 188 pid = start_ptraced_child(&stack);
189 189
@@ -207,10 +207,10 @@ static void __init check_sysemu(void)
207 goto fail_stopped; 207 goto fail_stopped;
208 208
209 sysemu_supported = 1; 209 sysemu_supported = 1;
210 printk("OK\n"); 210 printf("OK\n");
211 set_using_sysemu(!force_sysemu_disabled); 211 set_using_sysemu(!force_sysemu_disabled);
212 212
213 printk("Checking advanced syscall emulation patch for ptrace..."); 213 printf("Checking advanced syscall emulation patch for ptrace...");
214 pid = start_ptraced_child(&stack); 214 pid = start_ptraced_child(&stack);
215 215
216 if(ptrace(PTRACE_OLDSETOPTIONS, pid, 0, 216 if(ptrace(PTRACE_OLDSETOPTIONS, pid, 0,
@@ -246,7 +246,7 @@ static void __init check_sysemu(void)
246 goto fail_stopped; 246 goto fail_stopped;
247 247
248 sysemu_supported = 2; 248 sysemu_supported = 2;
249 printk("OK\n"); 249 printf("OK\n");
250 250
251 if ( !force_sysemu_disabled ) 251 if ( !force_sysemu_disabled )
252 set_using_sysemu(sysemu_supported); 252 set_using_sysemu(sysemu_supported);
@@ -255,7 +255,7 @@ static void __init check_sysemu(void)
255fail: 255fail:
256 stop_ptraced_child(pid, stack, 1, 0); 256 stop_ptraced_child(pid, stack, 1, 0);
257fail_stopped: 257fail_stopped:
258 printk("missing\n"); 258 printf("missing\n");
259} 259}
260 260
261static void __init check_ptrace(void) 261static void __init check_ptrace(void)
@@ -263,7 +263,7 @@ static void __init check_ptrace(void)
263 void *stack; 263 void *stack;
264 int pid, syscall, n, status; 264 int pid, syscall, n, status;
265 265
266 printk("Checking that ptrace can change system call numbers..."); 266 printf("Checking that ptrace can change system call numbers...");
267 pid = start_ptraced_child(&stack); 267 pid = start_ptraced_child(&stack);
268 268
269 if(ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) 269 if(ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0)
@@ -292,7 +292,7 @@ static void __init check_ptrace(void)
292 } 292 }
293 } 293 }
294 stop_ptraced_child(pid, stack, 0, 1); 294 stop_ptraced_child(pid, stack, 0, 1);
295 printk("OK\n"); 295 printf("OK\n");
296 check_sysemu(); 296 check_sysemu();
297} 297}
298 298
@@ -472,6 +472,8 @@ int can_do_skas(void)
472 472
473int have_devanon = 0; 473int have_devanon = 0;
474 474
475/* Runs on boot kernel stack - already safe to use printk. */
476
475void check_devanon(void) 477void check_devanon(void)
476{ 478{
477 int fd; 479 int fd;
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index 56d3f870926b..8da6ab31152a 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -34,6 +34,11 @@ EXPORT_SYMBOL(strstr);
34 int sym(void); \ 34 int sym(void); \
35 EXPORT_SYMBOL(sym); 35 EXPORT_SYMBOL(sym);
36 36
37extern void readdir64(void) __attribute__((weak));
38EXPORT_SYMBOL(readdir64);
39extern void truncate64(void) __attribute__((weak));
40EXPORT_SYMBOL(truncate64);
41
37#ifdef SUBARCH_i386 42#ifdef SUBARCH_i386
38EXPORT_SYMBOL(vsyscall_ehdr); 43EXPORT_SYMBOL(vsyscall_ehdr);
39EXPORT_SYMBOL(vsyscall_end); 44EXPORT_SYMBOL(vsyscall_end);
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
index 150059dbee12..f5fd5b0156d0 100644
--- a/arch/um/sys-i386/Makefile
+++ b/arch/um/sys-i386/Makefile
@@ -1,6 +1,8 @@
1obj-y = bitops.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ 1obj-y := bitops.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
2 ptrace_user.o semaphore.o signal.o sigcontext.o stub.o stub_segv.o \ 2 ptrace_user.o semaphore.o signal.o sigcontext.o syscalls.o sysrq.o \
3 syscalls.o sysrq.o sys_call_table.o 3 sys_call_table.o
4
5obj-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o
4 6
5obj-$(CONFIG_HIGHMEM) += highmem.o 7obj-$(CONFIG_HIGHMEM) += highmem.o
6obj-$(CONFIG_MODULES) += module.o 8obj-$(CONFIG_MODULES) += module.o
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
index 00b2025427df..a351091fbd99 100644
--- a/arch/um/sys-x86_64/Makefile
+++ b/arch/um/sys-x86_64/Makefile
@@ -6,8 +6,9 @@
6 6
7#XXX: why into lib-y? 7#XXX: why into lib-y?
8lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o ldt.o mem.o memcpy.o \ 8lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o ldt.o mem.o memcpy.o \
9 ptrace.o ptrace_user.o sigcontext.o signal.o stub.o \ 9 ptrace.o ptrace_user.o sigcontext.o signal.o syscalls.o \
10 stub_segv.o syscalls.o syscall_table.o sysrq.o thunk.o 10 syscall_table.o sysrq.o thunk.o
11lib-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o
11 12
12obj-y := ksyms.o 13obj-y := ksyms.o
13obj-$(CONFIG_MODULES) += module.o um_module.o 14obj-$(CONFIG_MODULES) += module.o um_module.o
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index 286f6a624c3a..c016dfe84784 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -348,7 +348,7 @@ size_zones(unsigned long *z, unsigned long *h,
348 } 348 }
349 349
350 /* Compute holes */ 350 /* Compute holes */
351 w = 0; 351 w = start_pfn;
352 for (i = 0; i < MAX_NR_ZONES; i++) { 352 for (i = 0; i < MAX_NR_ZONES; i++) {
353 unsigned long s = w; 353 unsigned long s = w;
354 w += z[i]; 354 w += z[i];
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index 501e557cbc86..b517ae515801 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -1312,7 +1312,7 @@ static void radeon_set_pcigart(drm_radeon_private_t * dev_priv, int on)
1312static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init) 1312static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init)
1313{ 1313{
1314 drm_radeon_private_t *dev_priv = dev->dev_private; 1314 drm_radeon_private_t *dev_priv = dev->dev_private;
1315 unsigned int mem_size; 1315 unsigned int mem_size, aper_size;
1316 1316
1317 DRM_DEBUG("\n"); 1317 DRM_DEBUG("\n");
1318 1318
@@ -1527,7 +1527,9 @@ static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init)
1527 mem_size = RADEON_READ(RADEON_CONFIG_MEMSIZE); 1527 mem_size = RADEON_READ(RADEON_CONFIG_MEMSIZE);
1528 if (mem_size == 0) 1528 if (mem_size == 0)
1529 mem_size = 0x800000; 1529 mem_size = 0x800000;
1530 dev_priv->gart_vm_start = dev_priv->fb_location + mem_size; 1530 aper_size = max(RADEON_READ(RADEON_CONFIG_APER_SIZE), mem_size);
1531
1532 dev_priv->gart_vm_start = dev_priv->fb_location + aper_size;
1531 1533
1532#if __OS_HAS_AGP 1534#if __OS_HAS_AGP
1533 if (!dev_priv->is_pci) 1535 if (!dev_priv->is_pci)
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index f66c7ad6fd38..3c1dafaa3441 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -419,7 +419,7 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
419 while (this_round > 1) { 419 while (this_round > 1) {
420 unsigned short w; 420 unsigned short w;
421 421
422 w = get_unaligned(((const unsigned short *)con_buf0)); 422 w = get_unaligned(((unsigned short *)con_buf0));
423 vcs_scr_writew(vc, w, org++); 423 vcs_scr_writew(vc, w, org++);
424 con_buf0 += 2; 424 con_buf0 += 2;
425 this_round -= 2; 425 this_round -= 2;
diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c
index 4bf584364d28..2f9a04ae725f 100644
--- a/drivers/input/mouse/sermouse.c
+++ b/drivers/input/mouse/sermouse.c
@@ -95,7 +95,7 @@ static void sermouse_process_msc(struct sermouse *sermouse, signed char data, st
95 95
96 input_sync(dev); 96 input_sync(dev);
97 97
98 if (++sermouse->count == (5 - ((sermouse->type == SERIO_SUN) << 1))) 98 if (++sermouse->count == 5)
99 sermouse->count = 0; 99 sermouse->count = 0;
100} 100}
101 101
diff --git a/drivers/media/video/saa7134/Kconfig b/drivers/media/video/saa7134/Kconfig
index c0f604a6fe42..86e1bb391a4e 100644
--- a/drivers/media/video/saa7134/Kconfig
+++ b/drivers/media/video/saa7134/Kconfig
@@ -14,7 +14,7 @@ config VIDEO_SAA7134
14 14
15config VIDEO_SAA7134_ALSA 15config VIDEO_SAA7134_ALSA
16 tristate "Philips SAA7134 DMA audio support" 16 tristate "Philips SAA7134 DMA audio support"
17 depends on VIDEO_SAA7134 && SOUND && SND && (!VIDEO_SAA7134_OSS || VIDEO_SAA7134_OSS = m) 17 depends on VIDEO_SAA7134 && SND
18 select SND_PCM_OSS 18 select SND_PCM_OSS
19 ---help--- 19 ---help---
20 This is a video4linux driver for direct (DMA) audio in 20 This is a video4linux driver for direct (DMA) audio in
@@ -25,7 +25,7 @@ config VIDEO_SAA7134_ALSA
25 25
26config VIDEO_SAA7134_OSS 26config VIDEO_SAA7134_OSS
27 tristate "Philips SAA7134 DMA audio support (OSS, DEPRECATED)" 27 tristate "Philips SAA7134 DMA audio support (OSS, DEPRECATED)"
28 depends on VIDEO_SAA7134 && SOUND_PRIME && (!VIDEO_SAA7134_ALSA || VIDEO_SAA7134_ALSA = m) 28 depends on VIDEO_SAA7134 && SOUND_PRIME && (!VIDEO_SAA7134_ALSA || (VIDEO_SAA7134_ALSA=m && m))
29 ---help--- 29 ---help---
30 This is a video4linux driver for direct (DMA) audio in 30 This is a video4linux driver for direct (DMA) audio in
31 Philips SAA713x based TV cards using OSS 31 Philips SAA713x based TV cards using OSS
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 50430f79f8cf..1c6d328165bb 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -524,9 +524,6 @@ static int get_filter(void __user *arg, struct sock_filter **p)
524 if (copy_from_user(&uprog, arg, sizeof(uprog))) 524 if (copy_from_user(&uprog, arg, sizeof(uprog)))
525 return -EFAULT; 525 return -EFAULT;
526 526
527 if (uprog.len > BPF_MAXINSNS)
528 return -EINVAL;
529
530 if (!uprog.len) { 527 if (!uprog.len) {
531 *p = NULL; 528 *p = NULL;
532 return 0; 529 return 0;
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index cefb0c08a68d..2fc9893d69e1 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -68,8 +68,8 @@
68 68
69#define DRV_MODULE_NAME "tg3" 69#define DRV_MODULE_NAME "tg3"
70#define PFX DRV_MODULE_NAME ": " 70#define PFX DRV_MODULE_NAME ": "
71#define DRV_MODULE_VERSION "3.46" 71#define DRV_MODULE_VERSION "3.47"
72#define DRV_MODULE_RELDATE "Dec 19, 2005" 72#define DRV_MODULE_RELDATE "Dec 28, 2005"
73 73
74#define TG3_DEF_MAC_MODE 0 74#define TG3_DEF_MAC_MODE 0
75#define TG3_DEF_RX_MODE 0 75#define TG3_DEF_RX_MODE 0
@@ -7151,8 +7151,13 @@ do { p = (u32 *)(orig_p + (reg)); \
7151 GET_REG32_LOOP(BUFMGR_MODE, 0x58); 7151 GET_REG32_LOOP(BUFMGR_MODE, 0x58);
7152 GET_REG32_LOOP(RDMAC_MODE, 0x08); 7152 GET_REG32_LOOP(RDMAC_MODE, 0x08);
7153 GET_REG32_LOOP(WDMAC_MODE, 0x08); 7153 GET_REG32_LOOP(WDMAC_MODE, 0x08);
7154 GET_REG32_LOOP(RX_CPU_BASE, 0x280); 7154 GET_REG32_1(RX_CPU_MODE);
7155 GET_REG32_LOOP(TX_CPU_BASE, 0x280); 7155 GET_REG32_1(RX_CPU_STATE);
7156 GET_REG32_1(RX_CPU_PGMCTR);
7157 GET_REG32_1(RX_CPU_HWBKPT);
7158 GET_REG32_1(TX_CPU_MODE);
7159 GET_REG32_1(TX_CPU_STATE);
7160 GET_REG32_1(TX_CPU_PGMCTR);
7156 GET_REG32_LOOP(GRCMBOX_INTERRUPT_0, 0x110); 7161 GET_REG32_LOOP(GRCMBOX_INTERRUPT_0, 0x110);
7157 GET_REG32_LOOP(FTQ_RESET, 0x120); 7162 GET_REG32_LOOP(FTQ_RESET, 0x120);
7158 GET_REG32_LOOP(MSGINT_MODE, 0x0c); 7163 GET_REG32_LOOP(MSGINT_MODE, 0x0c);
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 94dbcf3537ec..890e1635996b 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1124,7 +1124,14 @@
1124/* 0x280 --> 0x400 unused */ 1124/* 0x280 --> 0x400 unused */
1125 1125
1126#define RX_CPU_BASE 0x00005000 1126#define RX_CPU_BASE 0x00005000
1127#define RX_CPU_MODE 0x00005000
1128#define RX_CPU_STATE 0x00005004
1129#define RX_CPU_PGMCTR 0x0000501c
1130#define RX_CPU_HWBKPT 0x00005034
1127#define TX_CPU_BASE 0x00005400 1131#define TX_CPU_BASE 0x00005400
1132#define TX_CPU_MODE 0x00005400
1133#define TX_CPU_STATE 0x00005404
1134#define TX_CPU_PGMCTR 0x0000541c
1128 1135
1129/* Mailboxes */ 1136/* Mailboxes */
1130#define GRCMBOX_INTERRUPT_0 0x00005800 /* 64-bit */ 1137#define GRCMBOX_INTERRUPT_0 0x00005800 /* 64-bit */
diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c
index 1c3b472a3bca..0e2505c073db 100644
--- a/drivers/usb/input/aiptek.c
+++ b/drivers/usb/input/aiptek.c
@@ -2103,7 +2103,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
2103 * values. 2103 * values.
2104 */ 2104 */
2105 input_set_abs_params(inputdev, ABS_X, 0, 2999, 0, 0); 2105 input_set_abs_params(inputdev, ABS_X, 0, 2999, 0, 0);
2106 input_set_abs_params(inputdev, ABS_X, 0, 2249, 0, 0); 2106 input_set_abs_params(inputdev, ABS_Y, 0, 2249, 0, 0);
2107 input_set_abs_params(inputdev, ABS_PRESSURE, 0, 511, 0, 0); 2107 input_set_abs_params(inputdev, ABS_PRESSURE, 0, 511, 0, 0);
2108 input_set_abs_params(inputdev, ABS_TILT_X, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0); 2108 input_set_abs_params(inputdev, ABS_TILT_X, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
2109 input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0); 2109 input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 4684eb7d48c6..b3ad0bd0312f 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -501,11 +501,16 @@ int hostfs_commit_write(struct file *file, struct page *page, unsigned from,
501 long long start; 501 long long start;
502 int err = 0; 502 int err = 0;
503 503
504 start = (long long) (page->index << PAGE_CACHE_SHIFT) + from; 504 start = (((long long) page->index) << PAGE_CACHE_SHIFT) + from;
505 buffer = kmap(page); 505 buffer = kmap(page);
506 err = write_file(FILE_HOSTFS_I(file)->fd, &start, buffer + from, 506 err = write_file(FILE_HOSTFS_I(file)->fd, &start, buffer + from,
507 to - from); 507 to - from);
508 if(err > 0) err = 0; 508 if(err > 0) err = 0;
509
510 /* Actually, if !err, write_file has added to-from to start, so, despite
511 * the appearance, we are comparing i_size against the _last_ written
512 * location, as we should. */
513
509 if(!err && (start > inode->i_size)) 514 if(!err && (start > inode->i_size))
510 inode->i_size = start; 515 inode->i_size = start;
511 516
@@ -910,10 +915,8 @@ static struct inode_operations hostfs_dir_iops = {
910int hostfs_link_readpage(struct file *file, struct page *page) 915int hostfs_link_readpage(struct file *file, struct page *page)
911{ 916{
912 char *buffer, *name; 917 char *buffer, *name;
913 long long start;
914 int err; 918 int err;
915 919
916 start = page->index << PAGE_CACHE_SHIFT;
917 buffer = kmap(page); 920 buffer = kmap(page);
918 name = inode_name(page->mapping->host, 0); 921 name = inode_name(page->mapping->host, 0);
919 if(name == NULL) return(-ENOMEM); 922 if(name == NULL) return(-ENOMEM);
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index d8234f9bd4c4..eb8afe3499a9 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -83,6 +83,7 @@ struct ipv6_mc_socklist
83 struct in6_addr addr; 83 struct in6_addr addr;
84 int ifindex; 84 int ifindex;
85 struct ipv6_mc_socklist *next; 85 struct ipv6_mc_socklist *next;
86 rwlock_t sflock;
86 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ 87 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */
87 struct ip6_sf_socklist *sflist; 88 struct ip6_sf_socklist *sflist;
88}; 89};
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 43a0b35dfe6f..23422bd53a5e 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -369,6 +369,7 @@ static unsigned int br_nf_pre_routing_ipv6(unsigned int hook,
369 if (hdr->nexthdr == NEXTHDR_HOP && check_hbh_len(skb)) 369 if (hdr->nexthdr == NEXTHDR_HOP && check_hbh_len(skb))
370 goto inhdr_error; 370 goto inhdr_error;
371 371
372 nf_bridge_put(skb->nf_bridge);
372 if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) 373 if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)
373 return NF_DROP; 374 return NF_DROP;
374 setup_pre_routing(skb); 375 setup_pre_routing(skb);
@@ -452,6 +453,7 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
452 skb->ip_summed = CHECKSUM_NONE; 453 skb->ip_summed = CHECKSUM_NONE;
453 } 454 }
454 455
456 nf_bridge_put(skb->nf_bridge);
455 if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) 457 if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)
456 return NF_DROP; 458 return NF_DROP;
457 setup_pre_routing(skb); 459 setup_pre_routing(skb);
diff --git a/net/core/filter.c b/net/core/filter.c
index 2841bfce29d6..3a10e0bc90e8 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -293,7 +293,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
293 struct sock_filter *ftest; 293 struct sock_filter *ftest;
294 int pc; 294 int pc;
295 295
296 if (((unsigned int)flen >= (~0U / sizeof(struct sock_filter))) || flen == 0) 296 if (flen == 0 || flen > BPF_MAXINSNS)
297 return -EINVAL; 297 return -EINVAL;
298 298
299 /* check the filter code now */ 299 /* check the filter code now */
@@ -360,7 +360,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
360 int err; 360 int err;
361 361
362 /* Make sure new filter is there and in the right amounts. */ 362 /* Make sure new filter is there and in the right amounts. */
363 if (fprog->filter == NULL || fprog->len > BPF_MAXINSNS) 363 if (fprog->filter == NULL)
364 return -EINVAL; 364 return -EINVAL;
365 365
366 fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL); 366 fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL);
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 2a6439e3c91c..a60585fd85ad 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2467,11 +2467,9 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags)
2467 return; 2467 return;
2468 } 2468 }
2469 2469
2470 if (idev->if_flags & IF_READY) { 2470 if (!(idev->if_flags & IF_READY)) {
2471 addrconf_dad_kick(ifp);
2472 spin_unlock_bh(&ifp->lock);
2473 } else {
2474 spin_unlock_bh(&ifp->lock); 2471 spin_unlock_bh(&ifp->lock);
2472 read_unlock_bh(&idev->lock);
2475 /* 2473 /*
2476 * If the defice is not ready: 2474 * If the defice is not ready:
2477 * - keep it tentative if it is a permanent address. 2475 * - keep it tentative if it is a permanent address.
@@ -2479,7 +2477,10 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags)
2479 */ 2477 */
2480 in6_ifa_hold(ifp); 2478 in6_ifa_hold(ifp);
2481 addrconf_dad_stop(ifp); 2479 addrconf_dad_stop(ifp);
2480 return;
2482 } 2481 }
2482 addrconf_dad_kick(ifp);
2483 spin_unlock_bh(&ifp->lock);
2483out: 2484out:
2484 read_unlock_bh(&idev->lock); 2485 read_unlock_bh(&idev->lock);
2485} 2486}
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index fd939da090c4..f829a4ad3ccc 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -170,7 +170,7 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
170#define MLDV2_QQIC(value) MLDV2_EXP(0x80, 4, 3, value) 170#define MLDV2_QQIC(value) MLDV2_EXP(0x80, 4, 3, value)
171#define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value) 171#define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value)
172 172
173#define IPV6_MLD_MAX_MSF 10 173#define IPV6_MLD_MAX_MSF 64
174 174
175int sysctl_mld_max_msf = IPV6_MLD_MAX_MSF; 175int sysctl_mld_max_msf = IPV6_MLD_MAX_MSF;
176 176
@@ -224,6 +224,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, struct in6_addr *addr)
224 224
225 mc_lst->ifindex = dev->ifindex; 225 mc_lst->ifindex = dev->ifindex;
226 mc_lst->sfmode = MCAST_EXCLUDE; 226 mc_lst->sfmode = MCAST_EXCLUDE;
227 mc_lst->sflock = RW_LOCK_UNLOCKED;
227 mc_lst->sflist = NULL; 228 mc_lst->sflist = NULL;
228 229
229 /* 230 /*
@@ -360,6 +361,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
360 struct ip6_sf_socklist *psl; 361 struct ip6_sf_socklist *psl;
361 int i, j, rv; 362 int i, j, rv;
362 int leavegroup = 0; 363 int leavegroup = 0;
364 int pmclocked = 0;
363 int err; 365 int err;
364 366
365 if (pgsr->gsr_group.ss_family != AF_INET6 || 367 if (pgsr->gsr_group.ss_family != AF_INET6 ||
@@ -403,6 +405,9 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
403 pmc->sfmode = omode; 405 pmc->sfmode = omode;
404 } 406 }
405 407
408 write_lock_bh(&pmc->sflock);
409 pmclocked = 1;
410
406 psl = pmc->sflist; 411 psl = pmc->sflist;
407 if (!add) { 412 if (!add) {
408 if (!psl) 413 if (!psl)
@@ -475,6 +480,8 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
475 /* update the interface list */ 480 /* update the interface list */
476 ip6_mc_add_src(idev, group, omode, 1, source, 1); 481 ip6_mc_add_src(idev, group, omode, 1, source, 1);
477done: 482done:
483 if (pmclocked)
484 write_unlock_bh(&pmc->sflock);
478 read_unlock_bh(&ipv6_sk_mc_lock); 485 read_unlock_bh(&ipv6_sk_mc_lock);
479 read_unlock_bh(&idev->lock); 486 read_unlock_bh(&idev->lock);
480 in6_dev_put(idev); 487 in6_dev_put(idev);
@@ -510,6 +517,8 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf)
510 dev = idev->dev; 517 dev = idev->dev;
511 518
512 err = 0; 519 err = 0;
520 read_lock_bh(&ipv6_sk_mc_lock);
521
513 if (gsf->gf_fmode == MCAST_INCLUDE && gsf->gf_numsrc == 0) { 522 if (gsf->gf_fmode == MCAST_INCLUDE && gsf->gf_numsrc == 0) {
514 leavegroup = 1; 523 leavegroup = 1;
515 goto done; 524 goto done;
@@ -549,6 +558,8 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf)
549 newpsl = NULL; 558 newpsl = NULL;
550 (void) ip6_mc_add_src(idev, group, gsf->gf_fmode, 0, NULL, 0); 559 (void) ip6_mc_add_src(idev, group, gsf->gf_fmode, 0, NULL, 0);
551 } 560 }
561
562 write_lock_bh(&pmc->sflock);
552 psl = pmc->sflist; 563 psl = pmc->sflist;
553 if (psl) { 564 if (psl) {
554 (void) ip6_mc_del_src(idev, group, pmc->sfmode, 565 (void) ip6_mc_del_src(idev, group, pmc->sfmode,
@@ -558,8 +569,10 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf)
558 (void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0); 569 (void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0);
559 pmc->sflist = newpsl; 570 pmc->sflist = newpsl;
560 pmc->sfmode = gsf->gf_fmode; 571 pmc->sfmode = gsf->gf_fmode;
572 write_unlock_bh(&pmc->sflock);
561 err = 0; 573 err = 0;
562done: 574done:
575 read_unlock_bh(&ipv6_sk_mc_lock);
563 read_unlock_bh(&idev->lock); 576 read_unlock_bh(&idev->lock);
564 in6_dev_put(idev); 577 in6_dev_put(idev);
565 dev_put(dev); 578 dev_put(dev);
@@ -592,6 +605,11 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
592 dev = idev->dev; 605 dev = idev->dev;
593 606
594 err = -EADDRNOTAVAIL; 607 err = -EADDRNOTAVAIL;
608 /*
609 * changes to the ipv6_mc_list require the socket lock and
610 * a read lock on ip6_sk_mc_lock. We have the socket lock,
611 * so reading the list is safe.
612 */
595 613
596 for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) { 614 for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) {
597 if (pmc->ifindex != gsf->gf_interface) 615 if (pmc->ifindex != gsf->gf_interface)
@@ -614,6 +632,10 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
614 copy_to_user(optval, gsf, GROUP_FILTER_SIZE(0))) { 632 copy_to_user(optval, gsf, GROUP_FILTER_SIZE(0))) {
615 return -EFAULT; 633 return -EFAULT;
616 } 634 }
635 /* changes to psl require the socket lock, a read lock on
636 * on ipv6_sk_mc_lock and a write lock on pmc->sflock. We
637 * have the socket lock, so reading here is safe.
638 */
617 for (i=0; i<copycount; i++) { 639 for (i=0; i<copycount; i++) {
618 struct sockaddr_in6 *psin6; 640 struct sockaddr_in6 *psin6;
619 struct sockaddr_storage ss; 641 struct sockaddr_storage ss;
@@ -650,6 +672,7 @@ int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr,
650 read_unlock(&ipv6_sk_mc_lock); 672 read_unlock(&ipv6_sk_mc_lock);
651 return 1; 673 return 1;
652 } 674 }
675 read_lock(&mc->sflock);
653 psl = mc->sflist; 676 psl = mc->sflist;
654 if (!psl) { 677 if (!psl) {
655 rv = mc->sfmode == MCAST_EXCLUDE; 678 rv = mc->sfmode == MCAST_EXCLUDE;
@@ -665,6 +688,7 @@ int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr,
665 if (mc->sfmode == MCAST_EXCLUDE && i < psl->sl_count) 688 if (mc->sfmode == MCAST_EXCLUDE && i < psl->sl_count)
666 rv = 0; 689 rv = 0;
667 } 690 }
691 read_unlock(&mc->sflock);
668 read_unlock(&ipv6_sk_mc_lock); 692 read_unlock(&ipv6_sk_mc_lock);
669 693
670 return rv; 694 return rv;
@@ -1068,7 +1092,8 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime)
1068 ma->mca_flags |= MAF_TIMER_RUNNING; 1092 ma->mca_flags |= MAF_TIMER_RUNNING;
1069} 1093}
1070 1094
1071static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs, 1095/* mark EXCLUDE-mode sources */
1096static int mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs,
1072 struct in6_addr *srcs) 1097 struct in6_addr *srcs)
1073{ 1098{
1074 struct ip6_sf_list *psf; 1099 struct ip6_sf_list *psf;
@@ -1078,13 +1103,53 @@ static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
1078 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 1103 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
1079 if (scount == nsrcs) 1104 if (scount == nsrcs)
1080 break; 1105 break;
1081 for (i=0; i<nsrcs; i++) 1106 for (i=0; i<nsrcs; i++) {
1107 /* skip inactive filters */
1108 if (pmc->mca_sfcount[MCAST_INCLUDE] ||
1109 pmc->mca_sfcount[MCAST_EXCLUDE] !=
1110 psf->sf_count[MCAST_EXCLUDE])
1111 continue;
1112 if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) {
1113 scount++;
1114 break;
1115 }
1116 }
1117 }
1118 pmc->mca_flags &= ~MAF_GSQUERY;
1119 if (scount == nsrcs) /* all sources excluded */
1120 return 0;
1121 return 1;
1122}
1123
1124static int mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
1125 struct in6_addr *srcs)
1126{
1127 struct ip6_sf_list *psf;
1128 int i, scount;
1129
1130 if (pmc->mca_sfmode == MCAST_EXCLUDE)
1131 return mld_xmarksources(pmc, nsrcs, srcs);
1132
1133 /* mark INCLUDE-mode sources */
1134
1135 scount = 0;
1136 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
1137 if (scount == nsrcs)
1138 break;
1139 for (i=0; i<nsrcs; i++) {
1082 if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) { 1140 if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) {
1083 psf->sf_gsresp = 1; 1141 psf->sf_gsresp = 1;
1084 scount++; 1142 scount++;
1085 break; 1143 break;
1086 } 1144 }
1145 }
1146 }
1147 if (!scount) {
1148 pmc->mca_flags &= ~MAF_GSQUERY;
1149 return 0;
1087 } 1150 }
1151 pmc->mca_flags |= MAF_GSQUERY;
1152 return 1;
1088} 1153}
1089 1154
1090int igmp6_event_query(struct sk_buff *skb) 1155int igmp6_event_query(struct sk_buff *skb)
@@ -1167,7 +1232,7 @@ int igmp6_event_query(struct sk_buff *skb)
1167 /* mark sources to include, if group & source-specific */ 1232 /* mark sources to include, if group & source-specific */
1168 if (mlh2->nsrcs != 0) { 1233 if (mlh2->nsrcs != 0) {
1169 if (!pskb_may_pull(skb, srcs_offset + 1234 if (!pskb_may_pull(skb, srcs_offset +
1170 mlh2->nsrcs * sizeof(struct in6_addr))) { 1235 ntohs(mlh2->nsrcs) * sizeof(struct in6_addr))) {
1171 in6_dev_put(idev); 1236 in6_dev_put(idev);
1172 return -EINVAL; 1237 return -EINVAL;
1173 } 1238 }
@@ -1203,10 +1268,9 @@ int igmp6_event_query(struct sk_buff *skb)
1203 else 1268 else
1204 ma->mca_flags &= ~MAF_GSQUERY; 1269 ma->mca_flags &= ~MAF_GSQUERY;
1205 } 1270 }
1206 if (ma->mca_flags & MAF_GSQUERY) 1271 if (!(ma->mca_flags & MAF_GSQUERY) ||
1207 mld_marksources(ma, ntohs(mlh2->nsrcs), 1272 mld_marksources(ma, ntohs(mlh2->nsrcs), mlh2->srcs))
1208 mlh2->srcs); 1273 igmp6_group_queried(ma, max_delay);
1209 igmp6_group_queried(ma, max_delay);
1210 spin_unlock_bh(&ma->mca_lock); 1274 spin_unlock_bh(&ma->mca_lock);
1211 if (group_type != IPV6_ADDR_ANY) 1275 if (group_type != IPV6_ADDR_ANY)
1212 break; 1276 break;
@@ -1281,7 +1345,18 @@ static int is_in(struct ifmcaddr6 *pmc, struct ip6_sf_list *psf, int type,
1281 case MLD2_MODE_IS_EXCLUDE: 1345 case MLD2_MODE_IS_EXCLUDE:
1282 if (gdeleted || sdeleted) 1346 if (gdeleted || sdeleted)
1283 return 0; 1347 return 0;
1284 return !((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp); 1348 if (!((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp)) {
1349 if (pmc->mca_sfmode == MCAST_INCLUDE)
1350 return 1;
1351 /* don't include if this source is excluded
1352 * in all filters
1353 */
1354 if (psf->sf_count[MCAST_INCLUDE])
1355 return 0;
1356 return pmc->mca_sfcount[MCAST_EXCLUDE] ==
1357 psf->sf_count[MCAST_EXCLUDE];
1358 }
1359 return 0;
1285 case MLD2_CHANGE_TO_INCLUDE: 1360 case MLD2_CHANGE_TO_INCLUDE:
1286 if (gdeleted || sdeleted) 1361 if (gdeleted || sdeleted)
1287 return 0; 1362 return 0;
@@ -1450,7 +1525,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
1450 struct mld2_report *pmr; 1525 struct mld2_report *pmr;
1451 struct mld2_grec *pgr = NULL; 1526 struct mld2_grec *pgr = NULL;
1452 struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list; 1527 struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list;
1453 int scount, first, isquery, truncate; 1528 int scount, stotal, first, isquery, truncate;
1454 1529
1455 if (pmc->mca_flags & MAF_NOREPORT) 1530 if (pmc->mca_flags & MAF_NOREPORT)
1456 return skb; 1531 return skb;
@@ -1460,25 +1535,13 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
1460 truncate = type == MLD2_MODE_IS_EXCLUDE || 1535 truncate = type == MLD2_MODE_IS_EXCLUDE ||
1461 type == MLD2_CHANGE_TO_EXCLUDE; 1536 type == MLD2_CHANGE_TO_EXCLUDE;
1462 1537
1538 stotal = scount = 0;
1539
1463 psf_list = sdeleted ? &pmc->mca_tomb : &pmc->mca_sources; 1540 psf_list = sdeleted ? &pmc->mca_tomb : &pmc->mca_sources;
1464 1541
1465 if (!*psf_list) { 1542 if (!*psf_list)
1466 if (type == MLD2_ALLOW_NEW_SOURCES || 1543 goto empty_source;
1467 type == MLD2_BLOCK_OLD_SOURCES) 1544
1468 return skb;
1469 if (pmc->mca_crcount || isquery) {
1470 /* make sure we have room for group header and at
1471 * least one source.
1472 */
1473 if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)+
1474 sizeof(struct in6_addr)) {
1475 mld_sendpack(skb);
1476 skb = NULL; /* add_grhead will get a new one */
1477 }
1478 skb = add_grhead(skb, pmc, type, &pgr);
1479 }
1480 return skb;
1481 }
1482 pmr = skb ? (struct mld2_report *)skb->h.raw : NULL; 1545 pmr = skb ? (struct mld2_report *)skb->h.raw : NULL;
1483 1546
1484 /* EX and TO_EX get a fresh packet, if needed */ 1547 /* EX and TO_EX get a fresh packet, if needed */
@@ -1491,7 +1554,6 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
1491 } 1554 }
1492 } 1555 }
1493 first = 1; 1556 first = 1;
1494 scount = 0;
1495 psf_prev = NULL; 1557 psf_prev = NULL;
1496 for (psf=*psf_list; psf; psf=psf_next) { 1558 for (psf=*psf_list; psf; psf=psf_next) {
1497 struct in6_addr *psrc; 1559 struct in6_addr *psrc;
@@ -1525,7 +1587,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
1525 } 1587 }
1526 psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc)); 1588 psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc));
1527 *psrc = psf->sf_addr; 1589 *psrc = psf->sf_addr;
1528 scount++; 1590 scount++; stotal++;
1529 if ((type == MLD2_ALLOW_NEW_SOURCES || 1591 if ((type == MLD2_ALLOW_NEW_SOURCES ||
1530 type == MLD2_BLOCK_OLD_SOURCES) && psf->sf_crcount) { 1592 type == MLD2_BLOCK_OLD_SOURCES) && psf->sf_crcount) {
1531 psf->sf_crcount--; 1593 psf->sf_crcount--;
@@ -1540,6 +1602,21 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
1540 } 1602 }
1541 psf_prev = psf; 1603 psf_prev = psf;
1542 } 1604 }
1605
1606empty_source:
1607 if (!stotal) {
1608 if (type == MLD2_ALLOW_NEW_SOURCES ||
1609 type == MLD2_BLOCK_OLD_SOURCES)
1610 return skb;
1611 if (pmc->mca_crcount || isquery) {
1612 /* make sure we have room for group header */
1613 if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)) {
1614 mld_sendpack(skb);
1615 skb = NULL; /* add_grhead will get a new one */
1616 }
1617 skb = add_grhead(skb, pmc, type, &pgr);
1618 }
1619 }
1543 if (pgr) 1620 if (pgr)
1544 pgr->grec_nsrcs = htons(scount); 1621 pgr->grec_nsrcs = htons(scount);
1545 1622
@@ -1621,11 +1698,11 @@ static void mld_send_cr(struct inet6_dev *idev)
1621 skb = add_grec(skb, pmc, dtype, 1, 1); 1698 skb = add_grec(skb, pmc, dtype, 1, 1);
1622 } 1699 }
1623 if (pmc->mca_crcount) { 1700 if (pmc->mca_crcount) {
1624 pmc->mca_crcount--;
1625 if (pmc->mca_sfmode == MCAST_EXCLUDE) { 1701 if (pmc->mca_sfmode == MCAST_EXCLUDE) {
1626 type = MLD2_CHANGE_TO_INCLUDE; 1702 type = MLD2_CHANGE_TO_INCLUDE;
1627 skb = add_grec(skb, pmc, type, 1, 0); 1703 skb = add_grec(skb, pmc, type, 1, 0);
1628 } 1704 }
1705 pmc->mca_crcount--;
1629 if (pmc->mca_crcount == 0) { 1706 if (pmc->mca_crcount == 0) {
1630 mld_clear_zeros(&pmc->mca_tomb); 1707 mld_clear_zeros(&pmc->mca_tomb);
1631 mld_clear_zeros(&pmc->mca_sources); 1708 mld_clear_zeros(&pmc->mca_sources);
@@ -1659,12 +1736,12 @@ static void mld_send_cr(struct inet6_dev *idev)
1659 1736
1660 /* filter mode changes */ 1737 /* filter mode changes */
1661 if (pmc->mca_crcount) { 1738 if (pmc->mca_crcount) {
1662 pmc->mca_crcount--;
1663 if (pmc->mca_sfmode == MCAST_EXCLUDE) 1739 if (pmc->mca_sfmode == MCAST_EXCLUDE)
1664 type = MLD2_CHANGE_TO_EXCLUDE; 1740 type = MLD2_CHANGE_TO_EXCLUDE;
1665 else 1741 else
1666 type = MLD2_CHANGE_TO_INCLUDE; 1742 type = MLD2_CHANGE_TO_INCLUDE;
1667 skb = add_grec(skb, pmc, type, 0, 0); 1743 skb = add_grec(skb, pmc, type, 0, 0);
1744 pmc->mca_crcount--;
1668 } 1745 }
1669 spin_unlock_bh(&pmc->mca_lock); 1746 spin_unlock_bh(&pmc->mca_lock);
1670 } 1747 }
@@ -2023,6 +2100,9 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
2023{ 2100{
2024 int err; 2101 int err;
2025 2102
2103 /* callers have the socket lock and a write lock on ipv6_sk_mc_lock,
2104 * so no other readers or writers of iml or its sflist
2105 */
2026 if (iml->sflist == 0) { 2106 if (iml->sflist == 0) {
2027 /* any-source empty exclude case */ 2107 /* any-source empty exclude case */
2028 return ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, NULL, 0); 2108 return ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, NULL, 0);