Skip to content

Commit 6b6cbc1

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts were simply overlapping changes. In the net/ipv4/route.c case the code had simply moved around a little bit and the same fix was made in both 'net' and 'net-next'. In the net/sched/sch_generic.c case a fix in 'net' happened at the same time that a new argument was added to qdisc_hash_add(). Signed-off-by: David S. Miller <[email protected]>
2 parents ce07183 + 1bf4b12 commit 6b6cbc1

File tree

298 files changed

+3243
-1816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+3243
-1816
lines changed

.mailmap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ Linas Vepstas <[email protected]>
9999
100100
101101
Mark Brown <[email protected]>
102+
103+
102104
Matthieu CASTET <[email protected]>
103105
Mauro Carvalho Chehab <[email protected]> <[email protected]>
104106
Mauro Carvalho Chehab <[email protected]> <[email protected]>
@@ -171,6 +173,7 @@ Vlad Dogaru <[email protected]> <[email protected]>
171173
172174
173175
Takashi YOSHII <[email protected]>
176+
174177
Yusuke Goda <[email protected]>
175178
Gustavo Padovan <[email protected]>
176179
Gustavo Padovan <[email protected]>

Documentation/filesystems/Locking

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ prototypes:
5858
int (*permission) (struct inode *, int, unsigned int);
5959
int (*get_acl)(struct inode *, int);
6060
int (*setattr) (struct dentry *, struct iattr *);
61-
int (*getattr) (const struct path *, struct dentry *, struct kstat *,
62-
u32, unsigned int);
61+
int (*getattr) (const struct path *, struct kstat *, u32, unsigned int);
6362
ssize_t (*listxattr) (struct dentry *, char *, size_t);
6463
int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
6564
void (*update_time)(struct inode *, struct timespec *, int);

Documentation/filesystems/porting

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,3 +600,9 @@ in your dentry operations instead.
600600
[recommended]
601601
->readlink is optional for symlinks. Don't set, unless filesystem needs
602602
to fake something for readlink(2).
603+
--
604+
[mandatory]
605+
->getattr() is now passed a struct path rather than a vfsmount and
606+
dentry separately, and it now has request_mask and query_flags arguments
607+
to specify the fields and sync type requested by statx. Filesystems not
608+
supporting any statx-specific features may ignore the new arguments.

