id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
5a26f6bbb767d7ad23311a1e81cfdd2bebefb855
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Do firmware feature fixups after features are initialised
Problem Details: On pSeries the firmware features are not setup until ppc_md.init_early, so we can't do the firmware feature sections fixups till after this. Currently firmware feature sections is only used on iSeries which inits the firmware features much earlier. This is a bug in waiting on pSeries. Signed-off-by:...
```diff diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 6018178708a5..bc43bba05cf8 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -350,13 +350,11 @@ void __init setup_system(void) { DBG(" -> setup_system()\n"); - /* Apply the CPUs-specific and...
4cefebb1b497a84d61f2fa29d497df75a84b69d4
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Fix stolen time for SMT without LPAR
Problem Details: For POWERPC, stolen time accounts for cycles lost to the hypervisor or PURR cycles attributed to the other SMT thread. Hence, when a PURR is available, we should still calculate stolen time, irrespective of being virtualised. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Paul Mack...
```diff diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 0a8a820672f4..43c687a1d76e 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -214,7 +214,6 @@ static void account_process_time(struct pt_regs *regs) run_posix_cpu_timers(current); } -#ifdef CONFIG_PPC_SPLP...
ffdd6e4d1685779a413e4a8d753b1862259ed42a
Analyze and fix the following issue in the Linux kernel code: [CIFS] fix whitespace
Problem Details: More whitespace problems found by checkpatch Signed-off-by: Steve French <sfrench@us.ibm.com>
```diff diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 07838b2ac1ce..ebd13358cca6 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -58,7 +58,7 @@ cifs_dump_mem(char *label, void *data, int length) } #ifdef CONFIG_CIFS_DEBUG2 -void cifs_dump_detail(struct smb_hdr * smb) +void cifs_dump...
a06381fec77bf88ec6c5eb6324457cb04e9ffd69
Analyze and fix the following issue in the Linux kernel code: FUTEX: Restore the dropped ERSCH fix
Problem Details: The return value of futex_find_get_task() needs to be -ESRCH in case that the search fails. This was part of the original futex fixes and got accidentally dropped, when the futex-tidy-up patch was split out. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Stabl...
```diff diff --git a/kernel/futex.c b/kernel/futex.c index df248f5e0836..45490bec5831 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -409,14 +409,12 @@ static struct task_struct * futex_find_get_task(pid_t pid) rcu_read_lock(); p = find_task_by_pid(pid); - if (!p) - goto out_unlock; - if ((current->euid != ...
7b018b2888b32284e09bba9cccb5cd2e12199feb
Analyze and fix the following issue in the Linux kernel code: audit: fix oops removing watch if audit disabled
Problem Details: Removing a watched file will oops if audit is disabled (auditctl -e 0). To reproduce: - auditctl -e 1 - touch /tmp/foo - auditctl -w /tmp/foo - auditctl -e 0 - rm /tmp/foo (or mv) Signed-off-by: Tony Jones <tonyj@suse.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: <stable@kernel.org> Signed-off-by: An...
```diff diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index 74cc0fc6bb81..ce61f423542c 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c @@ -947,7 +947,7 @@ static void audit_update_watch(struct audit_parent *parent, /* If the update involves invalidating rules, do the inode-based * filte...
4f84e4be53a04a65d97bf0faa0c8f99e29bc0170
Analyze and fix the following issue in the Linux kernel code: x86_64: fix misplaced `continue' in mce.c
Problem Details: Background: When a userspace application wants to know about machine check events, it opens /dev/mcelog and does a read(). Usually, we found that this interface works well, but in some cases, when the system was taking large numbers of machine check exceptions, the read() would hang. The system...
```diff diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c index a14375dd5425..aa1d15991794 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86_64/kernel/mce.c @@ -497,15 +497,17 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize, loff for (i = 0; i < next; i++) { unsign...
d8aaf12142d066d3982475d58a9094c85a06a5a9
Analyze and fix the following issue in the Linux kernel code: update checkpatch.pl to version 0.06
Problem Details: Update to checkpatch.pl v0.06. Of note: - do { and else handled correctly as control structures for { matching - trailing whitespace correctly tripped when line otherwise empty - support for const, including const foo * const bar - multiline macros defining values correctly reported This version...
```diff diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 56c364c1df81..277c32647f36 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -9,7 +9,7 @@ use strict; my $P = $0; $P =~ s@.*/@@g; -my $V = '0.05'; +my $V = '0.06'; use Getopt::Long qw(:config no_auto_abbrev); @@ -271,24 +2...
debee0768ea1978c6efba03206a414685e4a9ed1
Analyze and fix the following issue in the Linux kernel code: slab allocators: MAX_ORDER one off fix
Problem Details: MAX_ORDER is the first order that is not possible. Use MAX_ORDER - 1 to calculate the larges possible object size in slab.h Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/include/linux/slab.h b/include/linux/slab.h index a015236cc572..cebcd3833c76 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -82,8 +82,8 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, * to do various tricks to work around compiler limitations in order to ...
71c42157904404a37f89fff3b2536c55115823a5
Analyze and fix the following issue in the Linux kernel code: document nlink function
Problem Details: These should have been documented from the beginning. Fix it. Signed-off-by: Dave Hansen <haveblue@us.ibm.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org...
```diff diff --git a/include/linux/fs.h b/include/linux/fs.h index b3ae77cccbb6..6a41f4cab14c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1211,6 +1211,14 @@ static inline void mark_inode_dirty_sync(struct inode *inode) __mark_inode_dirty(inode, I_DIRTY_SYNC); } +/** + * inc_nlink - directly increm...
08932a198345c80d20cfa055a45464cebb9ff93b
Analyze and fix the following issue in the Linux kernel code: uml: use generic BUG
Problem Details: Get UML to use the generic bug support rather than arch specific one. If I insert an artificial bug right before loading init, I get this: Kernel panic - not syncing: Kernel mode signal 4 EIP: 0023:[<0819d501>] CPU: 0 Not tainted ESP: 002b:f7fd4fbc EFLAGS: 00000246 Not tainted EAX: 0000000...
```diff diff --git a/include/asm-um/bug.h b/include/asm-um/bug.h index 3357c5e2468e..9e33b864c359 100644 --- a/include/asm-um/bug.h +++ b/include/asm-um/bug.h @@ -1,6 +1,6 @@ #ifndef __UM_BUG_H #define __UM_BUG_H -#include <asm/arch/bug.h> +#include <asm-generic/bug.h> #endif diff --git a/include/asm-um/common.l...
b08b5ad9473a972fdd5d739080d24a84b23525ac
Analyze and fix the following issue in the Linux kernel code: Char: stallion, fix oops during init with ISA cards
Problem Details: The stallion driver oopses while initializing ISA cards due to an uninitialized variable. This patch changes the initialisation order to match the PCI code path. Signed-off-by: Ingo Korb <ml@akana.de> Acked-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> ...
```diff diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index 45bf2a262a85..8c73ccb8830f 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c @@ -4753,13 +4753,14 @@ static int __init stallion_module_init(void) brdp->ioaddr2 = conf.ioaddr2; brdp->irq = conf.irq; brdp->irqtype = con...
58ed2f9c75b719da4f494f24ed2d56d45f5b4959
Analyze and fix the following issue in the Linux kernel code: alpha: fix alignment problem in csum_ipv6_magic()
Problem Details: Hopefully this fixes http://bugzilla.kernel.org/show_bug.cgi?id=8635 The struct in6_addr passed to csum_ipv6_magic() is 4 byte aligned, so we can't use the regular 64-bit loads. Since the cost of handling of 4 byte and 1 byte aligned 64-bit data is roughly the same, this code can cope with any src/ds...
```diff diff --git a/arch/alpha/lib/csum_ipv6_magic.S b/arch/alpha/lib/csum_ipv6_magic.S index e09748dbf2ed..2c2acb96deb6 100644 --- a/arch/alpha/lib/csum_ipv6_magic.S +++ b/arch/alpha/lib/csum_ipv6_magic.S @@ -7,6 +7,9 @@ * __u32 len, * unsigned short p...
653d4876b730fedca8473481863cf700245e3582
Analyze and fix the following issue in the Linux kernel code: update checkpatch.pl to version 0.05
Problem Details: This version brings a some new tests, and a host of changes to fix false positives, of particular note: - detect 'var ++;' and 'var --;' as a bad combination - multistatement #defines are now checked based on statement count - multistatement #defines with initialisation correctly reported - checks...
```diff diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index aea90d30d229..56c364c1df81 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -9,7 +9,7 @@ use strict; my $P = $0; $P =~ s@.*/@@g; -my $V = '0.04'; +my $V = '0.05'; use Getopt::Long qw(:config no_auto_abbrev); @@ -17,11 +17...
92c4ca5c3a5e180e9762438db235f41d192cb955
Analyze and fix the following issue in the Linux kernel code: sched: fix next_interval determination in idle_balance()
Problem Details: The intervals of domains that do not have SD_BALANCE_NEWIDLE must be considered for the calculation of the time of the next balance. Otherwise we may defer rebalancing forever. Siddha also spotted that the conversion of the balance interval to jiffies is missing. Fix that to. From: Srivatsa Vaddagir...
```diff diff --git a/kernel/sched.c b/kernel/sched.c index a7475913b009..50e1a3122699 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2938,17 +2938,21 @@ static void idle_balance(int this_cpu, struct rq *this_rq) unsigned long next_balance = jiffies + 60 * HZ; for_each_domain(this_cpu, sd) { - if (sd->flag...
849663430268db63a9c3c7467984e4e530ded901
Analyze and fix the following issue in the Linux kernel code: SLUB: fix behavior if the text output of list_locations overflows PAGE_SIZE
Problem Details: If slabs are allocated or freed from a large set of call sites (typical for the kmalloc area) then we may create more output than fits into a single PAGE and sysfs only gives us one page. The output should be truncated. This patch fixes the checks to do the truncation properly. Signed-off-by: Christo...
```diff diff --git a/mm/slub.c b/mm/slub.c index fa28b1623644..202049a45764 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3042,13 +3042,15 @@ static int list_locations(struct kmem_cache *s, char *buf, n += sprintf(buf + n, " pid=%ld", l->min_pid); - if (num_online_cpus() > 1 && !cpus_empty(l->cpus)) { + if (n...
5136237bc392413332b02e69ada158c307da658f
Analyze and fix the following issue in the Linux kernel code: SM501: Fix sm501_init_reg() mask/set order
Problem Details: The order of the set and mask operation in sm501_init_reg() was setting and then masking the bits set. Correct the order so that we do not end up with 288MHz SDRAM clocks on certain systems. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed...
```diff diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 4c4412e0de24..3a0ecfc404e9 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -813,6 +813,9 @@ static DEVICE_ATTR(dbg_regs, 0666, sm501_dbg_regs, NULL); /* sm501_init_reg * * Helper function for the init code to setup a register + * + ...
1ed8a2b3c501bedd4b35130c8a52662ccf78abad
Analyze and fix the following issue in the Linux kernel code: console UTF-8 fixes (fix)
Problem Details: Recently my console UTF-8 patch went mainline. Here is an additional patch that fixes two nasty issues and improves a third one, namely: 1. My patch changed the behavior if a glyph is not found in the Unicode mapping table. Previously for Unicode values less than 256 or 512 the kernel tried to ...
```diff diff --git a/drivers/char/vt.c b/drivers/char/vt.c index bbd9fc412877..6650ae1c088f 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -1956,7 +1956,7 @@ char con_buf[CON_BUF_SIZE]; DEFINE_MUTEX(con_buf_mtx); /* is_double_width() is based on the wcwidth() implementation by - * Markus Kuhn -- 2003-05-...
4e71e474c784dc274f28ec8bb22a5dbabc6dc7c5
Analyze and fix the following issue in the Linux kernel code: fix refcounting of nsproxy object when unshared
Problem Details: When a namespace is unshared, a refcount on the previous nsproxy is abusively taken, leading to a memory leak of nsproxy objects. Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Cc: Badari Pulavarty <pbadari@us.ibm.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc:...
```diff diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c index 1bc4b55241a8..9e83b589f754 100644 --- a/kernel/nsproxy.c +++ b/kernel/nsproxy.c @@ -145,13 +145,11 @@ void free_nsproxy(struct nsproxy *ns) /* * Called from unshare. Unshare all the namespaces part of nsproxy. - * On sucess, returns the new nsproxy and...
6d79af701d334777541136e914a9c0969b2ad307
Analyze and fix the following issue in the Linux kernel code: hwmon/coretemp: fix a broken error path
Problem Details: Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 0328382df8fa..6d54c8caed79 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -185,6 +185,7 @@ static int __devinit coretemp_probe(struct platform_device *pdev) /* check for microcode update */ rdmsr_on_cpu(data->i...
4b2a8fb3a7f7935f62a7bbdc851789fb7c2da032
Analyze and fix the following issue in the Linux kernel code: [PPP]: Fix osize too small errors when decoding mppe.
Problem Details: The mppe_decompress() function required a buffer that is 1 byte too small when receiving a message of mru size. This fixes buffer allocation to prevent this from occurring. Signed-off-by: Konstantin Sharlaimov <konstantin.sharlaimov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 541168713f1f..3ef0092dc09c 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c @@ -1708,7 +1708,18 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb) goto err; if (proto == PPP_COMP) { - ns = dev_alloc...
7e4a6da7c2a1e0df06b71dc4ddc31910229ba9d9
Analyze and fix the following issue in the Linux kernel code: [PPP]: Revert 606f585e363527da9feaed79465132c0c661fd9e
Problem Details: This can cause packet buffer overflows in certain cases, the real bug will be fixed differently in a followon changeset. Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c index 5ae80bbe2edc..d5bdd2574659 100644 --- a/drivers/net/ppp_mppe.c +++ b/drivers/net/ppp_mppe.c @@ -493,14 +493,14 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf, /* * Make sure we have enough room to decryp...
64beb8f3eb3c724add64ca3272915528e10213c1
Analyze and fix the following issue in the Linux kernel code: [TIPC]: Fix infinite loop in netlink handler
Problem Details: The tipc netlink config handler uses the nlmsg_pid from the request header as destination for its reply. If the application initialized nlmsg_pid to 0, the reply is looped back to the kernel, causing hangup. Fix: use nlmsg_pid of the skb that triggered the request. Signed-off-by: Florian Westphal <fw@...
```diff diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c index 4cdafa2d1d4d..6a7f7b4c2595 100644 --- a/net/tipc/netlink.c +++ b/net/tipc/netlink.c @@ -60,7 +60,7 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info) rep_nlh = nlmsg_hdr(rep_buf); memcpy(rep_nlh, req_nlh, hdr_space); rep_nlh-...
dbbeb2f9917792b989b6269ebfe24257f9aa1618
Analyze and fix the following issue in the Linux kernel code: [SKBUFF]: Fix incorrect config #ifdef around skb_copy_secmark
Problem Details: secmark doesn't depend on CONFIG_NET_SCHED. Signed-off-by: Patrick McHardy <kaber@trash.net> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 7c6a34e21eee..8d43ae6979e5 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -434,8 +434,8 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask) n->tc_verd = CLR_TC_MUNGED(n->tc_verd); C(iif); #endif - skb_copy_secmark(n, skb); #...
addad45494cb4f9c03470a4e5155f442791b0d7f
Analyze and fix the following issue in the Linux kernel code: ACPI: sbs: probe smart battery vis SMBus controller
Problem Details: http://bugzilla.kernel.org/show_bug.cgi?id=8559 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index c1bae106833c..974d00ccfe84 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -127,7 +127,7 @@ static int acpi_sbs_resume(struct acpi_device *device); static struct acpi_driver acpi_sbs_driver = { .name = "sbs", .class = ACPI_SBS_CLASS, - ...
d5a3d32a042126f65a008e0e5204ef92ad2ee55d
Analyze and fix the following issue in the Linux kernel code: ACPI: fix 2.6.20 SMP boot regression
Problem Details: Always disable/enable interrupts in the acpi idle routine, even in the error path. This is required as the 2.6.20 change in git commit d331e739f5ad2aaa9... "Fix interrupt race in idle callback" expects the idle handler to enable interrupt before returning. There was a case in acpi idle routine, in wh...
```diff diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index ee5759bef945..80ffc7829916 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -332,16 +332,18 @@ static void acpi_processor_idle(void) int sleep_ticks = 0; u32 t1, t2 = 0; - pr = processors[smp_...
ab61f7d21ab7f564fce322c498e4a7d6171140db
Analyze and fix the following issue in the Linux kernel code: [AVR32] Fix bug in invalidate_dcache_region()
Problem Details: If (start + size) is not cacheline aligned and (start & mask) > (end & mask), the last but one cacheline won't be invalidated as it should. Fix this by rounding `end' down to the nearest cacheline boundary if it gets adjusted due to misalignment. Also flush the write buffer unconditionally -- if the d...
```diff diff --git a/arch/avr32/mm/cache.c b/arch/avr32/mm/cache.c index 8f7b1c3cd0f9..c1233c615e67 100644 --- a/arch/avr32/mm/cache.c +++ b/arch/avr32/mm/cache.c @@ -23,7 +23,6 @@ void invalidate_dcache_region(void *start, size_t size) { unsigned long v, begin, end, linesz, mask; - int flush = 0; linesz = boot...
e2f1f19272f8de0374ad297b9806f8b6509e0013
Analyze and fix the following issue in the Linux kernel code: x86_64: Fix only make Macintosh drivers default on Macs
Problem Details: Include PPC_MAC in the default too, not only MAC which only covers m68k MACs. Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig index 0852d330c265..dbe96268866e 100644 --- a/drivers/macintosh/Kconfig +++ b/drivers/macintosh/Kconfig @@ -2,7 +2,7 @@ menuconfig MACINTOSH_DRIVERS bool "Macintosh device drivers" depends on PPC || MAC || X86 - default y if MAC + default y...
9d9bbd4d247a674deb43565582151acdc22e90d1
Analyze and fix the following issue in the Linux kernel code: i386: Make CMPXCHG64 only dependent on PAE
Problem Details: It is only used for PAE kernels in set_64bit. The problem is that due to a old Windows bug many CPUs need magic MSRs to enable CMPXCHG64, and we can't do that nicely early enough before it is potentially used. But since we only need it in PAE kernels so only force the checking for CMPXCHG65 with PAE....
```diff diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 8770a5d0b143..d2f6a247414d 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -541,7 +541,7 @@ config HIGHMEM4G config HIGHMEM64G bool "64GB" - depends on X86_CMPXCHG64 + depends on !M386 && !M486 help Select this if you have a 32-bit pr...
6d5b78cdd5a17665674429400b3ed10e3ec60684
Analyze and fix the following issue in the Linux kernel code: [IPV6] NDISC: Fix thinko to control Router Preference support.
Problem Details: Bug reported by Haruhito Watanabe <haruhito@sfc.keio.ac.jp>. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index d8b36451bada..0358e6066a4e 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1062,7 +1062,7 @@ static void ndisc_router_discovery(struct sk_buff *skb) pref = ra_msg->icmph.icmp6_router_pref; /* 10b is handled as if it were 00b (medium) */ if (p...
e2d8e314ad18d4302b3b7ea21ab8b2cb72f2b152
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: nfctnetlink: Don't allow to change helper
Problem Details: There is no realistic situation to change helper (Who wants IRC helper to track FTP traffic ?). Moreover, if we want to do that, we need to fix race issue by nfctnetlink and running helper. That will add overhead to packet processing. It wouldn't pay. So this rejects the request to change helper. The r...
```diff diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 3f73327794ab..d0fe3d769828 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -869,8 +869,7 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nfattr *cda[]) return 0...
58229a18994215bbfe0bcd1c99d2e039f30b076b
Analyze and fix the following issue in the Linux kernel code: posix-timers: Prevent softirq starvation by small intervals and SIG_IGN
Problem Details: posix-timers which deliver an ignored signal are currently rearmed in the timer softirq: This is necessary because the timer needs to be delivered again when SIG_IGN is removed. This is not a problem, when the interval is reasonable. With high resolution timers enabled one might arm a posix timer with...
```diff diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 588c99da0307..329ce0172074 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c @@ -353,9 +353,40 @@ static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer) * it should be restarted. */ if (timr->it.real.interval.tv6...
05dc16d6a175139a5872d08db56ee277ec90df5b
Analyze and fix the following issue in the Linux kernel code: [PARISC] unwinder improvements
Problem Details: Add special-case handling for "handle_interruption" so that we can rewind past the interruption. This is useful for seeing what caused a BUG() or WARN_ON(); otherwise the unwind stops at the interruption. Signed-off-by: Randolph Chung <tausq@debian.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux....
```diff diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index cad9d78312e0..322167737de7 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c @@ -16,6 +16,8 @@ #include <asm/uaccess.h> #include <asm/assembly.h> +#include <asm/asm-offsets.h> +#include <asm/ptrace.h> #i...
e036306aa1832963cd147849b282259a32f5ac08
Analyze and fix the following issue in the Linux kernel code: [PARISC] Fix unwinder on 64-bit kernels
Problem Details: The unwinder was broken by the shift of PAGE_OFFSET in order to increase the size of the vmalloc area on 64-bit kernels. Signed-off-by: Randolph Chung <tausq@debian.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
```diff diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index e70f57e27643..cad9d78312e0 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c @@ -26,6 +26,8 @@ #define dbg(x...) #endif +#define KERNEL_START (KERNEL_BINARY_TEXT_START - 0x1000) + extern struct unwind_tabl...
06b32f3ab6df4c7489729f94bdc7093c72681d4b
Analyze and fix the following issue in the Linux kernel code: [PARISC] Handle wrapping in expand_upwards()
Problem Details: Function expand_upwards() did not guarded against wrapping around to address 0. This fixes the adjtimex02 testcase from the Linux Test Project on a 32bit PARISC kernel. [expand_upwards is only used on parisc and ia64; it looks like it does the right thing on both. --kyle] Signed-off-by: Helge Deller...
```diff diff --git a/mm/mmap.c b/mm/mmap.c index 68b9ad2ef1d6..906ed402f7ca 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1536,9 +1536,14 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) * vma->vm_start/vm_end cannot change under us because the caller * is required to hold the mmap_sem in rea...
82c3aca6ad9004169df8f2f8c0747686fe4003b3
Analyze and fix the following issue in the Linux kernel code: IPoIB/cm: Fix interoperability when MTU doesn't match
Problem Details: IPoIB connected mode currently rejects a connection request unless the supported MTU is >= the local netdevice MTU. This breaks interoperability with implementations that might have tweaked IPOIB_CM_MTU, and there's real no longer a reason to do so: this test is just a leftover from when we did not twe...
```diff diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index c64249f7caed..472c632ee52c 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -759,9 +759,9 @@ static int ipoib_cm_rep_handler(struct ib_cm_id *cm_id, struct ib...
3ec7393a6858a1716e74aa81be6af76fd180021d
Analyze and fix the following issue in the Linux kernel code: IPoIB/cm: Initialize RX before moving QP to RTR
Problem Details: Fix a crasher bug in IPoIB CM: once a QP is in the RTR state, a receive completion (or even an asynchronous error) might be observed on this QP, so we have to initialize all of our receive data structures before moving to the RTR state. As an optimization (since modify_qp might take a long time), the ...
```diff diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 076a0bbb63d7..c64249f7caed 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -309,6 +309,11 @@ static int ipoib_cm_req_handler(struct ib_cm_id *cm_id, struct i...
24bce5080306bd5255cbda3d6b09a29d5515b470
Analyze and fix the following issue in the Linux kernel code: IB/umem: Fix possible hang on process exit
Problem Details: If ib_umem_release() is called after ib_uverbs_close() sets context->closing, then a process can get stuck in a D state, because the code boils down to if (down_write_trylock(&mm->mmap_sem)) down_write(&mm->mmap_sem); which is obviously a stupid instant deadlock. Fix the code so that we only try ...
```diff diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index b4aec5103c99..d40652a80151 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c @@ -225,13 +225,15 @@ void ib_umem_release(struct ib_umem *umem) * up here and not be able to take the mmap_sem. In t...
58a7295bc8073b9e668c329cb9ceb5b668c2b15d
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] Fix sysfs_create_file return value handling
Problem Details: Commit 0a4b2ccc555fa2ca6873d60219047104e4805d45 in cpufreq.git eliminates the build warnings but does not pass on the error code of sysfs_create_file to the function calling cpufreq_add_dev. Instead some previous value of ret would be returned. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signe...
```diff diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0521427a571e..0db9e1bda322 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -826,16 +826,19 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) /* set up files for this cpu device */ drv_attr = cpufreq_...
ea48761519bd40d7a881c587b5f3177664b2987e
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] ondemand: fix tickless accounting and software coordination bug
Problem Details: With tickless kernel and software coordination os P-states, ondemand can look at wrong idle statistics. This can happen when ondemand sampling is happening on CPU 0 and due to software coordination sampling also looks at utilization of CPU 1. If CPU 1 is in tickless state at that moment, its idle stati...
```diff diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index dc6f357390e2..e794527e4925 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -96,15 +96,25 @@ static struct dbs_tuners { static inline cputime64_t get_cpu_idle_time(unsigned in...
669b792c77bbc30e9f4d9c95dbc918dc348c49c2
Analyze and fix the following issue in the Linux kernel code: Blackfin arch: Clean up trace buffer handling, No major functional changes.
Problem Details: Turns on trace earlier, so crashes at kernel start should print out a trace, making things easier to debug. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
```diff diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index 07c1cfdc958e..a86bf6545781 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c @@ -194,6 +194,17 @@ void __init setup_arch(char **cmdline_p) /* this give a chance to get printk() working before crash. */ #...
29440a2b4cd37e32dfe0fa60ef1665775b24dab1
Analyze and fix the following issue in the Linux kernel code: Blackfin arch: Start untangling the CPLB handling code.
Problem Details: - Move cache initialization to C from assembly. - Move anomaly workaround for writing [ID]MEM_CONTROL to assembly, so that we don't have to mess around with .align directives in C source. - Fix a bug where bfin_write_DMEM_CONTROL would write to IMEM_CONTROL - Break out CPLB related code from kern...
```diff diff --git a/arch/blackfin/kernel/Makefile b/arch/blackfin/kernel/Makefile index 6fac57f6ce06..f429ebc3a961 100644 --- a/arch/blackfin/kernel/Makefile +++ b/arch/blackfin/kernel/Makefile @@ -7,7 +7,7 @@ extra-y := init_task.o vmlinux.lds obj-y := \ entry.o process.o bfin_ksyms.o ptrace.o setup.o signal.o \ ...
5fe675e2b3e41349deb0c81667065b9cb229ea1d
Analyze and fix the following issue in the Linux kernel code: fix module_param mistake in it821x
Problem Details: The attached patch fixes a trivial mistake in a MODULE_PARAM_DESC of pata_it821x driver. The parameter name in MODULE_PARAM_DESC should match the one in module_param_named. Signed-off-by: Stas Sergeev <stsp@aknet.ru> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index 525c9c142891..dab4e7cf8cda 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c @@ -794,7 +794,7 @@ MODULE_VERSION(DRV_VERSION); module_param_named(noraid, it8212_noraid, int, S_IRUGO); -MODULE_PARM_DESC(it8212_norai...
a3d2cc5e742f82a87fdf9e2b730f41ff381c0a73
Analyze and fix the following issue in the Linux kernel code: ahci: fix PORTS_IMPL override
Problem Details: If PORTS_IMPL register is zero, ahci initialize it to full mask corresponding to nr_ports in the CAP register. hpriv->cap, which is initialized at the end of the function, is incorrectly used as value of CAP causing ahci to always override PORTS_IMPL to 0x1 if it's zero. Fix it. This fixes a bug wher...
```diff diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 545f330e59a5..ca5229d24d8e 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -527,7 +527,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev, /* fixup zero port_map */ if (!port_map) { - port_map = (1 << ahci_nr_ports(hpriv->...
3fae450c68d06b8890e1530bdd0910e938e7251d
Analyze and fix the following issue in the Linux kernel code: kerneldoc fix in libata
Problem Details: Fix parameter name from ata_dev_reread_id() in libata-core.c for kerneldoc. Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 35628123ca7e..adfae9d1ceb1 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3659,7 +3659,7 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class, /** * ata_dev_reread_id - Re-read I...
374abf2cb16a9df8be96675c606996458872e8b3
Analyze and fix the following issue in the Linux kernel code: pata_it821x: (partially) fix DMA in RAID mode
Problem Details: Code intended to check DMA status was checking DMA command register. Moreover firmware seems to "forget" to set DMA capable bit for the slave device (at least in RAID mode but without ITE RAID volumes) so check device ID for DMA capable bit when deciding whether to use DMA and remove DMA status check ...
```diff diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index b3456d7a592c..525c9c142891 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c @@ -2,6 +2,7 @@ * pata_it821x.c - IT821x PATA for new ATA layer * (C) 2005 Red Hat Inc * Alan Cox <alan@redhat.com> + * (C...
2090dee420911045258d50239dc2c527e4b1dd06
Analyze and fix the following issue in the Linux kernel code: cxgb3 - MAC watchdog update
Problem Details: Fix variables initialization and usage in the MAC watchdog. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c index 16cadba88ed5..b261be147e7b 100644 --- a/drivers/net/cxgb3/xgmac.c +++ b/drivers/net/cxgb3/xgmac.c @@ -501,6 +501,10 @@ int t3b2_mac_watchdog_task(struct cmac *mac) unsigned int rx_xcnt; int status; + status = 0; + tx_xcnt = 1; /* By...
7b581a0fa85464f7f765b9a66f612e7ec4ab17f9
Analyze and fix the following issue in the Linux kernel code: cxgb3 - Stop mac RX when changing MTU
Problem Details: Rx traffic needs to be halted when the MTU is changed to avoid a potential chip hang. Reset/restore MAC filters around a MTU change. Also fix the pause frames high materwark setting. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h index bf9d6be7f214..020859c855d7 100644 --- a/drivers/net/cxgb3/regs.h +++ b/drivers/net/cxgb3/regs.h @@ -1882,6 +1882,10 @@ #define V_COPYALLFRAMES(x) ((x) << S_COPYALLFRAMES) #define F_COPYALLFRAMES V_COPYALLFRAMES(1U) +#define S_DISBCAST...
c706bfb52afc9b5d115f61a8e1c0c30540feb3f4
Analyze and fix the following issue in the Linux kernel code: cxgb3 - Fix direct XAUI support
Problem Details: Check all lanes for link status on direct XAUI cards. Don't assume that direct XAUI always uses XGMAC 1. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/cxgb3/ael1002.c b/drivers/net/cxgb3/ael1002.c index 73a41e6a5bfc..ee140e63ddc5 100644 --- a/drivers/net/cxgb3/ael1002.c +++ b/drivers/net/cxgb3/ael1002.c @@ -219,7 +219,13 @@ static int xaui_direct_get_link_status(struct cphy *phy, int *link_ok, unsigned int status; status = t3_...
890de332834a95450a74e5f615f4f9a0fa564623
Analyze and fix the following issue in the Linux kernel code: cxgb3 - fix netpoll hanlder
Problem Details: Fix netpoll handler to work with line interrupt, msi and msi-x. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 1b20f4060e2d..d8a1f5452c51 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c @@ -2071,10 +2071,20 @@ static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp) static void cxgb_ne...
e360b5628f1d040c0e96dd9ee011196645e08aef
Analyze and fix the following issue in the Linux kernel code: cxgb3 - fix skb->dev dereference
Problem Details: eth_type_trans() now sets skb->dev. References to skb->dev should happen after it is called. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 3666586a4831..eaa7dace4182 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c @@ -1690,8 +1690,8 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq, struct port_info *pi; skb_pull(skb, sizeof(*p) + pad); - sk...
add3f2fa7a6cec16d35a95b9078e1ecc80a6f332
Analyze and fix the following issue in the Linux kernel code: s390: avoid inconsistent lock state in qeth
Problem Details: ipv6_regen_rndid in net/ipv6/addrconf.c makes use of "write_lock_bh" for its inet6_dev->lock. It may run in softirq-context. qeth makes use of "read_lock" for the same inet6_dev->lock. To avoid a potential deadlock situation, qeth should make use of "read_lock_bh" for its usages of inet6_dev->lock. Si...
```diff diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index c5a95079b5ed..79b7379a7849 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -5850,9 +5850,9 @@ qeth_add_vlan_mc6(struct qeth_card *card) in_dev = in6_dev_get(netdev); if (!in_dev) continue; - ...
031ae4deb095a1f18a842740459c5ae184ec931c
Analyze and fix the following issue in the Linux kernel code: bonding: Fix 802.3ad no carrier on "no partner found" instance
Problem Details: Modify carrier state determination for 802.3ad mode to comply with section 43.3.9 of IEEE 802.3, which requires that "Links that are not successful candidates for aggregation (e.g., links that are attached to other devices that cannot perform aggregation or links that have been manually configured to b...
```diff diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 7e03f41ae2c2..f829e4ad8b49 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -2303,19 +2303,18 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) } /* - * set link state for ...
3201e656ce56ed02e9501906c18ffe16ae350a52
Analyze and fix the following issue in the Linux kernel code: bonding: Fix use after free in unregister path
Problem Details: The following patch (based on a patch from Stephen Hemminger <shemminger@linux-foundation.org>) removes use after free conditions in the unregister path for the bonding master. Without this patch, an operation of the form "echo -bond0 > /sys/class/net/bonding_masters" would trigger a NULL pointer dere...
```diff diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 223517dcbcfd..6287ffbda7f7 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -4345,8 +4345,8 @@ static void bond_free_all(void) bond_mc_list_destroy(bond); /* Release the bonded slaves ...
4c4bd5a97a87670d2c368ed4ed8a8f2c93080605
Analyze and fix the following issue in the Linux kernel code: spidernet: Cure RX ram full bug
Problem Details: This patch fixes a rare deadlock that can occur when the kernel is not able to empty out the RX ring quickly enough. Below follows a detailed description of the bug and the fix. As long as the OS can empty out the RX buffers at a rate faster than the hardware can fill them, there is no problem. If, fo...
```diff diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 69005d113d4d..c99980a14203 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c @@ -1050,6 +1050,66 @@ static void show_rx_chain(struct spider_net_card *card) } #endif +/** + * spider_net_resync_head_ptr - Advance head pt...
24315c5e6f508edd84e996d67daef3d1bcc72f8b
Analyze and fix the following issue in the Linux kernel code: firewire: Only set client->iso_context if allocation was successful.
Problem Details: This patch fixes an OOPS on cdev release for an fd where iso context creation failed. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
```diff diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c index 5d402d63799f..dbb76427d529 100644 --- a/drivers/firewire/fw-cdev.c +++ b/drivers/firewire/fw-cdev.c @@ -640,6 +640,7 @@ iso_callback(struct fw_iso_context *context, u32 cycle, static int ioctl_create_iso_context(struct client *client, v...
8acff0a2449aeda37204c4074976bf79f21968e3
Analyze and fix the following issue in the Linux kernel code: Fix up CREDIT entry ordering
Problem Details: Reorder my CREDIT entry to make it in alphabetic order by last name. Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/CREDITS b/CREDITS index 273d72b610c3..79fd13dbb8e4 100644 --- a/CREDITS +++ b/CREDITS @@ -3301,14 +3301,6 @@ S: 12725 SW Millikan Way, Suite 400 S: Beaverton, Oregon 97005 S: USA -N: Li Yang -E: leoli@freescale.com -D: Freescale Highspeed USB device driver -D: Freescale QE SoC support and Ether...
bf8c4817427de0744e9c008d3ad5a7635e41e397
Analyze and fix the following issue in the Linux kernel code: x86_64: fix link warning between for .text and .init.text
Problem Details: WARNING: arch/x86_64/kernel/built-in.o(.text+0xace9): Section mismatch: reference to .init.text: (between 'get_mtrr_state' and 'mtrr_wrmsr') WARNING: arch/x86_64/kernel/built-in.o(.text+0xad09): Section mismatch: reference to .init.text: (between 'get_mtrr_state' and 'mtrr_wrmsr') WARNING: arch/x86_64/...
```diff diff --git a/arch/i386/kernel/cpu/mtrr/generic.c b/arch/i386/kernel/cpu/mtrr/generic.c index c4ebb5126ef7..6d5937891b46 100644 --- a/arch/i386/kernel/cpu/mtrr/generic.c +++ b/arch/i386/kernel/cpu/mtrr/generic.c @@ -42,7 +42,7 @@ static int mtrr_show; module_param_named(show, mtrr_show, bool, 0); /* Get the...
018d2ad0cccfa9bb8bee1d160c353e568484a137
Analyze and fix the following issue in the Linux kernel code: x86: change_page_attr bandaids
Problem Details: - Disable CLFLUSH again; it is still broken. Always do WBINVD. - Always flush in the i386 case, not only when there are deferred pages. These are both brute-force inefficient fixes, to be improved next release cycle. The changes to i386 are a little more extensive than strictly needed (some dead code...
```diff diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c index 47bd477c8ecc..2eb14a73be9c 100644 --- a/arch/i386/mm/pageattr.c +++ b/arch/i386/mm/pageattr.c @@ -68,14 +68,23 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot, return base; } -static void flush_kernel_map(voi...
55181000cd60334fe920c65ffbcdfe0e3f1de406
Analyze and fix the following issue in the Linux kernel code: x86: Disable KPROBES with DEBUG_RODATA for now
Problem Details: Right now Kprobes cannot write to the write protected kernel text when DEBUG_RODATA is enabled. Disallow this in Kconfig for now. Temporary fix for 2.6.22. In .23 add code to temporarily unprotect it. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/arch/i386/Kconfig.debug b/arch/i386/Kconfig.debug index b31c0802e1cc..6293920cd1be 100644 --- a/arch/i386/Kconfig.debug +++ b/arch/i386/Kconfig.debug @@ -49,6 +49,7 @@ config DEBUG_PAGEALLOC config DEBUG_RODATA bool "Write protect kernel read-only data structures" depends on DEBUG_KERNEL + dep...
0b622330213ce0f0ee23199e433ed73284209b46
Analyze and fix the following issue in the Linux kernel code: x86_64: Fix eventd/timerfd syscalls
Problem Details: They had the same syscall number. Pointed out by Davide Libenzi Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index ae1ed05f2814..8696f8ad401e 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h @@ -626,9 +626,9 @@ __SYSCALL(__NR_utimensat, sys_utimensat) __SYSCALL(__NR_epoll_pwait, sys_epoll_pwait) #define __NR_signalfd 28...
e412ac4971d27ea84f3d63ce425c6ab2d6a67f23
Analyze and fix the following issue in the Linux kernel code: x86_64: Fix readahead/sync_file_range/fadvise64 compat calls
Problem Details: Correctly convert the u64 arguments from 32bit to 64bit. Pointed out by Heiko Carstens. I guess this proves Linus' theory that nobody uses the more exotic Linux specific syscalls. It wasn't discovered by a user. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-fo...
```diff diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S index 21868f9bed7c..47565c3345d2 100644 --- a/arch/x86_64/ia32/ia32entry.S +++ b/arch/x86_64/ia32/ia32entry.S @@ -620,7 +620,7 @@ ia32_sys_call_table: .quad quiet_ni_syscall /* tux */ .quad quiet_ni_syscall /* security */ .quad ...
c5f226c7e95bf318879fb6ae02fc0dfb0f6d408c
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Fix powermac late initcall to only run on powermac
Problem Details: Current ppc64_defconfig kernel fails to boot on iSeries, dying with: Unable to handle kernel paging request for data at address 0x00000000 Faulting instruction address: 0xc00000000071b258 Oops: Kernel access of bad area, sig: 11 [#1] SMP NR_CPUS=32 iSeries <snip> NIP [c00000000071b258] .iSeries_src_in...
```diff diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 956571526a57..7ccb9236e8b4 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c @@ -454,6 +454,9 @@ static int initializing = 1; static int pmac_late_init(void) ...
9ba4ace39fdfe22268daca9f28c5df384ae462cf
Analyze and fix the following issue in the Linux kernel code: [POWERPC] PowerPC: Prevent data exception in kernel space (32-bit)
Problem Details: The "is_exec" branch of the protection check in do_page_fault() didn't do anything on 32-bit PowerPC. So if a userland program jumps to a page with Linux protection flags "---p", all the tests happily fall through, and handle_mm_fault() is called, which in turn calls handle_pte_fault(), which calls up...
```diff diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index bfe901353142..115b25f50bf8 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -279,14 +279,13 @@ good_area: #endif /* CONFIG_8xx */ if (is_exec) { -#ifdef CONFIG_PPC64 +#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE)...
824e55f95f871d492cd095d7694df3cfcad1f8f5
Analyze and fix the following issue in the Linux kernel code: sh: Fix up cf-enabler dependency for SE boards.
Problem Details: This was using CONFIG_SH_SOLUTION_ENGINE, where we really wanted CONFIG_SOLUTION_ENGINE. While we're at it, move the whole CF enabler mess somewhere better suited. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
```diff diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index b16407c9f2c4..924efe5b8c29 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -404,50 +404,6 @@ source "arch/sh/boards/renesas/hs7751rvoip/Kconfig" source "arch/sh/boards/renesas/rts7751r2d/Kconfig" source "arch/sh/boards/renesas/r7780rp/Kconfig" -conf...
760af100d7cdf62d0929b11929465e4cfc694c5c
Analyze and fix the following issue in the Linux kernel code: [SCSI] aacraid: change srb status busy return
Problem Details: This patch is more like a spelling correction than a fix. It was discovered that if we had a busy status return from the Adapter for the SCSI srb command to a physical component, that we returned DID_NO_CONNECT rather than what one would expect DID_BUS_BUSY. Signed-off-by: Mark Salyzyn <aacraid@adapte...
```diff diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index b3081b10d0a3..6345dbe33c19 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -2266,7 +2266,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr) break; case SRB_STATUS_BUSY: - ...
4a904a65fab83bcdd6b00470ac6c4aa80518e6a9
Analyze and fix the following issue in the Linux kernel code: [SCSI] tmscsim: clean-up status codes
Problem Details: Remove redundant defines from the header, replace all occurances in the code with standard SAM_STAT_ macros. Also fix what seems to be a typo in testing for (status == H_OVER_UNDER_RUN)... Signed-off-by: G. Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.c...
```diff diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c index 73c5ca082e65..e8260f2dba0f 100644 --- a/drivers/scsi/tmscsim.c +++ b/drivers/scsi/tmscsim.c @@ -1564,7 +1564,8 @@ dc390_Disconnect( struct dc390_acb* pACB ) if( (pSRB->SRBState & (SRB_START_+SRB_MSGOUT)) || !(pSRB->SRBState & (SRB_DISCONN...
186e234358ba29a4094d0c8c0d3ea00f84d32a3e
Analyze and fix the following issue in the Linux kernel code: SCTP: Fix sctp_getsockopt_get_peer_addrs
Problem Details: This is the split out of the patch that we agreed I should split out from my last patch. It changes space_left to be computed in the same way the to variable is. I know we talked about changing space_left to an int, but I think size_t is more appropriate, since we should never have negative space in ...
```diff diff --git a/net/sctp/socket.c b/net/sctp/socket.c index c1f239ac12b9..2fc036699d48 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -4019,8 +4019,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, return -EINVAL; to = optval + offsetof(struct sctp_getaddrs,addrs); - space_left...
408f22e81ea2fcf96c80e85ee12d20ef5148bf7c
Analyze and fix the following issue in the Linux kernel code: SCTP: update sctp_getsockopt helpers to allow oversized buffers
Problem Details: I noted the other day while looking at a bug that was ostensibly in some perl networking library, that we strictly avoid allowing getsockopt operations to complete if we pass in oversized buffers. This seems to make libraries like Perl::NET malfunction since it seems to allocate oversized buffers for ...
```diff diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 6edaaa009d62..c1f239ac12b9 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -3375,12 +3375,13 @@ static int sctp_getsockopt_sctp_status(struct sock *sk, int len, sctp_assoc_t associd; int retval = 0; - if (len != sizeof(status)) { + if (len...
84b36a8e0c863aeea29b62f8411157192481dd2e
Analyze and fix the following issue in the Linux kernel code: [S390] Fix yet another two section mismatches.
Problem Details: WARNING: arch/s390/kernel/built-in.o(.text+0xb92a): Section mismatch: reference to .init.text:start_secondary (between 'restart_addr' and 'stack_overflow') WARNING: arch/s390/appldata/built-in.o(.data+0xdc): Section mismatch: reference to .init.text: (between 'appldata_nb' and 'appldata_timer_l...
```diff diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index 81a2b92ab0c2..6ffbab77ae4d 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -535,8 +535,7 @@ void appldata_unregister_ops(struct appldata_ops *ops) /**************************...
ce4448238aee0144a2458874944df5a5a01a6ac6
Analyze and fix the following issue in the Linux kernel code: [S390] Fix zfcpdump header
Problem Details: Added members for volume number and real memory size to header information. Signed-off-by: Michael Holzheu <holzheu@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index 66eb0688d523..4e711a985d59 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c @@ -267,7 +267,9 @@ struct zcore_header { u64 tod; cpuid_t cpu_id; u32 arch_id; + u32 volnr; u32 build_arch; + u64 rmem_size; char ...
cc0191aeef73e5aa0c7f9a586d4bb27ed67facbb
Analyze and fix the following issue in the Linux kernel code: [IPVS]: Fix state variable on failure to start ipvs threads
Problem Details: ip_vs currently fails to reset its ip_vs_sync_state variable if the sync thread fails to start properly. The result is that the kernel will report a running daemon when their actuall is none. If you issue the following commands: 1. ipvsadm --start-daemon master --mcast-interface bla 2. ipvsadm -L --...
```diff diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c index 7ea2d981a932..356f067484e3 100644 --- a/net/ipv4/ipvs/ip_vs_sync.c +++ b/net/ipv4/ipvs/ip_vs_sync.c @@ -67,6 +67,11 @@ struct ip_vs_sync_conn_options { struct ip_vs_seq out_seq; /* outgoing seq. struct */ }; +struct ip...
281216177a407f78cfd650ee4391afc487577193
Analyze and fix the following issue in the Linux kernel code: [XFRM]: Fix MTU calculation for non-ESP SAs
Problem Details: My IPsec MTU optimization patch introduced a regression in MTU calculation for non-ESP SAs, the SA's header_len needs to be subtracted from the MTU if the transform doesn't provide a ->get_mtu() function. Reported-and-tested-by: Marco Berizzi <pupilla@hotmail.com> Signed-off-by: Patrick McHardy <kabe...
```diff diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 85f3f43a6cca..dfacb9c2a6e3 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -1729,7 +1729,7 @@ int xfrm_state_mtu(struct xfrm_state *x, int mtu) x->type && x->type->get_mtu) res = x->type->get_mtu(x, mtu); else - res =...
e99f056b2777f3fc6871ff6347c98c0321ad2f8f
Analyze and fix the following issue in the Linux kernel code: [XFS] Update the MAINTAINERS file entry for XFS - change git repo name.
Problem Details: Make the git repository bare and so give it the conventional .git suffix. Signed-off-by: Tim Shimmin <tes@sgi.com>
```diff diff --git a/MAINTAINERS b/MAINTAINERS index 303ef7de4cf4..4ce895a4b5ba 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4026,7 +4026,7 @@ P: Tim Shimmin M: xfs-masters@oss.sgi.com L: xfs@oss.sgi.com W: http://oss.sgi.com/projects/xfs -T: git git://oss.sgi.com:8090/xfs/xfs-2.6 +T: git git://oss.sgi.com:8090/xf...
41e904dee22066ae7ac3a7f695b2c8bd43ce4e04
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Fix snd-powermac refcounting bugs
Problem Details: The old snd-powermac driver has some serious refcounting issues when initialisation fails, which is the case on all new machines with a layout-id since those are handled by the new snd-aoa driver. Some of those bugs seem to have been under the radar for some time (like double pci_dev_put), but one was...
```diff diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 5a2bef44a2f5..7a22f0f3784a 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -775,7 +775,8 @@ static int snd_pmac_free(struct snd_pmac *chip) out_le32(&chip->awacs->control, in_le32(&chip->awacs->control) & 0xfff); } - snd_pmac_sound_feature(ch...
3aeb884b4ec442719a2d8aa15316415a7412efd8
Analyze and fix the following issue in the Linux kernel code: sh: Handle -ERESTART_RESTARTBLOCK for restartable syscalls.
Problem Details: The current implementation only handles -ERESTARTNOHAND, whereas we also need to handle -ERESTART_RESTARTBLOCK in the handle_signal() case for restartable system calls. As noted by Carl: This fixes the LTP test nanosleep03 - the current kernel causes -ERESTART_RESTARTBLOCK to reach user space rather ...
```diff diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index fdca038e4b91..e323e299878b 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c @@ -268,7 +268,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, badframe: force_sig(SIGSEGV, current); return 0; -} +} ...
fa490cfd15d7ce0900097cc4e60cfd7a76381138
Analyze and fix the following issue in the Linux kernel code: Fix possible runqueue lock starvation in wait_task_inactive()
Problem Details: Miklos Szeredi reported very long pauses (several seconds, sometimes more) on his T60 (with a Core2Duo) which he managed to track down to wait_task_inactive()'s open-coded busy-loop. He observed that an interrupt on one core tries to acquire the runqueue-lock but does not succeed in doing so for a ver...
```diff diff --git a/kernel/sched.c b/kernel/sched.c index 49be34e1f0b8..a7475913b009 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1159,21 +1159,72 @@ void wait_task_inactive(struct task_struct *p) { unsigned long flags; struct rq *rq; - int preempted; + struct prio_array *array; + int running; repeat: ...
a0f98a1cb7d27c656de450ba56efd31bdc59065e
Analyze and fix the following issue in the Linux kernel code: sched: fix SysRq-N (normalize RT tasks)
Problem Details: Gene Heskett reported the following problem while testing CFS: SysRq-N is not always effective in normalizing tasks back to SCHED_OTHER. The reason for that turns out to be the following bug: - normalize_rt_tasks() uses for_each_process() to iterate through all tasks in the system. The problem i...
```diff diff --git a/kernel/sched.c b/kernel/sched.c index 13cdab3b4c48..49be34e1f0b8 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -7071,12 +7071,13 @@ EXPORT_SYMBOL(__might_sleep); void normalize_rt_tasks(void) { struct prio_array *array; - struct task_struct *p; + struct task_struct *g, *p; unsigned long...
caec4e8dc85e0644ec24aeb36285e1ba02da58cc
Analyze and fix the following issue in the Linux kernel code: Fix signalfd interaction with thread-private signals
Problem Details: Don't let signalfd dequeue private signals off other threads (in the case of things like SIGILL or SIGSEGV, trying to do so would result in undefined behaviour on who actually gets the signal, since they are force unblocked). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: D...
```diff diff --git a/kernel/signal.c b/kernel/signal.c index fe590e00db8d..f9405609774e 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -363,7 +363,13 @@ static int __dequeue_signal(struct sigpending *pending, sigset_t *mask, */ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) { - ...
bd197234b0a616c8f04f6b682326a5a24b33ca92
Analyze and fix the following issue in the Linux kernel code: Revert "futex_requeue_pi optimization"
Problem Details: This reverts commit d0aa7a70bf03b9de9e995ab272293be1f7937822. It not only introduced user space visible changes to the futex syscall, it is also non-functional and there is no way to fix it proper before the 2.6.22 release. The breakage report ( http://lkml.org/lkml/2007/5/12/17 ) went unanswered, an...
```diff diff --git a/include/linux/futex.h b/include/linux/futex.h index 899fc7f20edd..99650353adfa 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h @@ -17,7 +17,6 @@ union ktime; #define FUTEX_LOCK_PI 6 #define FUTEX_UNLOCK_PI 7 #define FUTEX_TRYLOCK_PI 8 -#define FUTEX_CMP_REQUEUE_PI 9 #define F...
fc1d4c9c3761ca8db52b647c6a4ba50771900a12
Analyze and fix the following issue in the Linux kernel code: sh: Fix up futex implementation.
Problem Details: SH is able to support a complete futex implementation on UP by way of gUSA. However, IRQ toggling must be done for the old CPUs that don't have movli.l/movco.l (LL/SC) instructions. Provide a default implementation that does this, so it's possible to optimize for newer CPUs. Follows the same scheme as...
```diff diff --git a/include/asm-sh/futex-irq.h b/include/asm-sh/futex-irq.h new file mode 100644 index 000000000000..a9f16a7f9aea --- /dev/null +++ b/include/asm-sh/futex-irq.h @@ -0,0 +1,111 @@ +#ifndef __ASM_SH_FUTEX_IRQ_H +#define __ASM_SH_FUTEX_IRQ_H + +#include <asm/system.h> + +static inline int atomic_futex_op_...
83dd4504456d4b5e464d6ec4a7665e2c922db67f
Analyze and fix the following issue in the Linux kernel code: ACPICA: fix error path in new external package objects as method arguments
Problem Details: In the routine acpi_ut_create_package_object(), if the ACPI_ALLOCATE_ZEROED() fails then ACPI_FREE(package_desc) is called as part of the cleanup. This should instead be acpi_ut_remove_reference(package_desc) in order to remove the reference acquired from acpi_ut_create_internal_object() [see the rout...
```diff diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c index db0b9bac7945..76ee766c84f9 100644 --- a/drivers/acpi/utilities/utobject.c +++ b/drivers/acpi/utilities/utobject.c @@ -177,7 +177,7 @@ union acpi_operand_object *acpi_ut_create_package_object(u32 count) package_elements = ...
69a331470ff02561cf1898eeb152ccca9f22bf53
Analyze and fix the following issue in the Linux kernel code: sh: Fix restartable syscall arg5 clobbering.
Problem Details: We use R0 as the 5th argument of syscall. When the syscall restarts after signal handling, we should restore the old value of R0. The attached patch does it. Without this patch, I've experienced random failures in the situation which signals are issued frequently. Signed-off-by: Kaz Kojima <kkojima@r...
```diff diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index b32c35a7c0a3..fdca038e4b91 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c @@ -481,7 +481,7 @@ give_sigsegv: static int handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, - sigset_t *oldset, ...
cc78d30af0823f33069fb4813c47571d4e0675a2
Analyze and fix the following issue in the Linux kernel code: [SCSI] mpt fusion: fix for mounted raid volume filesytem that goes read-only
Problem Details: If there is IO going to the volume while a hidden disk is being torn down, there is a case where we would return a DID_NO_CONNECT for IO sent to the volume. The end result is the volume goes read-only. This problem is due to the fact the firmware mapped target ids saved in per device object is phys_dis...
```diff diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index f0456d26a4af..d35617376f87 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -447,7 +447,12 @@ mptscsih_issue_sep_command(MPT_ADAPTER *ioc, VirtTarget *vtarget, MPT_FRAME_HDR *mf; ...
35f51eee99efe88866476300ccb7f206e88f3394
Analyze and fix the following issue in the Linux kernel code: [SCSI] ibmvscsi: Abort path fix
Problem Details: Since it is completely possible for scsi core to call a LLDD's eh_abort function after the command has completed, fix ibmvscsi to return SUCCESS if this is the case. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
```diff diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 934bcad39b3b..f5da7620ab59 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -1018,7 +1018,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) if (!found_evt) { spin_u...
06f923cbf080e22d1ffccbf3fd2cbab0176f6025
Analyze and fix the following issue in the Linux kernel code: [SCSI] ibmvscsi: Misc. locking fixes
Problem Details: Fix a couple locking bugs discovered during code inspection. ibmvscsi_send_srp_event needs to be called with the host lock held. This patch fixes a couple paths in the code where this wasn't true. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@Ste...
```diff diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 0a16972b2599..934bcad39b3b 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -845,6 +845,7 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata) { struct viosrp_ada...
beb87c33393142200df7bfdc901dde97bd576650
Analyze and fix the following issue in the Linux kernel code: [SCSI] scsi_debug: correct parameter default text
Problem Details: Correct the module info text for the default value of "every_nth" to 0. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
```diff diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 06229f225ee9..4cd9c58efef1 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -2405,7 +2405,7 @@ MODULE_PARM_DESC(add_host, "0..127 hosts allowed(def=1)"); MODULE_PARM_DESC(delay, "# of jiffies to delay response(def...
d9202429e60d16d39c427cd4e4408cf1827ab9e9
Analyze and fix the following issue in the Linux kernel code: [ARM] Add support for pause_on_oops and display preempt/smp options
Problem Details: Add calls to oops_enter() and oops_exit() to __die(), so that things like lockdep know when an oops occurs. Add suffixes to the oops report to indicate whether the running kernel has been built with preempt or smp support. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
```diff diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 10ff36e4e414..1b68d365d0e1 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -204,12 +204,24 @@ void show_stack(struct task_struct *tsk, unsigned long *sp) barrier(); } +#ifdef CONFIG_PREEMPT +#define S_PREEMPT " PREEM...
9d66586f7723b73c5925c7c7819c260484627851
Analyze and fix the following issue in the Linux kernel code: shm: fix the filename of hugetlb sysv shared memory
Problem Details: Some user space tools need to identify SYSV shared memory when examining /proc/<pid>/maps. To do so they look for a block device with major zero, a dentry named SYSV<sysv key>, and having the minor of the internal sysv shared memory kernel mount. To help these tools and to make it easier for people j...
```diff diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index aa083dd34e92..e6b46b3ac2fe 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -736,15 +736,13 @@ static int can_do_hugetlb_shm(void) can_do_mlock()); } -struct file *hugetlb_zero_setup(size_t size) +struct file *hugetlb_file_setu...
22741925d268e8479ef66312749bd8d96ed35365
Analyze and fix the following issue in the Linux kernel code: hugetlb: fix get_policy for stacked shared memory files
Problem Details: Here's another breakage as a result of shared memory stacked files :( The NUMA policy for a VMA is determined by checking the following (in the order given): 1) vma->vm_ops->get_policy() (if defined) 2) vma->vm_policy (if defined) 3) task->mempolicy (if defined) 4) Fall back to default_policy By swi...
```diff diff --git a/ipc/shm.c b/ipc/shm.c index 02faa54dbf5a..047b823e6bf0 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -254,8 +254,10 @@ struct mempolicy *shm_get_policy(struct vm_area_struct *vma, unsigned long addr) if (sfd->vm_ops->get_policy) pol = sfd->vm_ops->get_policy(vma, addr); - else + else if (vma->vm...
74584ae509befc2ed711810e7df4b075473869b2
Analyze and fix the following issue in the Linux kernel code: udf: fix possible leakage of blocks
Problem Details: We have to take care that when we call udf_discard_prealloc() from udf_clear_inode() we have to write inode ourselves afterwards (otherwise, some changes might be lost leading to leakage of blocks, use of free blocks or improperly aligned extents). Also udf_discard_prealloc() does two different things...
```diff diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 1f0129405cf4..bf7de0bdbab3 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -100,14 +100,23 @@ no_delete: clear_inode(inode); } +/* + * If we are going to release inode from memory, we discard preallocation and + * truncate last inode extent to proper l...
4b356be019d0c28f67af02809df7072c1c8f7d32
Analyze and fix the following issue in the Linux kernel code: SLUB: minimum alignment fixes
Problem Details: If ARCH_KMALLOC_MINALIGN is set to a value greater than 8 (SLUBs smallest kmalloc cache) then SLUB may generate duplicate slabs in sysfs (yes again) because the object size is padded to reach ARCH_KMALLOC_MINALIGN. Thus the size of the small slabs is all the same. No arch sets ARCH_KMALLOC_MINALIGN l...
```diff diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index a0ad37463d62..6207a3d8da71 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -28,7 +28,7 @@ struct kmem_cache { int size; /* The size of an object including meta data */ int objsize; /* The size of an object witho...
8dab5241d06bfc9ee141ea78c56cde5070d7460d
Analyze and fix the following issue in the Linux kernel code: Rework ptep_set_access_flags and fix sun4c
Problem Details: Some changes done a while ago to avoid pounding on ptep_set_access_flags and update_mmu_cache in some race situations break sun4c which requires update_mmu_cache() to always be called on minor faults. This patch reworks ptep_set_access_flags() semantics, implementations and callers so that it's now re...
```diff diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index dc8f99ee305f..7d7bcf990e99 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -27,13 +27,20 @@ do { \ * Largely same as above, but only sets the access flags (dirty, * accessed, and writ...
679ce0ace6b1a07043bc3b405a34ddccad808886
Analyze and fix the following issue in the Linux kernel code: random: fix output buffer folding
Problem Details: (As reported by linux@horizon.com) Folding is done to minimize the theoretical possibility of systematic weakness in the particular bits of the SHA1 hash output. The result of this bug is that 16 out of 80 bits are un-folded. Without a major new vulnerability being found in SHA1, this is harmless, b...
```diff diff --git a/drivers/char/random.c b/drivers/char/random.c index 0474cac4a84e..7f5271272f91 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -794,7 +794,7 @@ static void extract_buf(struct entropy_store *r, __u8 *out) buf[0] ^= buf[3]; buf[1] ^= buf[4]; - buf[0] ^= rol32(buf[3], 16); + bu...
ed45666271f4fafa95b9d8ad44050e9a9bd2376e
Analyze and fix the following issue in the Linux kernel code: md: fix bug in error handling during raid1 repair
Problem Details: If raid1/repair (which reads all block and fixes any differences it finds) hits a read error, it doesn't reset the bio for writing before writing correct data back, so the read error isn't fixed, and the device probably gets a zero-length write which it might complain about. Signed-off-by: Neil Brown ...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 3a95cc5e029c..46677d7d9980 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1240,17 +1240,24 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) } r1_bio->read_disk = primary; for (i=0; i<mddev->raid_disks; i++) - ...
af03b8e4e81c3789e597632268940edd11ffe870
Analyze and fix the following issue in the Linux kernel code: md: fix two raid10 bugs
Problem Details: 1/ When resyncing a degraded raid10 which has more than 2 copies of each block, garbage can get synced on top of good data. 2/ We round the wrong way in part of the device size calculation, which can cause confusion. Signed-off-by: Neil Brown <neilb@suse.de> Cc: <stable@kernel.org> Signed-off-by:...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 82249a69014f..9eb66c1b523b 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1867,6 +1867,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i int d = r10_bio->devs[i].devnum; bio = r10_bio->devs[i...
da88ba17de990a4b0d18ecde2c40355700888750
Analyze and fix the following issue in the Linux kernel code: perfctr-watchdog: fix interchanged parameters to release_{evntsel,perfctr}_nmi
Problem Details: Fix oops triggered during: echo 0 > /proc/sys/kernel/nmi_watchdog The culprit seems to be 09198e68501a7e34737cd9264d266f42429abcdc: [PATCH] i386: Clean up NMI watchdog code In two places, the parameters to release_{evntsel,perfctr}_nmi got interchanged during the cleanup. Fix interchanged parameters...
```diff diff --git a/arch/i386/kernel/cpu/perfctr-watchdog.c b/arch/i386/kernel/cpu/perfctr-watchdog.c index 98488f997da6..f0b67630b90d 100644 --- a/arch/i386/kernel/cpu/perfctr-watchdog.c +++ b/arch/i386/kernel/cpu/perfctr-watchdog.c @@ -276,8 +276,8 @@ static int single_msr_reserve(void) static void single_msr_unr...
2f41dddbbd7193fb5cdae0a24db4d378d56885fd
Analyze and fix the following issue in the Linux kernel code: swsusp: Fix userland interface
Problem Details: Fix oops caused by 'cat /dev/snapshot', reported by Arkadiusz Miskiewicz, and make it impossible to thaw tasks with the help of the swsusp userland interface while there is a snapshot image ready to save. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-b...
```diff diff --git a/kernel/power/user.c b/kernel/power/user.c index 24d7d78e6f42..d65305b515b1 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -99,6 +99,8 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf, ssize_t res; data = filp->private_data; + if (!data->ready) + return -ENOD...
b1d93de3e4633c4cbfd622a3564d8268a116a46a
Analyze and fix the following issue in the Linux kernel code: toshiba_acpi: fix section mismatch in allyesconfig
Problem Details: Fix section error (allyesconfig). The exit function is called from init, so functions that are called by the exit function cannot be marked __exit. WARNING: drivers/built-in.o(.text+0xe5bc6): Section mismatch: reference to .exit. text: (between 'toshiba_acpi_exit' and 'hci_raw') Signed-off-by: Randy...
```diff diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index 1cfbecb0ac10..13369b45563f 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c @@ -524,7 +524,7 @@ static acpi_status __init add_device(void) return AE_OK; } -static acpi_status __exit remove_device(void) +s...
3e903e7b1605aff88d7f89a96fab5e43081b914f
Analyze and fix the following issue in the Linux kernel code: cpuset: zero malloc - fix for old cpusets
Problem Details: The cpuset code to present a list of tasks using a cpuset to user space could write to an array that it had kmalloc'd, after a kmalloc request of zero size. The problem was that the code didn't check for writes past the allocated end of the array until -after- the first write. This is a race conditio...
```diff diff --git a/kernel/cpuset.c b/kernel/cpuset.c index f57854b08922..4c49188cc49b 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1682,9 +1682,9 @@ static int pid_array_load(pid_t *pidarray, int npids, struct cpuset *cs) do_each_thread(g, p) { if (p->cpuset == cs) { - pidarray[n++] = p->pid; i...
30475cc12a50816f290828fb7e3cd7036cd622df
Analyze and fix the following issue in the Linux kernel code: Restore shmid as inode# to fix /proc/pid/maps ABI breakage
Problem Details: shmid used to be stored as inode# for shared memory segments. Some of the proc-ps tools use this from /proc/pid/maps. Recent cleanups to newseg() changed it. This patch sets inode number back to shared memory id to fix breakage. Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com> Cc: "Albert Cahala...
```diff diff --git a/ipc/shm.c b/ipc/shm.c index 4fefbad7096d..02faa54dbf5a 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -397,6 +397,11 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) shp->shm_nattch = 0; shp->id = shm_buildid(ns, id, shp->shm_perm.seq); shp->shm_file = file; + /*...