id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
ac21467182e562a71d8b4e098ea054e42700c0ff
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Be more informative on BUG
Problem Details: We have a condition in the ppc64 host mmu code that should never occur. Unfortunately, it just did happen to me and I was rather puzzled on why, because BUG_ON doesn't tell me anything useful. So let's add some more debug output in case this goes wrong. Also change BUG to WARN, since I don't want to r...
```diff diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c index 41af12fb1260..5545c45ea57f 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_host.c +++ b/arch/powerpc/kvm/book3s_64_mmu_host.c @@ -231,10 +231,16 @@ int kvmppc_mmu_map_page(struct kvm_vcpu *vcpu, struct kvmppc_pte *orig_...
90d83dc3d49f5101addae962ccc1b4aff66b68d8
Analyze and fix the following issue in the Linux kernel code: KVM: use the correct RCU API for PROVE_RCU=y
Problem Details: The RCU/SRCU API have already changed for proving RCU usage. I got the following dmesg when PROVE_RCU=y because we used incorrect API. This patch coverts rcu_deference() to srcu_dereference() or family API. =================================================== [ INFO: suspicious rcu_dereference_check()...
```diff diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index d7bac1f75af0..d5f4e9161201 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c @@ -1381,7 +1381,7 @@ static void kvm_release_vm_pages(struct kvm *kvm) int i, j; unsigned long base_gfn; - slots = rcu_dereference(kvm->me...
acb5451789f21ad51215897bb8f9306a05e8acd4
Analyze and fix the following issue in the Linux kernel code: KVM: prevent spurious exit to userspace during task switch emulation.
Problem Details: If kvm_task_switch() fails code exits to userspace without specifying exit reason, so the previous exit reason is reused by userspace. Fix this by specifying exit reason correctly. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 78af52222fd2..ab78eb8ba899 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -2266,8 +2266,14 @@ static int task_switch_interception(struct vcpu_svm *svm) (int_vec == OF_VECTOR || int_vec == BP_VECTOR))) skip_emulated_instruction(&sv...
19d04437267f00c7b50343513693b7a3174ff908
Analyze and fix the following issue in the Linux kernel code: KVM: fix emulator_task_switch() return value.
Problem Details: emulator_task_switch() should return -1 for failure and 0 for success to the caller, just like x86_emulate_insn() does. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 585d0ef4a5f6..5ac0bb465ed6 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2453,7 +2453,7 @@ int emulator_task_switch(struct x86_emulate_ctxt *ctxt, rc = writeback(ctxt, ops); } - return rc; + return (rc == X86EMUL_UN...
6bc31bdc55cad6609b1610b4cecad312664f2808
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: implement NEXTRIPsave SVM feature
Problem Details: On SVM we set the instruction length of skipped instructions to hard-coded, well known values, which could be wrong when (bogus, but valid) prefixes (REX, segment override) are used. Newer AMD processors (Fam10h 45nm and better, aka. PhenomII or AthlonII) have an explicit NEXTRIP field in the VMCB cont...
```diff diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index b26a38d85356..1d91d05f9368 100644 --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h @@ -81,7 +81,9 @@ struct __attribute__ ((__packed__)) vmcb_control_area { u32 event_inj_err; u64 nested_cr3; u64 lbr_ctl; - u8 rese...
f7a711971edd952352a89698db1d36f469e25f77
Analyze and fix the following issue in the Linux kernel code: KVM: Fix MAXPHYADDR calculation when cpuid does not support it
Problem Details: MAXPHYADDR is derived from cpuid 0x80000008, but when that isn't present, we get some random value. Fix by checking first that cpuid 0x80000008 is supported. Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 33a40c544c7a..d65e481c5fa4 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4171,9 +4171,13 @@ int cpuid_maxphyaddr(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; + best = kvm_find_cpuid_entry(vcpu, 0x80000000, 0); + if (!best ...
2fb53ad811e238d5dec8716b99986c3f234e3337
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: Don't overwrite decode cache
Problem Details: Currently if we an instruction spans a page boundary, when we fetch the second half we overwrite the first half. This prevents us from tracing the full instruction opcodes. Fix by appending the second half to the first. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosa...
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 64c9854f0458..083b269a83ea 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -646,21 +646,22 @@ static unsigned long ss_base(struct x86_emulate_ctxt *ctxt) static int do_fetch_insn_byte(struct x86_emulate_ctxt *ctxt, ...
805d32dea4dfb8319aaf7e73a681ad410a5e331a
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: cleanup/fix mmu audit code
Problem Details: This patch does: - 'sp' parameter in inspect_spte_fn() is not used, so remove it - fix 'kvm' and 'slots' is not defined in count_rmaps() - fix a bug in inspect_spte_has_rmap() Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 1cc60d3f445b..6ed7d633aefe 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -3182,8 +3182,7 @@ static gva_t canonicalize(gva_t gva) } -typedef void (*inspect_spte_fn) (struct kvm *kvm, struct kvm_mmu_page *sp, - u64 *sptep); +typedef...
306d071f179c28c97688cb91c8585fd5ab840a9e
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Don't export Book3S symbols on BookE
Problem Details: Book3S knows how to convert floats to doubles and vice versa. BookE doesn't. So let's make sure we don't export them on BookE. This fixes a link error on BookE with CONFIG_KVM=y. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index 58fdb3a784de..bc9f39d2598b 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c @@ -101,8 +101,10 @@ EXPORT_SYMBOL(pci_dram_offset); EXPORT_SYMBOL(start_thread); EXPORT_SYMBOL(kernel_thread); +...
287d5611fab5a42214d028b6f67fbd2ee977dcf2
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Only use QPRs when available
Problem Details: BookE KVM doesn't know about QPRs, so let's not try to access then. This fixes a build error on BookE KVM. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 9a4dd8146d39..ffbe4cac5b15 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -335,6 +335,7 @@ static void kvmppc_complete_mmio_load(struct kvm_vcpu *vcpu, case KVM_REG_FPR: vcpu->arch.fpr[vcpu->arch.io_gpr ...
a1eda280ccd5fee71a89a94030f96bca5faebe21
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Add check if pte was mapped secondary
Problem Details: Some HTAB providers (namely the PS3) ignore the SECONDARY flag. They just put an entry in the htab as secondary when they see fit. So we need to check the return value of htab_insert to remember the correct slot id so we can actually invalidate the entry again. Fixes KVM on the PS3. Signed-off-by: A...
```diff diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c index 25bd4ede722c..a01e9c5a3fc7 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_host.c +++ b/arch/powerpc/kvm/book3s_64_mmu_host.c @@ -270,6 +270,13 @@ map_again: (rflags & HPTE_R_N) ? '-' : 'x', orig_pte->ea...
9fb244a2c215d1e16ee92cb164b7b61c8dfa3909
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Fix dcbz emulation
Problem Details: On most systems we need to emulate dcbz when running 32 bit guests. So far we've been rather slack, not giving correct DSISR values to the guest. This patch makes the emulation more accurate, introducing a difference between "page not mapped" and "write protection fault". While at it, it also speeds u...
```diff diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index d2b3dabe2dc3..ed5758496372 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c @@ -29,6 +29,7 @@ #include <linux/gfp.h> #include <linux/sched.h> #include <linux/vmalloc.h> +#include <linux/highmem.h> #define VCPU_S...
4b389ca2e733b986c5282690e4e0314f000e6228
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Book3S_32 guest MMU fixes
Problem Details: This patch makes the VSID of mapped pages always reflecting all special cases we have, like split mode. It also changes the tlbie mask to 0x0ffff000 according to the spec. The mask we used before was incorrect. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index 9f5a9921927e..b47b2f516eff 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h @@ -44,6 +44,7 @@ struct kvmppc_sr { bool Ks; bool Kp; bool nx; + bool valid; }; st...
f815bce8940bc28e42e6b924825bb31df2a4bff5
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: check reserved bits only if CR4.PSE=1 or CR4.PAE=1
Problem Details: - Check reserved bits only if CR4.PAE=1 or CR4.PSE=1 when guest #PF occurs - Fix a typo in reset_rsvds_bits_mask() Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 064c3efb49dc..83d2ebce9ea9 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2297,13 +2297,19 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level) /* no rsvd bits for 2 level 4K page table entries */ context->rsvd_bits...
de3e6480f76804fe06d460ddb1920c7daa07f29b
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: fix unlocked CMPXCHG8B emulation
Problem Details: When CMPXCHG8B is executed without LOCK prefix it is racy. Preserve this behaviour in emulator too. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index b8ce53861f68..64c9854f0458 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -1724,7 +1724,6 @@ static inline int emulate_grp9(struct x86_emulate_ctxt *ctxt, (u32) c->regs[VCPU_REGS_RBX]; ctxt->eflags |= EFLG_ZF;...
6550e1f165f384f3a46b60a1be9aba4bc3c2adad
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: add decoding of CMPXCHG8B dst operand
Problem Details: Decode CMPXCHG8B destination operand in decoding stage. Fixes regression introduced by "If LOCK prefix is used dest arg should be memory" commit. This commit relies on dst operand be decoded at the beginning of an instruction emulation. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi ...
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 48de4b890055..b8ce53861f68 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -52,6 +52,7 @@ #define DstMem (3<<1) /* Memory operand. */ #define DstAcc (4<<1) /* Destination Accumulator */ #define DstDI (...
9749a6c0f0a4f88ae7bad4f65d7da32769e9b2b7
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Fix 32-bit build breakage due to typo
Problem Details: Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cc540f27053f..b4d3363b78e6 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3328,7 +3328,7 @@ EXPORT_SYMBOL_GPL(emulator_write_emulated); # define CMPXCHG64(ptr, old, new) CMPXCHG_TYPE(u64, ptr, old, new) #else # define CMPXCHG64(ptr, o...
cf8f70bfe38b326bb80b10f76d6544f571040229
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: fix in/out emulation.
Problem Details: in/out emulation is broken now. The breakage is different depending on where IO device resides. If it is in userspace emulator reports emulation failure since it incorrectly interprets kvm_emulate_pio() return value. If IO device is in the kernel emulation of 'in' will do nothing since kvm_emulate_pio(...
```diff diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index bd469296f5e5..679245c9a55f 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h @@ -119,6 +119,13 @@ struct x86_emulate_ops { const void *new, unsigned int bytes, struct ...
aca06a83071e4e4c9150751db7ea6a46240734fc
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: cleanup grp3 return value
Problem Details: When x86_emulate_insn() does not know how to emulate instruction it exits via cannot_emulate label in all cases except when emulating grp3. Fix that. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 46a7ee3040a0..d696cbd6ff7a 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -1397,7 +1397,6 @@ static inline int emulate_grp3(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) { struct decode_cache *c =...
a41ffb7540cb37426759e688083502d6463421b2
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: If LOCK prefix is used dest arg should be memory.
Problem Details: If LOCK prefix is used dest arg should be memory, otherwise instruction should generate #UD. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index b89a8f217332..46a7ee3040a0 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -1842,7 +1842,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) } /* LOCK prefix is allowed only with some instr...
2e901c4cf4b550ad37840870246e835889cf7322
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: fix return values of syscall/sysenter/sysexit emulations
Problem Details: Return X86EMUL_PROPAGATE_FAULT is fault was injected. Also inject #UD for those instruction when appropriate. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 5afddcfa1a7e..1393bf034243 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -1600,8 +1600,11 @@ emulate_syscall(struct x86_emulate_ctxt *ctxt) u64 msr_data; /* syscall is not available in real mode */ - if (ctxt->mode ==...
1e470be5a10801cb1c5c145f2cd9e0f5ebaf4f2e
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: fix mov dr to inject #UD when needed.
Problem Details: If CR4.DE=1 access to registers DR4/DR5 cause #UD. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 836e97ba45da..5afddcfa1a7e 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2531,9 +2531,12 @@ twobyte_insn: c->dst.type = OP_NONE; /* no writeback */ break; case 0x21: /* mov from dr to reg */ - if (emulator_get_dr(...
6e1e5ffee8d95f9bce71eaa029cb5247b0f2f673
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: fix 0f 01 /5 emulation
Problem Details: It is undefined and should generate #UD. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c3b9334eb248..7c7debb424df 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2490,6 +2490,9 @@ twobyte_insn: (c->src.val & 0x0f), ctxt->vcpu); c->dst.type = OP_NONE; break; + case 5: /* not defined */ + kvm...
5e3ae6c5407ffb23bc4d9871e09d1b222e1b31a4
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: fix mov r/m, sreg emulation.
Problem Details: mov r/m, sreg generates #UD ins sreg is incorrect. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 2c27aa466cf4..c3b9334eb248 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2126,12 +2126,11 @@ special_insn: case 0x8c: { /* mov r/m, sreg */ struct kvm_segment segreg; - if (c->modrm_reg <= 5) + if (c->modrm_reg <=...
6ce5a090a9a0ea4266a2cad058c69e2f27201e11
Analyze and fix the following issue in the Linux kernel code: KVM: coalesced_mmio: fix kvm_coalesced_mmio_init()'s error handling
Problem Details: kvm_coalesced_mmio_init() keeps to hold the addresses of a coalesced mmio ring page and dev even after it has freed them. Also, if this function fails, though it might be rare, it seems to be suggesting the system's serious state: so we'd better stop the works following the kvm_creat_vm(). This patch...
```diff diff --git a/virt/kvm/coalesced_mmio.c b/virt/kvm/coalesced_mmio.c index b66001f8754c..53850177163f 100644 --- a/virt/kvm/coalesced_mmio.c +++ b/virt/kvm/coalesced_mmio.c @@ -120,8 +120,10 @@ int kvm_coalesced_mmio_init(struct kvm *kvm) return ret; out_free_dev: + kvm->coalesced_mmio_dev = NULL; kfree(de...
c73e197bc525e67b71578126b679446f5b88b508
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: fix RCX access during rep emulation
Problem Details: During rep emulation access length to RCX depends on current address mode. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 0b70a364f0f4..4dce80560d26 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -1852,7 +1852,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) if (c->rep_prefix && (c->d & String)) { /* All ...
d6d367d6783e38634377bc66b62bff3ffd717e5f
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: Fix DstAcc decoding.
Problem Details: Set correct operation length. Add RAX (64bit) handling. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 2832a8c07c6a..0b70a364f0f4 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -1194,9 +1194,9 @@ done_prefixes: break; case DstAcc: c->dst.type = OP_REG; - c->dst.bytes = c->op_bytes; + c->dst.bytes = (c->d & ByteOp) ?...
4a5f48f666ccc4ffdbc54241d9cab06806ed7922
Analyze and fix the following issue in the Linux kernel code: KVM: Don't follow an atomic operation by a non-atomic one
Problem Details: Currently emulated atomic operations are immediately followed by a non-atomic operation, so that kvm_mmu_pte_write() can be invoked. This updates the mmu but undoes the whole point of doing things atomically. Fix by only performing the atomic operation and the mmu update, and avoiding the non-atomic ...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 855f3ea9edd1..dd4a7ad63aff 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3234,7 +3234,8 @@ int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa, static int emulator_write_emulated_onepage(unsigned long addr, const void *val,...
daea3e73cb4ac971bee97f333ae027861d00fc0b
Analyze and fix the following issue in the Linux kernel code: KVM: Make locked operations truly atomic
Problem Details: Once upon a time, locked operations were emulated while holding the mmu mutex. Since mmu pages were write protected, it was safe to emulate the writes in a non-atomic manner, since there could be no other writer, either in the guest or in the kernel. These days emulation takes place without holding th...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 7a8fe9051ecf..855f3ea9edd1 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3291,41 +3291,68 @@ int emulator_write_emulated(unsigned long addr, } EXPORT_SYMBOL_GPL(emulator_write_emulated); +#define CMPXCHG_TYPE(t, ptr, old, new) \ + (cm...
d57e2c0740bbdd768dcbafe58cf62174f31d7c2d
Analyze and fix the following issue in the Linux kernel code: KVM: fix assigned_device_enable_host_msix error handling
Problem Details: Free IRQ's and disable MSIX upon failure. Cc: Avi Kivity <avi@redhat.com> Signed-off-by: Jing Zhang <zj.barak@gmail.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c index 02ff2b19dbe2..4d10b1e047f4 100644 --- a/virt/kvm/assigned-dev.c +++ b/virt/kvm/assigned-dev.c @@ -316,12 +316,16 @@ static int assigned_device_enable_host_msix(struct kvm *kvm, kvm_assigned_dev_intr, 0, "kvm_assigned_msix_device", ...
a87fa35514bcf17aeca97245574e3f735cec9074
Analyze and fix the following issue in the Linux kernel code: KVM: fix the errno of ioctl KVM_[UN]REGISTER_COALESCED_MMIO failure
Problem Details: This patch change the errno of ioctl KVM_[UN]REGISTER_COALESCED_MMIO from -EINVAL to -ENXIO if no coalesced mmio dev exists. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/virt/kvm/coalesced_mmio.c b/virt/kvm/coalesced_mmio.c index 36e258029649..b66001f8754c 100644 --- a/virt/kvm/coalesced_mmio.c +++ b/virt/kvm/coalesced_mmio.c @@ -139,7 +139,7 @@ int kvm_vm_ioctl_register_coalesced_mmio(struct kvm *kvm, struct kvm_coalesced_mmio_dev *dev = kvm->coalesced_mmio_dev;...
600f1ec3761671307935a583c46f17fff0fa9b72
Analyze and fix the following issue in the Linux kernel code: KVM: ia64: fix the error of ioctl KVM_IRQ_LINE if no irq chip
Problem Details: If no irq chip in kernel, ioctl KVM_IRQ_LINE will return -EFAULT. But I see in other place such as KVM_[GET|SET]IRQCHIP, -ENXIO is return. So this patch used -ENXIO instead of -EFAULT. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 38d51302f5b3..d7bac1f75af0 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c @@ -979,11 +979,13 @@ long kvm_arch_vm_ioctl(struct file *filp, r = -EFAULT; if (copy_from_user(&irq_event, argp, sizeof irq_event)) go...
160d2f6c0c90713aa3bb93dd344fe0d527342e26
Analyze and fix the following issue in the Linux kernel code: KVM: x86: fix the error of ioctl KVM_IRQ_LINE if no irq chip
Problem Details: If no irq chip in kernel, ioctl KVM_IRQ_LINE will return -EFAULT. But I see in other place such as KVM_[GET|SET]IRQCHIP, -ENXIO is return. So this patch used -ENXIO instead of -EFAULT. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a1cf87fe9f3a..7a8fe9051ecf 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2836,11 +2836,13 @@ long kvm_arch_vm_ioctl(struct file *filp, r = -EFAULT; if (copy_from_user(&irq_event, argp, sizeof irq_event)) goto out; + r = -ENXIO;...
5c0d0920a270b9f2aa20c1cecb162703da32e766
Analyze and fix the following issue in the Linux kernel code: KVM: ia64: fix the error code of ioctl KVM_IA64_VCPU_GET_STACK failure
Problem Details: The ioctl KVM_IA64_VCPU_GET_STACK does not set the error code if copy_to_user() fail, and 0 will be return, we should use -EFAULT instead of 0 in this case, so this patch fixed it. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 7f3c0a2e60cd..38d51302f5b3 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c @@ -1535,8 +1535,10 @@ long kvm_arch_vcpu_ioctl(struct file *filp, goto out; if (copy_to_user(user_stack, stack, - sizeof(struct kvm...
7b06bf2ffa15e119c7439ed0b024d44f66d7b605
Analyze and fix the following issue in the Linux kernel code: KVM: s390: Fix possible memory leak of in kvm_arch_vcpu_create()
Problem Details: This patch fixed possible memory leak in kvm_arch_vcpu_create() under s390, which would happen when kvm_arch_vcpu_create() fails. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Cc: stable@kernel.org Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 49292869a5cd..ee7c713686ce 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -341,11 +341,13 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, rc = kvm_vcpu_init(vcpu, kvm, id); if (rc) - goto out_free_cp...
0d6b35378e80c555e20ca3aa3d3cc609b403cbb6
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Use svm_msrpm_offset in nested_svm_exit_handled_msr
Problem Details: There is a generic function now to calculate msrpm offsets. Use that function in nested_svm_exit_handled_msr() remove the duplicate logic (which had a bug anyway). Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 45a287e51e18..7cb2eb906eca 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1660,40 +1660,27 @@ static void nested_svm_unmap(struct page *page) static int nested_svm_exit_handled_msr(struct vcpu_svm *svm) { - u32 param = svm->vmcb->contr...
d24778265ac9b2602889a5e99c6e7ba777a236df
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Return correct values in nested_svm_exit_handled_msr
Problem Details: The nested_svm_exit_handled_msr() returned an bool which is a bug. I worked by accident because the exected integer return values match with the true and false values. This patch changes the return value to int and let the function return the correct values. Signed-off-by: Joerg Roedel <joerg.roedel@a...
```diff diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 6882be5b9267..07437ca12787 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1552,16 +1552,16 @@ static void nested_svm_unmap(struct page *page) kvm_release_page_dirty(page); } -static bool nested_svm_exit_handled_msr(struct vcpu_svm *sv...
25783602050600b294086d6a0be9a0c2cfe8a3e3
Analyze and fix the following issue in the Linux kernel code: mx31moboard: Fix usb PHY reset
Problem Details: Setup the pad with correct pull-up/down before doing the reset. Assert the PHY enable signal so the reset is really done. Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Acked-by: Valentin Longchamp <valentin.longchamp@epfl.ch> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
```diff diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c index fccb9207b78d..5c4448947d78 100644 --- a/arch/arm/mach-mx3/mach-mx31moboard.c +++ b/arch/arm/mach-mx3/mach-mx31moboard.c @@ -306,37 +306,51 @@ static struct imxmmc_platform_data sdhc1_pdata = { * this pin is dedicate...
ab3c68ee5fd329ba48094d3417fd60e30ea14a87
Analyze and fix the following issue in the Linux kernel code: [S390] debug: enable exception-trace debug facility
Problem Details: The exception-trace facility on x86 and other architectures prints traces to dmesg whenever a user space application crashes. s390 has such a feature since ages however it is called userprocess_debug and is enabled differently. This patch makes sure that whenever one of the two procfs files /proc/sys/...
```diff diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 0d8cd9bbe101..79d0ca086820 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -444,13 +444,6 @@ config FORCE_MAX_ZONEORDER int default "9" -config PROCESS_DEBUG - bool "Show crashed user process info" - help - Say Y to print all process fau...
6377981faf1a4425b0531e577736ef03df97c8f6
Analyze and fix the following issue in the Linux kernel code: [S390] idle time accounting vs. machine checks
Problem Details: A machine check can interrupt the i/o and external interrupt handler anytime. If the machine check occurs while the interrupt handler is waking up from idle vtime_start_cpu can get executed a second time and the int_clock / async_enter_timer values in the lowcore get clobbered. This can confuse the cpu...
```diff diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 258ba88b7b50..8b1a52a137c5 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h @@ -188,15 +188,16 @@ struct s390_idle_data { DECLARE_PER_CPU(struct s390_idle_data, s390_idle); -void vtime_sta...
1be1d76b8a1f622fd3a64778dfe117053f2af1f2
Analyze and fix the following issue in the Linux kernel code: ALSA: asihpi: incorrect range check
Problem Details: The entity_type_to_size[] array has LAST_ENTITY_TYPE (11) number of elements, not LAST_ENTITY_ROLE (17). This only affects the debug output. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
```diff diff --git a/sound/pci/asihpi/hpifunc.c b/sound/pci/asihpi/hpifunc.c index 15f0c7ea0e52..eda26b312324 100644 --- a/sound/pci/asihpi/hpifunc.c +++ b/sound/pci/asihpi/hpifunc.c @@ -3407,7 +3407,7 @@ u16 hpi_entity_alloc_and_pack(const enum e_entity_type type, if (hE) return hE; - HPI_DEBUG_ASSERT(role > en...
11c93605faecfe6f9a28a6f3d14989bad077055a
Analyze and fix the following issue in the Linux kernel code: mtd/maps/pcmciamtd: Fix printk format for ssize_t in debug messages
Problem Details: Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index c4aacbfe288d..a975f2a1bb9b 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c @@ -161,7 +161,7 @@ static void pcmcia_copy_from_remap(struct map_info *map, void *to, unsigned long struct pcmciamtd_dev *dev ...
0617b83fa239db9743a18ce6cc0e556f4d0fd567
Analyze and fix the following issue in the Linux kernel code: ext4: restart ext4_ext_remove_space() after transaction restart
Problem Details: If i_data_sem was internally dropped due to transaction restart, it is necessary to restart path look-up because extents tree was possibly modified by ext4_get_block(). https://bugzilla.kernel.org/show_bug.cgi?id=15827 Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: "Theodore Ts'...
```diff diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index ffcaa1137def..0a47becf668a 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -107,11 +107,8 @@ static int ext4_ext_truncate_extend_restart(handle_t *handle, if (err <= 0) return err; err = ext4_truncate_restart_trans(handle, inode, needed);...
b6eb127d274385d81ce8dd45c98190f097bce1b4
Analyze and fix the following issue in the Linux kernel code: md: remove unneeded sysfs files more promptly
Problem Details: When an array is stopped we need to remove some sysfs files which are dependent on the type of array. We need to delay that deletion as deleting them while holding reconfig_mutex can lead to deadlocks. We currently delay them until the array is completely destroyed. However it is possible to deactiva...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 08f665178c3b..edf777f6fe56 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -507,9 +507,32 @@ static inline int mddev_trylock(mddev_t * mddev) return mutex_trylock(&mddev->reconfig_mutex); } +static struct attribute_group md_redundancy_group; + sta...
f70f362b4a6fe47c239dbfb3efc0cc2c10e4f09c
Analyze and fix the following issue in the Linux kernel code: ext4: Avoid crashing on NULL ptr dereference on a filesystem error
Problem Details: If the EOFBLOCK_FL flag is set when it should not be and the inode is zero length, then eh_entries is zero, and ex is NULL, so dereferencing ex to print ex->ee_block causes a kernel OOPS in ext4_ext_map_blocks(). On top of that, the error message which is printed isn't very helpful. So we fix this by ...
```diff diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 42d8ce91adbd..e40d2b793f2d 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -3370,8 +3370,9 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, */ if (unlikely(path[depth].p_ext == NULL && depth != 0)) { EXT4_ERROR_INODE(ino...
e3cc268fe4a0ad1cbefbc53cee35c80281e609b8
Analyze and fix the following issue in the Linux kernel code: [SCSI] aacraid: expose physical devices for models with newer firmware
Problem Details: The default driver setting is "expose_physicals=0", which means raw physical drives are not exposed to OS. If the user wants to expose connected physical drives, enable "expose_physicals" module parameter. With the new JBOD firmware, physical drives are not available for "expose_physicals>0". In func...
```diff diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 7e26ebc26661..24b1ba06ece4 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -328,6 +328,16 @@ int aac_get_config_status(struct aac_dev *dev, int commit_flag) return status; } +static void aac_e...
15af974dcb22914f29aeb9a9cac5879b0dc3860e
Analyze and fix the following issue in the Linux kernel code: [SCSI] fcoe: fix fcoe module ref counting
Problem Details: Currently fcoe module ref count is used for tracking active fcoe instances, it means each fcoe instance create increments the count while destroy dec the count. The dec is done only if fcoe instance is destroyed from /sysfs but not if destroyed due to NETDEV_UNREGISTER event. So this patch moves only ...
```diff diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 0c825c0944f7..ba75a98c960c 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -851,6 +851,7 @@ static void fcoe_if_destroy(struct fc_lport *lport) /* Release the Scsi_Host */ scsi_host_put(lport->host); + module_pu...
8b889e4f95545241fe90aa426ce9b7395d13ae06
Analyze and fix the following issue in the Linux kernel code: [SCSI] libfcoe: Fix incorrect MAC address clearing
Problem Details: Fix typo in memset. Incorrect length parameter to memset resulting non-zero MAC address in FPMA messages. Signed-off-by: Kaladhar Musunuru <kmusunuru@juniper.net> Acked-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Botto...
```diff diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c index 948364a3342f..080e4eca65be 100644 --- a/drivers/scsi/fcoe/libfcoe.c +++ b/drivers/scsi/fcoe/libfcoe.c @@ -439,7 +439,7 @@ static int fcoe_ctlr_encaps(struct fcoe_ctlr *fip, struct fc_lport *lport, cap->encaps.fd_desc.fip_dlen = dlen ...
34ce27bcf96f5f366e1fa8c4729ffc8a55de4cc3
Analyze and fix the following issue in the Linux kernel code: [SCSI] fcoe: fix a circular locking issue with rtnl and sysfs mutex
Problem Details: Currently rtnl mutex is grabbed during fcoe create, destroy, enable and disable operations while sysfs s_active read mutex is already held, but simultaneously other networking events could try grabbing write s_active mutex while rtnl is already held and that is causing circular lock warning, its detail...
```diff diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 4834d3c130d6..0c825c0944f7 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -801,6 +801,12 @@ skip_oem: /** * fcoe_if_destroy() - Tear down a SW FCoE instance * @lport: The local port to be destroyed + * + * Locki...
721cafafb66f57b461226aa197997f3e5b296f91
Analyze and fix the following issue in the Linux kernel code: [SCSI] fcoe: fixes wrong error exit in fcoe_create
Problem Details: fcoe_create exits using out_nodev label when module is not yet LIVE but this exit path unlocks the rtnl_lock though rtnl lock was not held in this case. So this patch replaces out_nodev with out_nomod to exit w/o unlocking rtnl_lock. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Robert ...
```diff diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index aba839e68014..7022a16b14f6 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -2056,7 +2056,7 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp) */ if (THIS_MODULE->state != MODULE_STATE_LIVE) { ...
b3667f9177359b0594e4f2cd5cc01115f8c7e2af
Analyze and fix the following issue in the Linux kernel code: [SCSI] libfc: set seq_id for incoming sequence
Problem Details: After the recent patch "fixes unnecessary seq id jump" the SCST module fcst stopped working because multi-sequence write data wasn't finding the sequence after the first frame. Add back the setting of the seq_id when the first frame arrives. Also fix indentation on two lines. Signed-off-by: Joe Eykho...
```diff diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index daff880e426e..6addbd6e41e2 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -918,6 +918,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, if (fc_sof_is_init(fr_sof(fp))) { ...
12e9b892002d9af057655d35b44db8ee9243b0dc
Analyze and fix the following issue in the Linux kernel code: ext4: Use bitops to read/modify i_flags in struct ext4_inode_info
Problem Details: At several places we modify EXT4_I(inode)->i_flags without holding i_mutex (ext4_do_update_inode, ...). These modifications are racy and we can lose updates to i_flags. So convert handling of i_flags to use bitops which are atomic. https://bugzilla.kernel.org/show_bug.cgi?id=15792 Signed-off-by: Dmit...
```diff diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 6a2b8bcff641..ea5e6cb7e2a5 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c @@ -110,7 +110,7 @@ static int ext4_readdir(struct file *filp, if (EXT4_HAS_COMPAT_FEATURE(inode->i_sb, EXT4_FEATURE_COMPAT_DIR_INDEX) && - ((EXT4_I(inode)->i_flags & EXT4_...
664f5b2065da188821fe5aa998c6351e8c042d98
Analyze and fix the following issue in the Linux kernel code: ARM: S5PV210: Fix clk_get_rate issue with the clk_h100 clock
Problem Details: The clk_h100 clock represents the IMEM clock for the MSYS domain. This clock rate of this clock is always half of the hclk_msys clock. There is an issue when getting the clock rate of the clk_h100 clock (clock get_rate hclk_h100 always returns clock rate that is equal to the hclk_msys clock rate). Thi...
```diff diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c index 4791642f3e6e..527c9c4262f1 100644 --- a/arch/arm/mach-s5pv210/clock.c +++ b/arch/arm/mach-s5pv210/clock.c @@ -155,11 +155,6 @@ static int s5pv210_clk_ip3_ctrl(struct clk *clk, int enable) return s5p_gatectrl(S5P_CLKGATE_IP3, clk,...
99df95a22f7cfcf85405d4edc07c2d953542f0dd
Analyze and fix the following issue in the Linux kernel code: sunrpc: Include missing smp_lock.h
Problem Details: Now that cache_ioctl_procfs() calls the bkl explicitly, we need to include the relevant header as well. This fixes the following build error: net/sunrpc/cache.c: In function 'cache_ioctl_procfs': net/sunrpc/cache.c:1355: error: implicit declaration of function 'lock_kernel' net/sunrpc/cache.c:1359...
```diff diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 95690a8a4d80..77970fe8bff2 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -28,6 +28,7 @@ #include <linux/workqueue.h> #include <linux/mutex.h> #include <linux/pagemap.h> +#include <linux/smp_lock.h> #include <asm/ioctls.h> #include <li...
24676da469f50f433baa347845639662c561d1f6
Analyze and fix the following issue in the Linux kernel code: ext4: Convert calls of ext4_error() to EXT4_ERROR_INODE()
Problem Details: EXT4_ERROR_INODE() tends to provide better error information and in a more consistent format. Some errors were not even identifying the inode or directory which was corrupted, which made them not very useful. Addresses-Google-Bug: #2507977 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index e3f2700b8be7..6a2b8bcff641 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c @@ -83,11 +83,10 @@ int ext4_check_dir_entry(const char *function, struct inode *dir, error_msg = "inode out of bounds"; if (error_msg != NULL) - __ext4_error(dir->i_sb, function, -...
7845bc3e132605e3e8a1f37748e29281164b65f5
Analyze and fix the following issue in the Linux kernel code: fat: convert to unlocked_ioctl
Problem Details: FAT does not require the BKL in its ioctl function, which is already serialized through a mutex. Since we're already touching the ioctl code, also fix the missing handling of FAT_IOCTL_GET_ATTRIBUTES in the compat code. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: OGAWA Hirofumi <hirofu...
```diff diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 20a1b92e035e..ee42b9e0b16a 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c @@ -753,9 +753,10 @@ static int fat_ioctl_readdir(struct inode *inode, struct file *filp, return ret; } -static int fat_dir_ioctl(struct inode *inode, struct file *filp, - unsigned int ...
263f4a30e4f1dc5385650738c1dcf3728036ecc4
Analyze and fix the following issue in the Linux kernel code: thinkpad-acpi: acpi_evalf fixes
Problem Details: Use acpi_format_exception() in acpi_evalf() instead of logging numeric errors. Also, when ACPICA returns an error, we should not be touching the return object, as it is invalid. In debug mode, acpi_evalf() callers would printk the returned crap (but fortunately, not use it). Signed-off-by: Henrique ...
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 877a7802e830..da3a70b280f2 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -605,9 +605,10 @@ static int acpi_evalf(acpi_handle handle, switch (res_type) { case 'd'...
38e11cdec90f1dd7355db4aed8a1857258e99485
Analyze and fix the following issue in the Linux kernel code: thinkpad-acpi: disclose usertask for ALSA callbacks
Problem Details: Disclose the user task doing ALSA access when requested by the debug bitmask. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index fa412a43f5e0..b03cb3e04582 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -6740,6 +6740,8 @@ static int volume_alsa_vol_get(struct snd_kcontrol *kcontrol, static int v...
289990228155cbc58a35c1b266af00f387caa595
Analyze and fix the following issue in the Linux kernel code: thinkpad-acpi: fix brightness hotkey poll handling
Problem Details: Handle multiple brightness hotkey presses between two polling cycles. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index b03bf5153b0f..fa412a43f5e0 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -2340,6 +2340,21 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, ...
77775838bb76173d7a1ed28f75dfe388962aceca
Analyze and fix the following issue in the Linux kernel code: thinkpad-acpi: let other subdrivers know backlight level range
Problem Details: Extract the backlight level range size detection from the brightness subdriver, and allow the other subdrivers access to that information. This also allows us to relocate some code to a more convenient place. The moved code was largerly unmodified, except for the return type of tpacpi_check_std_acpi_b...
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index a768a69d58d2..b03bf5153b0f 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -304,8 +304,8 @@ static struct { u32 hotkey_tablet:1; u32 light:1; u32 light_status:1; -...
5d756db99a7382d5cd173e912d527e9ee73d0596
Analyze and fix the following issue in the Linux kernel code: thinkpad-acpi: fix volume/mute hotkey poll handling
Problem Details: The hotkey polling code is supposed to generate hotkey messages as close to the way the IBM event-based volume hotkey firmware does as possible, i.e: * Pressing MUTE issues a mute hotkey event, even if already mute; * Pressing Volume up/down issues a volume up/down hotkey event, even if already at ...
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 7817cef6aae1..1f27b350ae01 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -122,6 +122,11 @@ enum { TP_NVRAM_POS_LEVEL_VOLUME = 0, }; +/* Misc NVRAM-related */ +enu...
a318930d06a7a93bd50000c7112f995b459adda7
Analyze and fix the following issue in the Linux kernel code: thinkpad-acpi: X100e quick fixes
Problem Details: The X100e needs some quick fixes to work semi-right with this driver. There are much better ways to do this, but we can start with a quick update and do it properly later. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 21759dacff6c..7817cef6aae1 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -516,6 +516,7 @@ TPACPI_HANDLE(ec, root, "\\_SB.PCI0.ISA.EC0", /* 240, 240x */ "\\_SB.PCI...
f1af6208c8cef81e313ec2e64b44e783c3a11c13
Analyze and fix the following issue in the Linux kernel code: [SCSI] qla2xxx: Updates to ISP82xx support.
Problem Details: 1) Allow transition to NEED RESET state only from READY state for ISP82xx. 2) Avoid infinite ISP aborts when chip reset fails. 3) Code cleanup to remove some of the unused debug code. Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com> Signed-off-by: Santosh Vernekar <santosh.vernekar@qlogic...
```diff diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 4559f5c6c1ae..839610909018 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2764,8 +2764,6 @@ struct qla_hw_data { unsigned long nx_pcibase; /* Base I/O address */ uint8_t *nxdb_rd_ptr; ...
86fbee86e94c7e80c9bb01db0cf68b7977462109
Analyze and fix the following issue in the Linux kernel code: [SCSI] qla2xxx: ensure flash operation and host reset via sg_reset are mutually exclusive
Problem Details: The problem occurring is a hw-race where there's an outstanding read-flash operation occurring while the chip is being reset (done via an sg_reset script). After the chip is paused, the read-flash operation never completes and the DPC thread, while trying to complete the reset, is never able to recover...
```diff diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 62a22cfae20e..3b708606b932 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -281,6 +281,12 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, return count; } + if (qla2x00_wai...
b7d2280c153b33fc60f1a89406d2329137a8b61c
Analyze and fix the following issue in the Linux kernel code: [SCSI] qla2xxx: Cleanup FCP-command-status processing debug statements.
Problem Details: Migrate to a consistent set of debug entries during status-IOCB handling: * group CS_TIMEOUT handling with CS_PORT_UNAVAILABLE and the like (more regrouping of common behaviour). * drop CS_DATA_OVERRUN handling as it now falls into the 'default' case (still returns DID_ERROR). * consolidate CS_R...
```diff diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index a1968eb5e9ce..b92f9a6ee4fb 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1283,6 +1283,7 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) struct sts_entry_24xx ...
3e46f031322bdd8d1f11e17fb7cf00c38b08dd55
Analyze and fix the following issue in the Linux kernel code: [SCSI] qla2xxx: Clear error status after uncorrectable non-fatal errors.
Problem Details: Currently error status is cleared only after the uncorrectable fatal errors in the qla2xxx_pci_slot_reset. This fix is added to clear the error status in qla2xxx_pci_resume. This way for both fatal and non-fatal errors the error status gets cleared properly. Fixes: https://bugzilla.redhat.com/show_bug...
```diff diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index b1adeb71a8b0..f2102db03160 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3697,7 +3697,6 @@ qla2xxx_pci_slot_reset(struct pci_dev *pdev) ret = PCI_ERS_RESULT_RECOVERED; clear_bit(ABORT_ISP_...
25f3a5a2854dce8b8413fd24cc9d5b9e3632be54
Analyze and fix the following issue in the Linux kernel code: PM: PM QOS update fix
Problem Details: This update handles a use case where pm_qos update requests need to silently fail if the update is being sent to a handle that is NULL. The problem was that the original pm_qos silently fails when a request update is passed to a parameter that has not been added to the list yet. This update restores t...
```diff diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index a1aea040eb57..f42d3f737a33 100644 --- a/kernel/pm_qos_params.c +++ b/kernel/pm_qos_params.c @@ -252,19 +252,21 @@ void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req, int pending_update = 0; s32 temp; - spin_lock_irqsave(&pm_...
39a4bade8c1826b658316d66ee81c09b0a4d7d42
Analyze and fix the following issue in the Linux kernel code: ext4: Show journal_checksum option
Problem Details: We failed to show journal_checksum option in /proc/mounts. Fix it. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c597ec73da11..2e8790e801f4 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -942,6 +942,8 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) seq_puts(seq, test_opt(sb, BARRIER) ? "1" : "0"); if (test_opt(sb, JOURNAL_ASYNC_COM...
291dae472a8976ff461f24c848fee2a03f9ea3c8
Analyze and fix the following issue in the Linux kernel code: ext4: Fix for ext4_mb_collect_stats()
Problem Details: Fix ext4_mb_collect_stats() to use the correct test for s_bal_success; it should be testing "best-extent.fe_len >= orig-extent.fe_len" , not "orig-extent.fe_len >= goal-extent.fe_len" . Signed-off-by: Curt Wohlgemuth <curtw@google.org> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index aa499fe11687..e5dcdc9bd56b 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3029,7 +3029,7 @@ static void ext4_mb_collect_stats(struct ext4_allocation_context *ac) if (sbi->s_mb_stats && ac->ac_g_ex.fe_len > 1) { atomic_inc(&sbi->s_bal_reqs...
1b4d0d8ea7b3cbd107f345ab766416f9b38ce66a
Analyze and fix the following issue in the Linux kernel code: [SCSI] libsas: fix deref before check in commit 70b25f890ce
Problem Details: commit 70b25f890ce9f0520c64075ce9225a5b020a513e Author: Tejun Heo <tj@kernel.org> Date: Thu Apr 15 09:00:08 2010 +0900 [SCSI] fix locking around blk_abort_request() Introduced a reference before check problem, fix this by moving the lock shorthand code to be right at the point of actual use. R...
```diff diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 88f744672576..8c496b56556c 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -395,12 +395,13 @@ int sas_ata_init_host_and_port(struct domain_device *found_dev, void sas_ata_task_abort(struct sas_tas...
8a57d9d61a6e361c7bb159dda797672c1df1a691
Analyze and fix the following issue in the Linux kernel code: ext4: check for a good block group before loading buddy pages
Problem Details: This adds a new field in ext4_group_info to cache the largest available block range in a block group; and don't load the buddy pages until *after* we've done a sanity check on the block group. With large allocation requests (e.g., fallocate(), 8MiB) and relatively full partitions, it's easy to have no...
```diff diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index bf938cf7c5f0..d266003cac3e 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1678,6 +1678,7 @@ struct ext4_group_info { ext4_grpblk_t bb_first_free; /* first free block */ ext4_grpblk_t bb_free; /* total free blocks */ ext4_grpblk_t bb_fragments; /* nr...
fbe845ddf368f77f86aa7500f8fd2690f54c66a8
Analyze and fix the following issue in the Linux kernel code: ext4: Remove extraneous newlines in ext4_msg() calls
Problem Details: Addresses-Google-Bug: #2562325 Signed-off-by: Curt Wohlgemuth <curtw@google.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index df43217e4e72..6aa0442811d2 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2276,7 +2276,7 @@ static int mpage_da_map_blocks(struct mpage_da_data *mpd) ext4_msg(mpd->inode->i_sb, KERN_CRIT, "delayed block allocation failed for inode %lu at " ...
84061e07c5fbbbf9dc8aef8fb750fc3a2dfc31f3
Analyze and fix the following issue in the Linux kernel code: ext4: init statistics after journal recovery
Problem Details: Currently block/inode/dir counters initialized before journal was recovered. In fact after journal recovery this info will probably change. And freeblocks it critical for correct delalloc mode accounting. https://bugzilla.kernel.org/show_bug.cgi?id=15768 Signed-off-by: Dmitry Monakhov <dmonakhov@open...
```diff diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 00d09f58f188..d83cdcbd9b31 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2794,24 +2794,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_...
d17413c08cd2b1dd2bf2cfdbb0f7b736b2b2b15c
Analyze and fix the following issue in the Linux kernel code: ext4: clean up inode bitmaps manipulation in ext4_free_inode
Problem Details: - Reorganize locking scheme to batch two atomic operation in to one. This also allow us to state what healthy group must obey following rule ext4_free_inodes_count(sb, gdp) == ext4_count_free(inode_bitmap, NUM); - Fix possible undefined pointer dereference. - Even if group descriptor stats aren't a...
```diff diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 57f6eef6ccd6..52618d5a1773 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -240,56 +240,49 @@ void ext4_free_inode(handle_t *handle, struct inode *inode) if (fatal) goto error_return; - /* Ok, now we can actually update the inode bitmaps.. */...
21ca087a3891efab4d45488db8febee474d26c68
Analyze and fix the following issue in the Linux kernel code: ext4: Do not zero out uninitialized extents beyond i_size
Problem Details: The extents code will sometimes zero out blocks and mark them as initialized instead of splitting an extent into several smaller ones. This optimization however, causes problems if the extent is beyond i_size because fsck will complain if there are uninitialized blocks after i_size as this can not be d...
```diff diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 228eeaf2dccf..ee611daf0748 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2631,11 +2631,21 @@ static int ext4_ext_convert_to_initialized(handle_t *handle, struct ext4_extent *ex2 = NULL; struct ext4_extent *ex3 = NULL; struct ext4_extent...
c445e3e0a5c2804524dec6e55f66d63f6bc5bc3e
Analyze and fix the following issue in the Linux kernel code: ext4: don't scan/accumulate more pages than mballoc will allocate
Problem Details: There was a bug reported on RHEL5 that a 10G dd on a 12G box had a very, very slow sync after that. At issue was the loop in write_cache_pages scanning all the way to the end of the 10G file, even though the subsequent call to mpage_da_submit_io would only actually write a smallish amt; then we went b...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 55bfcd94d1ab..89a31e8869cc 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2350,6 +2350,15 @@ static void mpage_add_bh_to_extent(struct mpage_da_data *mpd, sector_t next; int nrblocks = mpd->b_size >> mpd->inode->i_blkbits; + /* + * XXX Don't go...
35790c0421121364883a167bab8a2e37e1f67f78
Analyze and fix the following issue in the Linux kernel code: tcp: fix MD5 (RFC2385) support
Problem Details: TCP MD5 support uses percpu data for temporary storage. It currently disables preemption so that same storage cannot be reclaimed by another thread on same cpu. We also have to make sure a softirq handler wont try to use also same context. Various bug reports demonstrated corruptions. Fix is to disab...
```diff diff --git a/include/net/tcp.h b/include/net/tcp.h index 75be5a28815d..aa04b9a5093b 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1197,30 +1197,15 @@ extern int tcp_v4_md5_do_del(struct sock *sk, extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); extern void tcp_f...
a1aa3483041bd3691c7f029272ccef4ce70bd957
Analyze and fix the following issue in the Linux kernel code: xfrm: fix policy unreferencing on larval drop
Problem Details: I mistakenly had the error path to use num_pols to decide how many policies we need to drop (cruft from earlier patch set version which did not handle socket policies right). This is wrong since normally we do not keep explicit references (instead we hold reference to the cache entry which holds refer...
```diff diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 31f4ba43b48f..f4ea3a08e5a1 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1805,7 +1805,7 @@ restart: /* EREMOTE tells the caller to generate * a one-shot blackhole route. */ dst_release(dst); - xfrm_pols_put(...
00b7c3395aec3df43de5bd02a3c5a099ca51169f
Analyze and fix the following issue in the Linux kernel code: sysctl: refactor integer handling proc code
Problem Details: (Based on Octavian's work, and I modified a lot.) As we are about to add another integer handling proc function a little bit of cleanup is in order: add a few helper functions to improve code readability and decrease code duplication. In the process a bug is also fixed: if the user specifies a number...
```diff diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 8686b0f5fc12..4a976208de29 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2040,8 +2040,122 @@ int proc_dostring(struct ctl_table *table, int write, buffer, lenp, ppos); } +static size_t proc_skip_spaces(char **buf) +{ + size_t ret; + cha...
e0f43752a942b7be1bc06b9fd74e20ae337c1cca
Analyze and fix the following issue in the Linux kernel code: bridge: update sysfs link names if port device names have changed
Problem Details: Links for each port are created in sysfs using the device name, but this could be changed after being added to the bridge. As well as being unable to remove interfaces after this occurs (because userspace tools don't recognise the new name, and the kernel won't recognise the old name), adding another ...
```diff diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index b93ec51fa7ac..942f239a2132 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c @@ -261,3 +261,4 @@ const struct inode_operations sysfs_symlink_inode_operations = { EXPORT_SYMBOL_GPL(sysfs_create_link); EXPORT_SYMBOL_GPL(sysfs_remove_link); +EXP...
6b0310fbf087ad6e9e3b8392adca97cd77184084
Analyze and fix the following issue in the Linux kernel code: ext4: don't return to userspace after freezing the fs with a mutex held
Problem Details: ext4_freeze() used jbd2_journal_lock_updates() which takes the j_barrier mutex, and then returns to userspace. The kernel does not like this: ================================================ [ BUG: lock held when returning to user space! ] ------------------------------------------------ lvcreate/107...
```diff diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e14d22c170d5..00d09f58f188 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -241,6 +241,7 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks) if (sb->s_flags & MS_RDONLY) return ERR_PTR(-EROFS); + vfs_check_frozen(sb, SB_FREEZE...
42007efd569f1cf3bfb9a61da60ef6c2179508ca
Analyze and fix the following issue in the Linux kernel code: ext4: check s_log_groups_per_flex in online resize code
Problem Details: If groups_per_flex < 2, sbi->s_flex_groups[] doesn't get filled out, and every other access to this first tests s_log_groups_per_flex; same thing needs to happen in resize or we'll wander off into a null pointer when doing an online resize of the file system. Thanks to Christoph Biedl, who came up wit...
```diff diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 5692c48754a0..6df797eb9aeb 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -911,7 +911,8 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input) percpu_counter_add(&sbi->s_freeinodes_counter, EXT4_INODES_PER_GROUP(s...
35121c9860316d7799cea0fbc359a9186e7c2747
Analyze and fix the following issue in the Linux kernel code: ext4: fix quota accounting in case of fallocate
Problem Details: allocated_meta_data is already included in 'used' variable. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 81d605412844..55bfcd94d1ab 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1126,7 +1126,8 @@ void ext4_da_update_reserve_space(struct inode *inode, */ if (allocated_meta_blocks) dquot_claim_block(inode, allocated_meta_blocks); - dquot_relea...
cafcd80d216bc2136b8edbb794327e495792c666
Analyze and fix the following issue in the Linux kernel code: lockup_detector: Cross arch compile fixes
Problem Details: Combining the softlockup and hardlockup code causes watchdog.c to build even without the hardlockup detection support. So if an arch, that has the previous and the new nmi watchdog implementations cohabiting, wants to know if the generic one is in use, CONFIG_LOCKUP_DETECTOR is not a reliable check. W...
```diff diff --git a/arch/x86/kernel/apic/Makefile b/arch/x86/kernel/apic/Makefile index 52f32e0ea194..910f20b457c4 100644 --- a/arch/x86/kernel/apic/Makefile +++ b/arch/x86/kernel/apic/Makefile @@ -3,10 +3,10 @@ # obj-$(CONFIG_X86_LOCAL_APIC) += apic.o apic_noop.o probe_$(BITS).o ipi.o -ifneq ($(CONFIG_LOCKUP_DETE...
c1ec5fefd9cd9ccb020966a49a3c7f44b25d9e84
Analyze and fix the following issue in the Linux kernel code: perf newt: Fix the 'A'/'a' shortcut for annotate
Problem Details: Reported-by: Ingo Molnar <mingo@elte.hu> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalh...
```diff diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c index 5ded2f0d3e4d..094887f45d05 100644 --- a/tools/perf/util/newt.c +++ b/tools/perf/util/newt.c @@ -892,10 +892,10 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na if (choice == -1) continue; -do_annotate:...
4e73238d163c6fcf001264832701d2a6d4927672
Analyze and fix the following issue in the Linux kernel code: MIPS: Oprofile: Fix Loongson irq handler
Problem Details: The interrupt enable bit for the performance counters is in the Control Register $24, not in the counter register. loongson2_perfcount_handler(), we need to use Reported-by: Xu Hengyang <hengyang@mail.ustc.edu.cn> Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips...
```diff diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c index 29e2326b6257..fa3bf661ae29 100644 --- a/arch/mips/oprofile/op_model_loongson2.c +++ b/arch/mips/oprofile/op_model_loongson2.c @@ -122,7 +122,7 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev...
95e8f634d7a3ea5af40ec3fa42c8a152fd3a0624
Analyze and fix the following issue in the Linux kernel code: MIPS FPU emulator: allow Cause bits of FCSR to be writeable by ctc1
Problem Details: In the FPU emulator code of the MIPS, the Cause bits of the FCSR register are not currently writeable by the ctc1 instruction. In odd corner cases, this can cause problems. For example, a case existed where a divide-by-zero exception was generated by the FPU, and the signal handler attemp...
```diff diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 49382d5e891a..c6e3c93ce7c7 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h @@ -134,6 +134,12 @@ #define FPU_CSR_COND6 0x40000000 /* $fcc6 */ #define FPU_CSR_COND7 0x80000000 ...
43aa7ac736a4e21aae4882bd8f7c67403aed45b8
Analyze and fix the following issue in the Linux kernel code: lib/btree: fix possible NULL pointer dereference
Problem Details: mempool_alloc() can return null in atomic case. Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Cc: Joern Engel <joern@logfs.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/lib/btree.c b/lib/btree.c index 41859a820218..c9c6f0351526 100644 --- a/lib/btree.c +++ b/lib/btree.c @@ -95,7 +95,8 @@ static unsigned long *btree_node_alloc(struct btree_head *head, gfp_t gfp) unsigned long *node; node = mempool_alloc(head->mempool, gfp); - memset(node, 0, NODESIZE); + if (...
8c0b742ca7a7d21de0ddc87eda6ef0b282e4de18
Analyze and fix the following issue in the Linux kernel code: ARM: 6134/1: Handle instruction cache maintenance fault properly
Problem Details: Between "clean D line..." and "invalidate I line" operations in v7_coherent_user_range(), the memory page may get swapped out. And the fault on "invalidate I line" could not be properly handled causing the oops. In ARMv6 "external abort on linefetch" replaced by "instruction cache maintenance fault". ...
```diff diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 9d40c341e07e..92f5801f99c1 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -463,7 +463,12 @@ static struct fsr_info { { do_bad, SIGILL, BUS_ADRALN, "alignment exception" }, { do_bad, SIGKILL, 0, "terminal exception" }, ...
49aea0fd95495538230e19f58e217fb06ffdbfeb
Analyze and fix the following issue in the Linux kernel code: ARM: nwfpe: allow debugging output to be configured at runtime
Problem Details: Enabling CONFIG_USER_DEBUG allows NWFPE to complain about every FP exception, which with some programs can cause the kernel message log to fill with NWFPE debug, swamping out other messages. This change allows NWFPE debugging to be configured at run time. Signed-off-by: Russell King <rmk+kernel@arm.l...
```diff diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c index 4c0ab50f399a..cb7658e8acc5 100644 --- a/arch/arm/nwfpe/fpmodule.c +++ b/arch/arm/nwfpe/fpmodule.c @@ -24,6 +24,7 @@ #include "fpa11.h" #include <linux/module.h> +#include <linux/moduleparam.h> /* XXX */ #include <linux/errno.h> @@ ...
b7072c63c1b0611042ba6ecf0152a33c7b806e67
Analyze and fix the following issue in the Linux kernel code: ARM: convert /proc/cpu/aligment to seq_file
Problem Details: Convert code away from ->read_proc/->write_proc interfaces. Switch to proc_create()/proc_create_data() which makes addition of proc entries reliable wrt NULL ->proc_fops, NULL ->data and so on. Problem with ->read_proc et al is described here commit 786d7e1612f0b0adb6046f19b906609e4fe8b1ba "Fix rmmod...
```diff diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index edddd66faac6..28b7c2776198 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c @@ -17,6 +17,7 @@ #include <linux/errno.h> #include <linux/string.h> #include <linux/proc_fs.h> +#include <linux/seq_file.h> #include <linux/init...
265624495f5acf6077f8f8d264f8170573d8d752
Analyze and fix the following issue in the Linux kernel code: Fix double-free in logfs
Problem Details: iput() is needed *until* we'd done successful d_alloc_root() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/fs/logfs/super.c b/fs/logfs/super.c index 5866ee6e1327..d7c23ed8349a 100644 --- a/fs/logfs/super.c +++ b/fs/logfs/super.c @@ -333,27 +333,27 @@ static int logfs_get_sb_final(struct super_block *sb, struct vfsmount *mnt) goto fail; sb->s_root = d_alloc_root(rootdir); - if (!sb->s_root) - got...
d83c49f3e36cecd2e8823b6c48ffba083b8a5704
Analyze and fix the following issue in the Linux kernel code: Fix the regression created by "set S_DEAD on unlink()..." commit
Problem Details: 1) i_flags simply doesn't work for mount/unlink race prevention; we may have many links to file and rm on one of those obviously shouldn't prevent bind on top of another later on. To fix it right way we need to mark _dentry_ as unsuitable for mounting upon; new flag (DCACHE_CANT_MOUNT) is protected by...
```diff diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 4a6366a42129..111a01a747fc 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c @@ -380,6 +380,7 @@ static int usbfs_rmdir(struct inode *dir, struct dentry *dentry) mutex_lock(&inode->i_mutex); dentry_unhash(dentry); if...
1ff3d7d79204612ebe2e611d2592f8898908ca00
Analyze and fix the following issue in the Linux kernel code: x86, perf: P4 PMU - fix counters management logic
Problem Details: Jaswinder reported this #GP: | | Message from syslogd@ht at May 14 09:39:32 ... | kernel:[ 314.908612] EIP: [<c100ccca>] | x86_perf_event_set_period+0x19d/0x1b2 SS:ESP 0068:edac3d70 | Ming has narrowed it down to a comparision issue between arguments with different sizes and signs. As result ev...
```diff diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index cb875b1e2e87..424fc8de68e4 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c @@ -18,7 +18,7 @@ struct p4_event_bind { unsigned int opcode; /* Event code and ESCR selector */...
16a2164bb03612efe79a76c73da6da44445b9287
Analyze and fix the following issue in the Linux kernel code: profile: fix stats and data leakage
Problem Details: If the kernel is large or the profiling step small, /proc/profile leaks data and readprofile shows silly stats, until readprofile -r has reset the buffer: clear the prof_buffer when it is vmalloc()ed. Signed-off-by: Hugh Dickins <hughd@google.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <t...
```diff diff --git a/kernel/profile.c b/kernel/profile.c index a55d3a367ae8..dfadc5b729f1 100644 --- a/kernel/profile.c +++ b/kernel/profile.c @@ -127,8 +127,10 @@ int __ref profile_init(void) return 0; prof_buffer = vmalloc(buffer_bytes); - if (prof_buffer) + if (prof_buffer) { + memset(prof_buffer, 0, buffer_...
95cc2c70c139936a2142bcd583da8af6f9d88efb
Analyze and fix the following issue in the Linux kernel code: sata_nv: use ata_pci_sff_activate_host() instead of ata_host_activate()
Problem Details: sata_nv was incorrectly using ata_host_activate() instead of ata_pci_sff_activate_host() leading to IRQ assignment failure in legacy mode. Fix it. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Robert Hancock <hancockr@shaw.ca> Cc: stable@kernel.org Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
```diff diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 2a98b09ab735..9d3dbc8a1184 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c @@ -2479,8 +2479,7 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } pci_set_master(pdev); - return ata_host_activate(...
15ddb4aec54422ead137b03ea4e9b3f5db3f7cc2
Analyze and fix the following issue in the Linux kernel code: NFSD: don't report compiled-out versions as present
Problem Details: The /proc/fs/nfsd/versions file calls nfsd_vers() to check whether the particular nfsd version is present/available. The problem is that once I turn off e.g. NFSD-V4 this call returns -1 which is true from the callers POV which is wrong. The proposal is to report false in that case. The bug has exist...
```diff diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 171699eb07c8..06b2a26edfe0 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -120,7 +120,7 @@ u32 nfsd_supported_minorversion; int nfsd_vers(int vers, enum vers_op change) { if (vers < NFSD_MINVERS || vers >= NFSD_NRVERS) - return -1; + return 0...
3842e835490cdf17013b30a788f6311bdcfd0571
Analyze and fix the following issue in the Linux kernel code: libata: don't flush dcache on slab pages
Problem Details: page_mapping() check this via VM_BUG_ON(PageSlab(page)) so we bug here with the according debuging turned on. Future TODO: replace this with a flush_dcache_page_for_pio() API Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Cc: stable@...
```diff diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index b7f7f8557fee..c0a905438896 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c @@ -919,7 +919,7 @@ static void ata_pio_sector(struct ata_queued_cmd *qc) do_write); } - if (!do_write) + if (!do_write && !PageS...
83f2b9630c5875ee872c11d98a0e26888514c1b3
Analyze and fix the following issue in the Linux kernel code: ahci: implement AHCI_HFLAG_NO_FPDMA_AA and update NV quirks
Problem Details: It turns out different generations of MCPs have differing quirks. * MCP 65-73 : FPDMA AA broken, lies about PMP support, forgets to report NCQ * MCP 77-79 : FPDMA AA broken, lies about PMP support * MCP 89 : FPDMA AA broken Instead of turngin off FPDMA AA on all NVIDIAs, implement HFLAG_NO_FPDMA_A...
```diff diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index ec1221879f9a..c44d11237db4 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -63,6 +63,8 @@ enum board_ids { /* board IDs for specific chipsets in alphabetical order */ board_ahci_mcp65, + board_ahci_mcp77, + board_ahci_mcp89, board_ah...
b5a2104c98cb603f7053e4b0309fb88f15d6be86
Analyze and fix the following issue in the Linux kernel code: Staging: udlfb: fix coding style issues
Problem Details: This is a patch to the file udlfb.c that fixes a missing KERN_INFO and removes one whitespace before a newline. Signed-off-by: Soeren Moeller <soerenmoeller2001@gmail.com> Cc: Bernie Thompson <bernie@plugable.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/udlfb/udlfb.c b/drivers/staging/udlfb/udlfb.c index 12444f2014e4..7fc1d611a78a 100644 --- a/drivers/staging/udlfb/udlfb.c +++ b/drivers/staging/udlfb/udlfb.c @@ -1438,7 +1438,7 @@ static int __init dlfb_module_init(void) if (res) err("usb_register failed. Error number %d", res)...