Documentation/filesystems/vfs.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,7 @@ struct inode_operations {
382382
int (*permission) (struct inode *, int);
383383
int (*get_acl)(struct inode *, int);
384384
int (*setattr) (struct dentry *, struct iattr *);
385-
int (*getattr) (const struct path *, struct dentry *, struct kstat *,
386-
u32, unsigned int);
385+
int (*getattr) (const struct path *, struct kstat *, u32, unsigned int);
387386
ssize_t (*listxattr) (struct dentry *, char *, size_t);
388387
void (*update_time)(struct inode *, struct timespec *, int);
389388
int (*atomic_open)(struct inode *, struct dentry *, struct file *,

Documentation/pinctrl.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,15 @@ static struct pinctrl_desc foo_desc = {
7777

7878
int __init foo_probe(void)
7979
{
80+
int error;
81+
8082
struct pinctrl_dev *pctl;
8183

82-
return pinctrl_register_and_init(&foo_desc, <PARENT>, NULL, &pctl);
84+
error = pinctrl_register_and_init(&foo_desc, <PARENT>, NULL, &pctl);
85+
if (error)
86+
return error;
87+
88+
return pinctrl_enable(pctl);
8389
}
8490

8591
To enable the pinctrl subsystem and the subgroups for PINMUX and PINCONF and

Documentation/process/stable-kernel-rules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ specified in the following format in the sign-off area:
124124

125125
.. code-block:: none
126126
127-
Cc: <[email protected]> # 3.3.x-
127+
Cc: <[email protected]> # 3.3.x
128128
129129
The tag has the meaning of:
130130

Documentation/virtual/kvm/devices/arm-vgic.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ Groups:
8383

8484
Bits for undefined preemption levels are RAZ/WI.
8585

86+
For historical reasons and to provide ABI compatibility with userspace we
87+
export the GICC_PMR register in the format of the GICH_VMCR.VMPriMask
88+
field in the lower 5 bits of a word, meaning that userspace must always
89+
use the lower 5 bits to communicate with the KVM device and must shift the
90+
value left by 3 places to obtain the actual priority mask level.
91+
8692
Limitations:
8793
- Priorities are not implemented, and registers are RAZ/WI
8894
- Currently only implemented for KVM_DEV_TYPE_ARM_VGIC_V2.

MAINTAINERS

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,14 +4124,13 @@ F: drivers/block/drbd/
41244124
F: lib/lru_cache.c
41254125
F: Documentation/blockdev/drbd/
41264126

4127-
DRIVER CORE, KOBJECTS, DEBUGFS, KERNFS AND SYSFS
4127+
DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS
41284128
M: Greg Kroah-Hartman <[email protected]>
41294129
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
41304130
S: Supported
41314131
F: Documentation/kobject.txt
41324132
F: drivers/base/
41334133
F: fs/debugfs/
4134-
F: fs/kernfs/
41354134
F: fs/sysfs/
41364135
F: include/linux/debugfs.h
41374136
F: include/linux/kobj*
@@ -7216,6 +7215,14 @@ F: arch/mips/include/uapi/asm/kvm*
72167215
F: arch/mips/include/asm/kvm*
72177216
F: arch/mips/kvm/
72187217

7218+
KERNFS
7219+
M: Greg Kroah-Hartman <[email protected]>
7220+
M: Tejun Heo <[email protected]>
7221+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
7222+
S: Supported
7223+
F: include/linux/kernfs.h
7224+
F: fs/kernfs/
7225+
72197226
KEXEC
72207227
M: Eric Biederman <[email protected]>
72217228
W: http://kernel.org/pub/linux/utils/kernel/kexec/
@@ -13311,7 +13318,7 @@ F: drivers/virtio/
1331113318
F: tools/virtio/
1331213319
F: drivers/net/virtio_net.c
1331313320
F: drivers/block/virtio_blk.c
13314-
F: include/linux/virtio_*.h
13321+
F: include/linux/virtio*.h
1331513322
F: include/uapi/linux/virtio_*.h
1331613323
F: drivers/crypto/virtio/
1331713324

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
VERSION = 4
22
PATCHLEVEL = 11
33
SUBLEVEL = 0
4-
EXTRAVERSION = -rc5
4+
EXTRAVERSION = -rc6
55
NAME = Fearless Coyote
66

77
# *DOCUMENTATION*

arch/alpha/kernel/osf_sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)
12901290
/* copy relevant bits of struct timex. */
12911291
if (copy_from_user(&txc, txc_p, offsetof(struct timex32, time)) ||
12921292
copy_from_user(&txc.tick, &txc_p->tick, sizeof(struct timex32) -
1293-
offsetof(struct timex32, time)))
1293+
offsetof(struct timex32, tick)))
12941294
return -EFAULT;
12951295

12961296
ret = do_adjtimex(&txc);

arch/arm/kvm/arm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,9 @@ static void cpu_hyp_reinit(void)
11241124
if (__hyp_get_vectors() == hyp_default_vectors)
11251125
cpu_init_hyp_mode(NULL);
11261126
}
1127+
1128+
if (vgic_present)
1129+
kvm_vgic_init_cpu_hardware();
11271130
}
11281131

11291132
static void cpu_hyp_reset(void)

arch/arm/kvm/mmu.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,18 @@ static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size)
292292
phys_addr_t addr = start, end = start + size;
293293
phys_addr_t next;
294294

295+
assert_spin_locked(&kvm->mmu_lock);
295296
pgd = kvm->arch.pgd + stage2_pgd_index(addr);
296297
do {
297298
next = stage2_pgd_addr_end(addr, end);
298299
if (!stage2_pgd_none(*pgd))
299300
unmap_stage2_puds(kvm, pgd, addr, next);
301+
/*
302+
* If the range is too large, release the kvm->mmu_lock
303+
* to prevent starvation and lockup detector warnings.
304+
*/
305+
if (next != end)
306+
cond_resched_lock(&kvm->mmu_lock);
300307
} while (pgd++, addr = next, addr != end);
301308
}
302309

@@ -803,13 +810,15 @@ void stage2_unmap_vm(struct kvm *kvm)
803810
int idx;
804811

805812
idx = srcu_read_lock(&kvm->srcu);
813+
down_read(&current->mm->mmap_sem);
806814
spin_lock(&kvm->mmu_lock);
807815

808816
slots = kvm_memslots(kvm);
809817
kvm_for_each_memslot(memslot, slots)
810818
stage2_unmap_memslot(kvm, memslot);
811819

