diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt index e0188a23fd5e7183768362da2ae4c5c72eebd059..61613166981b9139a5961fe0c3344cbd03286688 100644 --- a/Documentation/sysrq.txt +++ b/Documentation/sysrq.txt @@ -1,6 +1,6 @@ Linux Magic System Request Key Hacks -Documentation for sysrq.c version 1.15 -Last update: $Date: 2001/01/28 10:15:59 $ +Documentation for sysrq.c +Last update: 2007-JAN-06 * What is the magic SysRq key? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -35,7 +35,7 @@ You can set the value in the file by the following command: Note that the value of /proc/sys/kernel/sysrq influences only the invocation via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always -allowed. +allowed (by a user with admin privileges). * How do I use the magic SysRq key? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -58,7 +58,7 @@ On PowerPC - Press 'ALT - Print Screen (or F13) - , On other - If you know of the key combos for other architectures, please let me know so I can add them to this section. -On all - write a character to /proc/sysrq-trigger. eg: +On all - write a character to /proc/sysrq-trigger. e.g.: echo t > /proc/sysrq-trigger @@ -74,6 +74,8 @@ On all - write a character to /proc/sysrq-trigger. eg: 'c' - Will perform a kexec reboot in order to take a crashdump. +'d' - Shows all locks that are held. + 'o' - Will shut your system off (if configured and supported). 's' - Will attempt to sync all mounted filesystems. @@ -87,38 +89,43 @@ On all - write a character to /proc/sysrq-trigger. eg: 'm' - Will dump current memory info to your console. +'n' - Used to make RT tasks nice-able + 'v' - Dumps Voyager SMP processor info to your console. +'w' - Dumps tasks that are in uninterruptable (blocked) state. + +'x' - Used by xmon interface on ppc/powerpc platforms. + '0'-'9' - Sets the console log level, controlling which kernel messages will be printed to your console. ('0', for example would make it so that only emergency messages like PANICs or OOPSes would make it to your console.) -'f' - Will call oom_kill to kill a memory hog process +'f' - Will call oom_kill to kill a memory hog process. 'e' - Send a SIGTERM to all processes, except for init. -'i' - Send a SIGKILL to all processes, except for init. +'g' - Used by kgdb on ppc platforms. -'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system - will be non-functional after this.) +'i' - Send a SIGKILL to all processes, except for init. -'h' - Will display help ( actually any other key than those listed +'h' - Will display help (actually any other key than those listed above will display help. but 'h' is easy to remember :-) * Okay, so what can I use them for? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Well, un'R'aw is very handy when your X server or a svgalib program crashes. -sa'K' (Secure Access Key) is useful when you want to be sure there are no -trojan program is running at console and which could grab your password -when you would try to login. It will kill all programs on given console -and thus letting you make sure that the login prompt you see is actually +sa'K' (Secure Access Key) is useful when you want to be sure there is no +trojan program running at console which could grab your password +when you would try to login. It will kill all programs on given console, +thus letting you make sure that the login prompt you see is actually the one from init, not some trojan program. IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT IMPORTANT: c2 compliant system, and it should not be mistaken as :IMPORTANT IMPORTANT: such. :IMPORTANT - It seems other find it useful as (System Attention Key) which is + It seems others find it useful as (System Attention Key) which is useful when you want to exit a program that will not let you switch consoles. (For example, X or a svgalib program.) @@ -139,8 +146,8 @@ OK or Done message...) Again, the unmount (remount read-only) hasn't taken place until you see the "OK" and "Done" message appear on the screen. -The loglevel'0'-'9' is useful when your console is being flooded with -kernel messages you do not want to see. Setting '0' will prevent all but +The loglevels '0'-'9' are useful when your console is being flooded with +kernel messages you do not want to see. Selecting '0' will prevent all but the most urgent kernel messages from reaching your console. (They will still be logged if syslogd/klogd are alive, though.) @@ -152,7 +159,7 @@ processes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ That happens to me, also. I've found that tapping shift, alt, and control on both sides of the keyboard, and hitting an invalid sysrq sequence again -will fix the problem. (ie, something like alt-sysrq-z). Switching to another +will fix the problem. (i.e., something like alt-sysrq-z). Switching to another virtual console (ALT+Fn) and then back again should also help. * I hit SysRq, but nothing seems to happen, what's wrong? @@ -174,11 +181,11 @@ handler function you will use, B) a help_msg string, that will print when SysRQ prints help, and C) an action_msg string, that will print right before your handler is called. Your handler must conform to the prototype in 'sysrq.h'. -After the sysrq_key_op is created, you can call the macro -register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in -sysrq.h, this will register the operation pointed to by 'op_p' at table -key 'key', if that slot in the table is blank. At module unload time, you must -call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which +After the sysrq_key_op is created, you can call the kernel function +register_sysrq_key(int key, struct sysrq_key_op *op_p); this will +register the operation pointed to by 'op_p' at table key 'key', +if that slot in the table is blank. At module unload time, you must call +the function unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which will remove the key op pointed to by 'op_p' from the key 'key', if and only if it is currently registered in that slot. This is in case the slot has been overwritten since you registered it. @@ -186,15 +193,12 @@ overwritten since you registered it. The Magic SysRQ system works by registering key operations against a key op lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has a number of operations registered into it at compile time, but is mutable, -and 4 functions are exported for interface to it: __sysrq_lock_table, -__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The -functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined -in the header itself, and the REGISTER and UNREGISTER macros are built from -these. More complex (and dangerous!) manipulations of the table are possible -using these functions, but you must be careful to always lock the table before -you read or write from it, and to unlock it again when you are done. (And of -course, to never ever leave an invalid pointer in the table). Null pointers in -the table are always safe :) +and 2 functions are exported for interface to it: + register_sysrq_key and unregister_sysrq_key. +Of course, never ever leave an invalid pointer in the table. I.e., when +your module that called register_sysrq_key() exits, it must call +unregister_sysrq_key() to clean up the sysrq key table entry that it used. +Null pointers in the table are always safe. :) If for some reason you feel the need to call the handle_sysrq function from within a function called by handle_sysrq, you must be aware that you are in diff --git a/MAINTAINERS b/MAINTAINERS index 1446cc41c12f5ffd6c1116dd48ba144171a42052..465e083237a784fa2dd1ec786065b7d0fe8ebec5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -598,8 +598,6 @@ W: http://linux-atm.sourceforge.net S: Maintained ATMEL MACB ETHERNET DRIVER -P: Atmel AVR32 Support Team -M: avr32@atmel.com P: Haavard Skinnemoen M: hskinnemoen@atmel.com S: Supported @@ -620,8 +618,6 @@ T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git S: Maintained AVR32 ARCHITECTURE -P: Atmel AVR32 Support Team -M: avr32@atmel.com P: Haavard Skinnemoen M: hskinnemoen@atmel.com W: http://www.atmel.com/products/AVR32/ @@ -630,8 +626,6 @@ W: http://avrfreaks.net/ S: Supported AVR32/AT32AP MACHINE SUPPORT -P: Atmel AVR32 Support Team -M: avr32@atmel.com P: Haavard Skinnemoen M: hskinnemoen@atmel.com S: Supported @@ -2288,7 +2282,7 @@ P: Jozsef Kadlecsik P: Patrick McHardy M: kaber@trash.net L: netfilter-devel@lists.netfilter.org -L: netfilter@lists.netfilter.org +L: netfilter@lists.netfilter.org (subscribers-only) L: coreteam@netfilter.org W: http://www.netfilter.org/ W: http://www.iptables.org/ diff --git a/arch/i386/boot/compressed/relocs.c b/arch/i386/boot/compressed/relocs.c index 468da89153c470ee2311a30ac445cabd2301755b..881951ca03e1cc53be63665b5c717e04adf1d47a 100644 --- a/arch/i386/boot/compressed/relocs.c +++ b/arch/i386/boot/compressed/relocs.c @@ -43,6 +43,8 @@ static int is_safe_abs_reloc(const char* sym_name) /* Match found */ return 1; } + if (strncmp(sym_name, "__crc_", 6) == 0) + return 1; return 0; } diff --git a/arch/i386/mach-default/setup.c b/arch/i386/mach-default/setup.c index c511705c386cc6b251b6c3707864b356155a04bd..cc2f519b2f7f6c41a5b6ff5fdbe082fa730b5734 100644 --- a/arch/i386/mach-default/setup.c +++ b/arch/i386/mach-default/setup.c @@ -102,7 +102,7 @@ void __init time_init_hook(void) * along the MCA bus. Use this to hook into that chain if you will need * it. **/ -void __init mca_nmi_hook(void) +void mca_nmi_hook(void) { /* If I recall correctly, there's a whole bunch of other things that * we can do to check for NMI problems, but that's all I know about diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c index 276f22881d0fd764cd3922037eed8f962138d646..6b5f26b0fb75c5e716574a70122a79b675b62708 100644 --- a/arch/sparc/kernel/smp.c +++ b/arch/sparc/kernel/smp.c @@ -292,8 +292,8 @@ int setup_profiling_timer(unsigned int multiplier) void __init smp_prepare_cpus(unsigned int max_cpus) { - extern void smp4m_boot_cpus(void); - extern void smp4d_boot_cpus(void); + extern void __init smp4m_boot_cpus(void); + extern void __init smp4d_boot_cpus(void); int i, cpuid, extra; printk("Entering SMP Mode...\n"); @@ -375,8 +375,8 @@ void __init smp_prepare_boot_cpu(void) int __cpuinit __cpu_up(unsigned int cpu) { - extern int smp4m_boot_one_cpu(int); - extern int smp4d_boot_one_cpu(int); + extern int __cpuinit smp4m_boot_one_cpu(int); + extern int __cpuinit smp4d_boot_one_cpu(int); int ret=0; switch(sparc_cpu_model) { diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index c80ea61e8ba0e84d8ca1c00fc9df0668477759d2..c69de5d4863d69cff95df5cc1a16d21441dc83a0 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c @@ -164,7 +164,7 @@ void __init smp4d_boot_cpus(void) local_flush_cache_all(); } -int smp4d_boot_one_cpu(int i) +int __cpuinit smp4d_boot_one_cpu(int i) { extern unsigned long sun4d_cpu_startup; unsigned long *entry = &sun4d_cpu_startup; diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 13935235e0661b1b82eb6be10e298b8c5a63b0f2..7fd3cd5ddf2190269e206383ece44c481a889f78 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c @@ -215,7 +215,7 @@ static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty) } static struct sysrq_key_op sysrq_showstate_blocked_op = { .handler = sysrq_handle_showstate_blocked, - .help_msg = "showBlockedTasks", + .help_msg = "shoW-blocked-tasks", .action_msg = "Show Blocked State", .enable_mask = SYSRQ_ENABLE_DUMP, }; @@ -315,15 +315,16 @@ static struct sysrq_key_op *sysrq_key_table[36] = { &sysrq_loglevel_op, /* 9 */ /* - * Don't use for system provided sysrqs, it is handled specially on - * sparc and will never arrive + * a: Don't use for system provided sysrqs, it is handled specially on + * sparc and will never arrive. */ NULL, /* a */ &sysrq_reboot_op, /* b */ - &sysrq_crashdump_op, /* c */ + &sysrq_crashdump_op, /* c & ibm_emac driver debug */ &sysrq_showlocks_op, /* d */ &sysrq_term_op, /* e */ &sysrq_moom_op, /* f */ + /* g: May be registered by ppc for kgdb */ NULL, /* g */ NULL, /* h */ &sysrq_kill_op, /* i */ @@ -332,18 +333,19 @@ static struct sysrq_key_op *sysrq_key_table[36] = { NULL, /* l */ &sysrq_showmem_op, /* m */ &sysrq_unrt_op, /* n */ - /* This will often be registered as 'Off' at init time */ + /* o: This will often be registered as 'Off' at init time */ NULL, /* o */ &sysrq_showregs_op, /* p */ NULL, /* q */ - &sysrq_unraw_op, /* r */ + &sysrq_unraw_op, /* r */ &sysrq_sync_op, /* s */ &sysrq_showstate_op, /* t */ &sysrq_mountro_op, /* u */ - /* May be assigned at init time by SMP VOYAGER */ + /* v: May be registered at init time by SMP VOYAGER */ NULL, /* v */ - NULL, /* w */ - &sysrq_showstate_blocked_op, /* x */ + &sysrq_showstate_blocked_op, /* w */ + /* x: May be registered on ppc/powerpc for xmon */ + NULL, /* x */ NULL, /* y */ NULL /* z */ }; diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 3b334af0c7b98d1cb39ae07ec5e714998f385102..6c9bd5165bdb53911792b08e4624d7aa94c5b93a 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -1781,9 +1781,9 @@ static int __init ide_setup(char *s) return 1; } -extern void pnpide_init(void); -extern void pnpide_exit(void); -extern void h8300_ide_init(void); +extern void __init pnpide_init(void); +extern void __exit pnpide_exit(void); +extern void __init h8300_ide_init(void); /* * probe_for_hwifs() finds/initializes "known" IDE interfaces @@ -2088,7 +2088,7 @@ int __init init_module (void) return ide_init(); } -void cleanup_module (void) +void __exit cleanup_module (void) { int index; diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index a98b4d38b9dd7678741262d8809236642d704c0a..6fb6e50b82312131b1b3ac45f29f927c0f6a7e07 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c @@ -78,7 +78,7 @@ static struct via_isa_bridge { u8 rev_max; u16 flags; } via_isa_bridges[] = { - { "cx7000", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, + { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 27f2751c3baa66e404631f37c5ddb7ed15ebc23f..54c35c0b31815670dd56cbc54b18826e1ea6f80d 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -1116,6 +1116,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu) if (rdmsr_safe(index, &data_low, &data_high) < 0) continue; + if (wrmsr_safe(index, data_low, data_high) < 0) + continue; data = data_low | ((u64)data_high << 32); vcpu->host_msrs[j].index = index; vcpu->host_msrs[j].reserved = 0; diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig index 896aa02000d73079fc1ebda3b222c90cdfe3531e..feb0ada7a0257157cc1240e08767c6bcad6f51a1 100644 --- a/drivers/net/hamradio/Kconfig +++ b/drivers/net/hamradio/Kconfig @@ -113,7 +113,7 @@ config SCC_TRXECHO config BAYCOM_SER_FDX tristate "BAYCOM ser12 fullduplex driver for AX.25" - depends on AX25 + depends on AX25 && !S390 select CRC_CCITT ---help--- This is one of two drivers for Baycom style simple amateur radio @@ -133,7 +133,7 @@ config BAYCOM_SER_FDX config BAYCOM_SER_HDX tristate "BAYCOM ser12 halfduplex driver for AX.25" - depends on AX25 + depends on AX25 && !S390 select CRC_CCITT ---help--- This is one of two drivers for Baycom style simple amateur radio @@ -181,7 +181,7 @@ config BAYCOM_EPP config YAM tristate "YAM driver for AX.25" - depends on AX25 + depends on AX25 && !S390 help The YAM is a modem for packet radio which connects to the serial port and includes some of the functions of a Terminal Node diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 16945c2ba2ca36e13a84f1d1653c879c94b15c24..dcc0c1ab95ed8de5723b1fbab68f4224c33aa719 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -661,9 +661,11 @@ static void quirk_via_bridge(struct pci_dev *dev) /* See what bridge we have and find the device ranges */ switch (dev->device) { case PCI_DEVICE_ID_VIA_82C686: - /* 82C686 is special */ - via_vlink_dev_lo = 7; - via_vlink_dev_hi = 7; + /* The VT82C686 is special, it attaches to PCI and can have + any device number. All its subdevices are functions of + that single device. */ + via_vlink_dev_lo = PCI_SLOT(dev->devfn); + via_vlink_dev_hi = PCI_SLOT(dev->devfn); break; case PCI_DEVICE_ID_VIA_8237: case PCI_DEVICE_ID_VIA_8237A: diff --git a/drivers/pci/search.c b/drivers/pci/search.c index fab381ed853c9d20726671b99ec1199392e50ce7..b2653c4afe9e69212f8923df0574561cc049eaef 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c @@ -200,11 +200,8 @@ static struct pci_dev * pci_find_subsys(unsigned int vendor, * can cause some machines to crash. So here we detect and flag that * situation and bail out early. */ - if (unlikely(list_empty(&pci_devices))) { - printk(KERN_INFO "pci_find_subsys() called while pci_devices " - "is still empty\n"); + if (unlikely(list_empty(&pci_devices))) return NULL; - } down_read(&pci_bus_sem); n = from ? from->global_list.next : pci_devices.next; @@ -278,11 +275,8 @@ pci_get_subsys(unsigned int vendor, unsigned int device, * can cause some machines to crash. So here we detect and flag that * situation and bail out early. */ - if (unlikely(list_empty(&pci_devices))) { - printk(KERN_NOTICE "pci_get_subsys() called while pci_devices " - "is still empty\n"); + if (unlikely(list_empty(&pci_devices))) return NULL; - } down_read(&pci_bus_sem); n = from ? from->global_list.next : pci_devices.next; diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 98338a569dc0b496434efcddc9a50f99afd7e8ae..c59d6fbb7a6bedb71446f33808bcb90ebf667670 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -269,7 +269,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) "acc=%x, error=%d\n", dentry->d_parent->d_name.name, dentry->d_name.name, - access, (error >> 24)); + access, ntohl(error)); } out: if (exp && !IS_ERR(exp)) diff --git a/fs/proc/base.c b/fs/proc/base.c index ff7a66850602cb4fced3a5250d74bd43d42d4d8b..1a979ea3b379931973f79c4b70703df3f237c714 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2328,13 +2328,23 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi { struct dentry *dentry = filp->f_path.dentry; struct inode *inode = dentry->d_inode; - struct task_struct *leader = get_proc_task(inode); + struct task_struct *leader = NULL; struct task_struct *task; int retval = -ENOENT; ino_t ino; int tid; unsigned long pos = filp->f_pos; /* avoiding "long long" filp->f_pos */ + task = get_proc_task(inode); + if (!task) + goto out_no_task; + rcu_read_lock(); + if (pid_alive(task)) { + leader = task->group_leader; + get_task_struct(leader); + } + rcu_read_unlock(); + put_task_struct(task); if (!leader) goto out_no_task; retval = 0; diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild index c68e1680da0173d5754d1a1df4944120a5239e58..966a9836d556a520afebaea42a613849a6d46e01 100644 --- a/include/asm-frv/Kbuild +++ b/include/asm-frv/Kbuild @@ -1 +1,7 @@ include include/asm-generic/Kbuild.asm + +header-y += registers.h + +unifdef-y += termios.h +unifdef-y += ptrace.h +unifdef-y += page.h diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h index 134cc0cdf6c2727201a3f5d243d1f2761d18f342..213d92fd652aa24175ddd673c52cabb932d876be 100644 --- a/include/asm-frv/page.h +++ b/include/asm-frv/page.h @@ -76,8 +76,6 @@ extern unsigned long max_pfn; #endif /* __ASSEMBLY__ */ -#endif /* __KERNEL__ */ - #ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC #define WANT_PAGE_VIRTUAL 1 #endif @@ -85,4 +83,6 @@ extern unsigned long max_pfn; #include #include +#endif /* __KERNEL__ */ + #endif /* _ASM_PAGE_H */ diff --git a/include/asm-frv/ptrace.h b/include/asm-frv/ptrace.h index 9a2241b8eb1e03647f3c5cadefea0cf3a6da5a2e..cf6934012b64dc70736e26073470e143b2ed11ab 100644 --- a/include/asm-frv/ptrace.h +++ b/include/asm-frv/ptrace.h @@ -12,9 +12,11 @@ #define _ASM_PTRACE_H #include +#ifdef __KERNEL__ #include #define in_syscall(regs) (((regs)->tbr & TBR_TT) == TBR_TT_TRAP0) +#endif #define PT_PSR 0 @@ -60,6 +62,7 @@ #define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */ #define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */ +#ifdef __KERNEL__ #ifndef __ASSEMBLY__ /* @@ -74,6 +77,7 @@ register struct pt_regs *__frame asm("gr28"); extern unsigned long user_stack(const struct pt_regs *); extern void show_regs(struct pt_regs *); #define profile_pc(regs) ((regs)->pc) +#endif #endif /* !__ASSEMBLY__ */ #endif /* _ASM_PTRACE_H */ diff --git a/include/asm-frv/termios.h b/include/asm-frv/termios.h index b4a664e7f55c514ed9971fed4c0ff470dff8e2ac..8840cf95e8ddc175c0795bf74579b938caea8d38 100644 --- a/include/asm-frv/termios.h +++ b/include/asm-frv/termios.h @@ -69,6 +69,8 @@ struct termio { #define N_SYNC_PPP 14 #define N_HCI 15 /* Bluetooth HCI UART */ +#ifdef __KERNEL__ #include +#endif #endif /* _ASM_TERMIOS_H */ diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index 188f726217766f8e45bc7dce5a130e509d9b2f68..e57ff136ee510e884ea4474a7e2f21bde36b2390 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h @@ -408,6 +408,15 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) #include +#ifdef CONFIG_HIGHMEM +/* Clear a kernel PTE and flush it from the TLB */ +#define kpte_clear_flush(ptep, vaddr) \ +do { \ + pte_clear(&init_mm, vaddr, ptep); \ + __flush_tlb_one(vaddr); \ +} while (0) +#endif + #endif #endif diff --git a/include/linux/efi.h b/include/linux/efi.h index df1c91855f0efa1336181a4552e9b6fa7cfb725e..f8ebd7c1ddb3f40019fd2c14902c58ff14de23e3 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -301,7 +301,7 @@ extern int __init efi_uart_console_only (void); extern void efi_initialize_iomem_resources(struct resource *code_resource, struct resource *data_resource); extern unsigned long efi_get_time(void); -extern int __init efi_set_rtc_mmss(unsigned long nowtime); +extern int efi_set_rtc_mmss(unsigned long nowtime); extern int is_available_memory(efi_memory_desc_t * md); extern struct efi_memory_map memmap; diff --git a/kernel/fork.c b/kernel/fork.c index fc723e595cd5ba2c95499ba058636005dd9946e3..d57118da73ff04cfecc4b09b689c7bf74191dcc6 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1313,7 +1313,7 @@ noinline struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_re return regs; } -struct task_struct * __devinit fork_idle(int cpu) +struct task_struct * __cpuinit fork_idle(int cpu) { struct task_struct *task; struct pt_regs regs; diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fc5b5442e9421efc9044eed23e3a188fffe5cce7..2c606cc922a50cc212b6f4abd6e8635356ebb99e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -989,8 +989,7 @@ int zone_watermark_ok(struct zone *z, int order, unsigned long mark, int classzone_idx, int alloc_flags) { /* free_pages my go negative - that's OK */ - unsigned long min = mark; - long free_pages = z->free_pages - (1 << order) + 1; + long min = mark, free_pages = z->free_pages - (1 << order) + 1; int o; if (alloc_flags & ALLOC_HIGH) diff --git a/net/ipv4/netfilter/ip_conntrack_sip.c b/net/ipv4/netfilter/ip_conntrack_sip.c index 3a26d63eed88926b81baf934a002314c823217b9..11c588a10e6b5e7adf993f59a3ae5a8a6dd2cfd3 100644 --- a/net/ipv4/netfilter/ip_conntrack_sip.c +++ b/net/ipv4/netfilter/ip_conntrack_sip.c @@ -283,10 +283,16 @@ static int skp_epaddr_len(const char *dptr, const char *limit, int *shift) { int s = *shift; - for (; dptr <= limit && *dptr != '@'; dptr++) + /* Search for @, but stop at the end of the line. + * We are inside a sip: URI, so we don't need to worry about + * continuation lines. */ + while (dptr <= limit && + *dptr != '@' && *dptr != '\r' && *dptr != '\n') { (*shift)++; + dptr++; + } - if (*dptr == '@') { + if (dptr <= limit && *dptr == '@') { dptr++; (*shift)++; } else diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 2a7e4618f526888cc30b0e013b5aeffc591aa4eb..e3854696988d76ec4bd16b2e4b6e35067de28d02 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -3393,7 +3393,7 @@ static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, #ifdef CONFIG_IPV6_ROUTER_PREF array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref; array[DEVCONF_RTR_PROBE_INTERVAL] = cnf->rtr_probe_interval; -#ifdef CONFIV_IPV6_ROUTE_INFO +#ifdef CONFIG_IPV6_ROUTE_INFO array[DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = cnf->accept_ra_rt_info_max_plen; #endif #endif @@ -3898,7 +3898,7 @@ static struct addrconf_sysctl_table .proc_handler = &proc_dointvec_jiffies, .strategy = &sysctl_jiffies, }, -#ifdef CONFIV_IPV6_ROUTE_INFO +#ifdef CONFIG_IPV6_ROUTE_INFO { .ctl_name = NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, .procname = "accept_ra_rt_info_max_plen", diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 6a9f616de37d32cebdd0eca952b24cef5620ecf9..39bb658f3c447782ddd411102477cddaee9538be 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1413,6 +1413,13 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, return; } + if (!ipv6_addr_equal(&skb->nh.ipv6h->daddr, target) && + !(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) { + ND_PRINTK2(KERN_WARNING + "ICMPv6 Redirect: target address is not link-local.\n"); + return; + } + ndisc_flow_init(&fl, NDISC_REDIRECT, &saddr_buf, &skb->nh.ipv6h->saddr, dev->ifindex); diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig index cd10e44db015d59c7e96bdc0207a1b3a5ec5631f..2a2bcb303bfa623025cbb7593b2473e7cef3ea09 100644 --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig @@ -628,7 +628,7 @@ config NETFILTER_XT_MATCH_TCPMSS config NETFILTER_XT_MATCH_HASHLIMIT tristate '"hashlimit" match support' - depends on NETFILTER_XTABLES + depends on NETFILTER_XTABLES && (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n) help This option adds a `hashlimit' match. diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c index eb2a2411f97b9863a1fe7ebb42e43bf4e2897bd3..9dec115346784428f3b2a18a64873ce77299f2db 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c @@ -303,10 +303,16 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr, { int s = *shift; - for (; dptr <= limit && *dptr != '@'; dptr++) + /* Search for @, but stop at the end of the line. + * We are inside a sip: URI, so we don't need to worry about + * continuation lines. */ + while (dptr <= limit && + *dptr != '@' && *dptr != '\r' && *dptr != '\n') { (*shift)++; + dptr++; + } - if (*dptr == '@') { + if (dptr <= limit && *dptr == '@') { dptr++; (*shift)++; } else diff --git a/net/netfilter/xt_connbytes.c b/net/netfilter/xt_connbytes.c index d93cb096a675c84f914cbdb39e880f658f4e7d41..5e32dfa2668bf8dec0e56f2d22683fcf6bc72d05 100644 --- a/net/netfilter/xt_connbytes.c +++ b/net/netfilter/xt_connbytes.c @@ -52,6 +52,8 @@ match(const struct sk_buff *skb, { const struct xt_connbytes_info *sinfo = matchinfo; u_int64_t what = 0; /* initialize to make gcc happy */ + u_int64_t bytes = 0; + u_int64_t pkts = 0; const struct ip_conntrack_counter *counters; if (!(counters = nf_ct_get_counters(skb))) @@ -89,29 +91,22 @@ match(const struct sk_buff *skb, case XT_CONNBYTES_AVGPKT: switch (sinfo->direction) { case XT_CONNBYTES_DIR_ORIGINAL: - what = div64_64(counters[IP_CT_DIR_ORIGINAL].bytes, - counters[IP_CT_DIR_ORIGINAL].packets); + bytes = counters[IP_CT_DIR_ORIGINAL].bytes; + pkts = counters[IP_CT_DIR_ORIGINAL].packets; break; case XT_CONNBYTES_DIR_REPLY: - what = div64_64(counters[IP_CT_DIR_REPLY].bytes, - counters[IP_CT_DIR_REPLY].packets); + bytes = counters[IP_CT_DIR_REPLY].bytes; + pkts = counters[IP_CT_DIR_REPLY].packets; break; case XT_CONNBYTES_DIR_BOTH: - { - u_int64_t bytes; - u_int64_t pkts; - bytes = counters[IP_CT_DIR_ORIGINAL].bytes + - counters[IP_CT_DIR_REPLY].bytes; - pkts = counters[IP_CT_DIR_ORIGINAL].packets+ - counters[IP_CT_DIR_REPLY].packets; - - /* FIXME_THEORETICAL: what to do if sum - * overflows ? */ - - what = div64_64(bytes, pkts); - } + bytes = counters[IP_CT_DIR_ORIGINAL].bytes + + counters[IP_CT_DIR_REPLY].bytes; + pkts = counters[IP_CT_DIR_ORIGINAL].packets + + counters[IP_CT_DIR_REPLY].packets; break; } + if (pkts != 0) + what = div64_64(bytes, pkts); break; } diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 8bd30976cdee767fbeb5e1eef3b693cc6bdc0025..6db77d1329f7fe6fd63a099a583b9d7dc8dad7dd 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c @@ -621,7 +621,13 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds, /* The receiver of the HEARTBEAT ACK should also perform an * RTT measurement for that destination transport address * using the time value carried in the HEARTBEAT ACK chunk. + * If the transport's rto_pending variable has been cleared, + * it was most likely due to a retransmit. However, we want + * to re-enable it to properly update the rto. */ + if (t->rto_pending == 0) + t->rto_pending = 1; + hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data; sctp_transport_update_rto(t, (jiffies - hbinfo->sent_at));