812820
spin_unlock(&kvm->mmu_lock);
821+
up_read(&current->mm->mmap_sem);
813822
srcu_read_unlock(&kvm->srcu, idx);
814823
}
815824

@@ -829,7 +838,10 @@ void kvm_free_stage2_pgd(struct kvm *kvm)
829838
if (kvm->arch.pgd == NULL)
830839
return;
831840

841+
spin_lock(&kvm->mmu_lock);
832842
unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
843+
spin_unlock(&kvm->mmu_lock);
844+
833845
/* Free the HW pgd, one page at a time */
834846
free_pages_exact(kvm->arch.pgd, S2_PGD_SIZE);
835847
kvm->arch.pgd = NULL;
@@ -1801,6 +1813,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
18011813
(KVM_PHYS_SIZE >> PAGE_SHIFT))
18021814
return -EFAULT;
18031815

1816+
down_read(&current->mm->mmap_sem);
18041817
/*
18051818
* A memory region could potentially cover multiple VMAs, and any holes
18061819
* between them, so iterate over all of them to find out if we can map
@@ -1844,8 +1857,10 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
18441857
pa += vm_start - vma->vm_start;
18451858

18461859
/* IO region dirty page logging not allowed */
1847-
if (memslot->flags & KVM_MEM_LOG_DIRTY_PAGES)
1848-
return -EINVAL;
1860+
if (memslot->flags & KVM_MEM_LOG_DIRTY_PAGES) {
1861+
ret = -EINVAL;
1862+
goto out;
1863+
}
18491864

18501865
ret = kvm_phys_addr_ioremap(kvm, gpa, pa,
18511866
vm_end - vm_start,
@@ -1857,14 +1872,16 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
18571872
} while (hva < reg_end);
18581873

18591874
if (change == KVM_MR_FLAGS_ONLY)
1860-
return ret;
1875+
goto out;
18611876

18621877
spin_lock(&kvm->mmu_lock);
18631878
if (ret)
18641879
unmap_stage2_range(kvm, mem->guest_phys_addr, mem->memory_size);
18651880
else
18661881
stage2_flush_memslot(kvm, memslot);
18671882
spin_unlock(&kvm->mmu_lock);
1883+
out:
1884+
up_read(&current->mm->mmap_sem);
18681885
return ret;
18691886
}
18701887

arch/arm/mm/dma-mapping.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,13 +935,31 @@ static void arm_coherent_dma_free(struct device *dev, size_t size, void *cpu_add
935935
__arm_dma_free(dev, size, cpu_addr, handle, attrs, true);
936936
}
937937

938+
/*
939+
* The whole dma_get_sgtable() idea is fundamentally unsafe - it seems
940+
* that the intention is to allow exporting memory allocated via the
941+
* coherent DMA APIs through the dma_buf API, which only accepts a
942+
* scattertable. This presents a couple of problems:
943+
* 1. Not all memory allocated via the coherent DMA APIs is backed by
944+
* a struct page
945+
* 2. Passing coherent DMA memory into the streaming APIs is not allowed
946+
* as we will try to flush the memory through a different alias to that
947+
* actually being used (and the flushes are redundant.)
948+
*/
938949
int arm_dma_get_sgtable(struct device *dev, struct sg_table *sgt,
939950
void *cpu_addr, dma_addr_t handle, size_t size,
940951
unsigned long attrs)
941952
{
942-
struct page *page = pfn_to_page(dma_to_pfn(dev, handle));
953+
unsigned long pfn = dma_to_pfn(dev, handle);
954+
struct page *page;
943955
int ret;
944956

957+
/* If the PFN is not valid, we do not have a struct page */
958+
if (!pfn_valid(pfn))
959+
return -ENXIO;
960+
961+
page = pfn_to_page(pfn);
962+
945963
ret = sg_alloc_table(sgt, 1, GFP_KERNEL);
946964
if (unlikely(ret))
947965
return ret;

arch/arm/mm/nommu.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ static inline void set_vbar(unsigned long val)
303303
*/
304304
static inline bool security_extensions_enabled(void)
305305
{
306-
return !!cpuid_feature_extract(CPUID_EXT_PFR1, 4);
306+
/* Check CPUID Identification Scheme before ID_PFR1 read */
307+
if ((read_cpuid_id() & 0x000f0000) == 0x000f0000)
308+
return !!cpuid_feature_extract(CPUID_EXT_PFR1, 4);
309+
return 0;
307310
}
308311

309312
static unsigned long __init setup_vectors_base(void)

arch/arm/probes/kprobes/core.c

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,20 @@ void __kprobes kprobe_handler(struct pt_regs *regs)
266266
#endif
267267

268268
if (p) {
269-
if (cur) {
269+
if (!p->ainsn.insn_check_cc(regs->ARM_cpsr)) {
270+
/*
271+
* Probe hit but conditional execution check failed,
272+
* so just skip the instruction and continue as if
273+
* nothing had happened.
274+
* In this case, we can skip recursing check too.
275+
*/
276+
singlestep_skip(p, regs);
277+
} else if (cur) {
270278
/* Kprobe is pending, so we're recursing. */
271279
switch (kcb->kprobe_status) {
272280
case KPROBE_HIT_ACTIVE:
273281
case KPROBE_HIT_SSDONE:
282+
case KPROBE_HIT_SS:
274283
/* A pre- or post-handler probe got us here. */
275284
kprobes_inc_nmissed_count(p);
276285
save_previous_kprobe(kcb);
@@ -279,11 +288,16 @@ void __kprobes kprobe_handler(struct pt_regs *regs)
279288
singlestep(p, regs, kcb);
280289
restore_previous_kprobe(kcb);
281290
break;
291+
case KPROBE_REENTER:
292+
/* A nested probe was hit in FIQ, it is a BUG */
293+
pr_warn("Unrecoverable kprobe detected at %p.\n",
294+
p->addr);
295+
/* fall through */
282296
default:
283297
/* impossible cases */
284298
BUG();
285299
}
286-
} else if (p->ainsn.insn_check_cc(regs->ARM_cpsr)) {
300+
} else {
287301
/* Probe hit and conditional execution check ok. */
288302
set_current_kprobe(p);
289303
kcb->kprobe_status = KPROBE_HIT_ACTIVE;
@@ -304,13 +318,6 @@ void __kprobes kprobe_handler(struct pt_regs *regs)
304318
}
305319
reset_current_kprobe();
306320
}
307-
} else {
308-
/*
309-
* Probe hit but conditional execution check failed,
310-
* so just skip the instruction and continue as if
311-
* nothing had happened.
312-
*/
313-
singlestep_skip(p, regs);
314321
}
315322
} else if (cur) {
316323
/* We probably hit a jprobe. Call its break handler. */
@@ -434,6 +441,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
434441
struct hlist_node *tmp;
435442
unsigned long flags, orig_ret_address = 0;
436443
unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline;
444+
kprobe_opcode_t *correct_ret_addr = NULL;
437445

438446
INIT_HLIST_HEAD(&empty_rp);
439447
kretprobe_hash_lock(current, &head, &flags);
@@ -456,14 +464,34 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
456464
/* another task is sharing our hash bucket */
457465
continue;
458466

467+
orig_ret_address = (unsigned long)ri->ret_addr;
468+
469+
if (orig_ret_address != trampoline_address)
470+
/*
471+
* This is the real return address. Any other
472+
* instances associated with this task are for
473+
* other calls deeper on the call stack
474+
*/
475+
break;
476+
}
477+
478+
kretprobe_assert(ri, orig_ret_address, trampoline_address);
479+
480+
correct_ret_addr = ri->ret_addr;
481+
hlist_for_each_entry_safe(ri, tmp, head, hlist) {
482+
if (ri->task != current)
483+
/* another task is sharing our hash bucket */
484+
continue;
485+
486+
orig_ret_address = (unsigned long)ri->ret_addr;
459487
if (ri->rp && ri->rp->handler) {
460488
__this_cpu_write(current_kprobe, &ri->rp->kp);
461489
get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE;
490+
ri->ret_addr = correct_ret_addr;
462491
ri->rp->handler(ri, regs);
463492
__this_cpu_write(current_kprobe, NULL);
464493
}
465494

466-
orig_ret_address = (unsigned long)ri->ret_addr;
467495
recycle_rp_inst(ri, &empty_rp);
468496

469497
if (orig_ret_address != trampoline_address)
@@ -475,7 +503,6 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
475503
break;
476504
}
477505

478-
kretprobe_assert(ri, orig_ret_address, trampoline_address);
479506
kretprobe_hash_unlock(current, &flags);
480507

481508
hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {

0 commit comments

Comments
 (0)