Linux 4.9.171
Greg KH
maintainerI'm announcing the release of the 4.9.171 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 5 arch/arm64/include/asm/futex.h | 2 arch/x86/crypto/poly1305-avx2-x86_64.S | 14 +- arch/x86/crypto/poly1305-sse2-x86_64.S | 22 ++- arch/x86/events/amd/core.c | 35 ++++- arch/x86/kernel/kprobes/core.c | 26 ++++ arch/x86/kvm/emulate.c | 21 +-- arch/x86/kvm/svm.c | 19 ++- crypto/testmgr.h | 44 +++++++ drivers/char/tpm/tpm_i2c_atmel.c | 10 + drivers/crypto/amcc/crypto4xx_alg.c | 3 drivers/crypto/amcc/crypto4xx_core.c | 9 + drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c | 3 drivers/iio/accel/kxcjk-1013.c | 2 drivers/iio/adc/ad_sigma_delta.c | 1 drivers/iio/adc/at91_adc.c | 28 ++-- drivers/iio/gyro/bmg160_core.c | 6 drivers/mmc/host/sdhci.c | 40 ++---- drivers/net/bonding/bond_main.c | 6 drivers/net/team/team.c | 26 ++++ drivers/net/wireless/ralink/rt2x00/rt2x00.h | 1 drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 10 - drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 15 +- drivers/scsi/libfc/fc_rport.c | 1 drivers/staging/comedi/drivers/ni_usb6501.c | 10 - drivers/staging/comedi/drivers/vmk80xx.c | 8 - drivers/staging/iio/adc/ad7192.c | 8 - drivers/vhost/vhost.c | 6 fs/cifs/cifsglob.h | 2 fs/cifs/file.c | 30 ++++ fs/cifs/misc.c | 25 +++- fs/cifs/smb2misc.c | 6 include/linux/kprobes.h | 1 kernel/kprobes.c | 6 kernel/locking/lockdep.c | 3 kernel/sched/fair.c | 25 ++++ kernel/sysctl.c | 3 kernel/trace/ftrace.c | 6 mm/percpu.c | 8 - mm/vmstat.c | 5 net/atm/lec.c | 6 net/bridge/br_input.c | 23 ++- net/bridge/br_multicast.c | 4 net/ipv4/fou.c | 4 net/ipv4/route.c | 16 ++ net/ipv4/tcp_input.c | 10 - net/mac80211/driver-ops.h | 3 scripts/mod/file2alias.c | 141 +++++++---------------- security/device_cgroup.c | 2 sound/core/info.c | 12 + sound/core/init.c | 18 +- 51 files changed, 471 insertions(+), 269 deletions(-)
Adrian Hunter (1):
mmc: sdhci: Fix data command CRC error handling
Aurelien Aptel (1):
CIFS: keep FileInfo handle live during oplock break
Christian Lamparter (1):
crypto: crypto4xx - properly set IV after de- and encrypt
Dragos Bogdan (1):
iio: ad_sigma_delta: select channel when reading register
Eric Biggers (1):
crypto: x86/poly1305 - fix overflow during partial reduction
Eric Dumazet (2):
tcp: tcp_grow_window() needs to respect tcp_space()
ipv4: ensure rcu_read_lock() in ipv4_link_failure()
Felix Fietkau (1):
mac80211: do not call driver wake_tx_queue op during reconfig
Georg Ottinger (1):
iio: adc: at91: disable adc channel interrupt in timeout case
Greg Kroah-Hartman (2):
Revert "locking/lockdep: Add debug_locks check in __lock_downgrade()" Linux 4.9.171
Gustavo A. R. Silva (1):
net: atm: Fix potential Spectre v1 vulnerabilities
Hangbin Liu (1):
team: set slave to promisc if team is already in promisc mode
Ian Abbott (4):
staging: comedi: vmk80xx: Fix use of uninitialized semaphore
staging: comedi: vmk80xx: Fix possible double-free of ->usb_rx_buf
staging: comedi: ni_usb6501: Fix use of uninitialized mutex
staging: comedi: ni_usb6501: Fix possible double-free of ->usb_rx_bufJann Horn (1):
device_cgroup: fix RCU imbalance in error case
Jarkko Sakkinen (1):
tpm/tpm_i2c_atmel: Return -E2BIG when the transfer is incomplete
Jason Wang (1):
vhost: reject zero size iova range
Kim Phillips (1):
perf/x86/amd: Add event map for AMD Family 17h
Konstantin Khlebnikov (1):
mm/vmstat.c: fix /proc/vmstat format for CONFIG_DEBUG_TLBFLUSH=y CONFIG_SMP=n
Linus Torvalds (1):
i2c-hid: properly terminate i2c_hid_dmi_desc_override_table[] array
Lorenzo Bianconi (1):
net: fou: do not use guehdr after iptunnel_pull_offloads in gue_udp_recv
Masahiro Yamada (2):
modpost: file2alias: go back to simple devtable lookup
modpost: file2alias: check prototype of handler
Masami Hiramatsu (3):
x86/kprobes: Verify stack frame on kretprobe
kprobes: Mark ftrace mcount handler functions nokprobe
kprobes: Fix error check when reusing optimized probes
Matteo Croce (1):
percpu: stop printing kernel addresses
Matthias Kaehlcke (1):
Revert "kbuild: use -Oz instead of -Os when using clang"
Mike Looijmans (1):
iio/gyro/bmg160: Use millidegrees for temperature scale
Mircea Caprioru (1):
staging: iio: ad7192: Fix ad7193 channel address
Nathan Chancellor (1):
arm64: futex: Restore oldval initialization to work around buggy compilers
Nikolay Aleksandrov (2):
net: bridge: fix per-port af_packet sockets
net: bridge: multicast: use rcu to access port list from br_multicast_start_querier
Phil Auld (1):
sched/fair: Limit sched_cfs_period_timer() loop to avoid hard lockup
Sabrina Dubroca (1):
bonding: fix event handling for stacked bonds
Saurav Kashyap (1):
Revert "scsi: fcoe: clear FC_RP_STARTED flags when receiving a LOGO"
Sean Christopherson (1):
KVM: x86: Don't clear EFER during SMM transitions for 32-bit vCPU
Stephen Suryaputra (1):
ipv4: recompile ip options in ipv4_link_failure
Suthikulpanit, Suravee (1):
Revert "svm: Fix AVIC incomplete IPI emulation"
Takashi Iwai (2):
ALSA: core: Fix card races between register and disconnect
ALSA: info: Fix racy addition/deletion of nodes
Vijayakumar Durai (1):
rt2x00: do not increment sequence number while re-transmitting
Will Deacon (1):
kernel/sysctl.c: fix out-of-bounds access when setting file-max
he, bo (1):
io: accel: kxcjk1013: restore the range after resume.
Greg KH
maintainerMakefile +2 -3
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 170 +SUBLEVEL = 171 EXTRAVERSION = NAME = Roaring Lionus
@@ -655,8 +655,7 @@ KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) -KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) else ifdef CONFIG_PROFILE_ALL_BRANCHES KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)
arch/arm64/include/asm/futex.h +1 -1
@@ -53,7 +53,7 @@static inline int arch_futex_atomic_op_inuser (int op,int oparg,int *oval,u32 __user *uaddr) { -int oldval, ret, tmp; +int oldval =0 , ret, tmp;pagefault_disable ();
arch/x86/crypto/poly1305-avx2-x86_64.S +10 -4
@@ -321,6 +321,12 @@ ENTRY(poly1305_4block_avx2) vpaddq t2,t1,t1 vmovq t1x,d4 + # Now do a partial reduction mod (2^130)-5, carrying h0 -> h1 -> h2 -> + # h3 -> h4 -> h0 -> h1 to get h0,h2,h3,h4 < 2^26 and h1 < 2^26 + a small + # amount. Careful: we must not assume the carry bits 'd0 >> 26', + # 'd1 >> 26', 'd2 >> 26', 'd3 >> 26', and '(d4 >> 26) * 5' fit in 32-bit + # integers. It's true in a single-block implementation, but not here. + # d1 += d0 >> 26 mov d0,%rax shr $26,%rax
@@ -359,16 +365,16 @@ ENTRY(poly1305_4block_avx2) # h0 += (d4 >> 26) * 5 mov d4,%rax shr $26,%rax - lea (%eax,%eax,4),%eax - add %eax,%ebx + lea (%rax,%rax,4),%rax + add %rax,%rbx # h4 = d4 & 0x3ffffff mov d4,%rax and $0x3ffffff,%eax mov %eax,h4 # h1 += h0 >> 26 - mov %ebx,%eax - shr $26,%eax + mov %rbx,%rax + shr $26,%rax add %eax,h1 # h0 = h0 & 0x3ffffff andl $0x3ffffff,%ebx
arch/x86/crypto/poly1305-sse2-x86_64.S +14 -8
@@ -251,16 +251,16 @@ ENTRY(poly1305_block_sse2) # h0 += (d4 >> 26) * 5 mov d4,%rax shr $26,%rax - lea (%eax,%eax,4),%eax - add %eax,%ebx + lea (%rax,%rax,4),%rax + add %rax,%rbx # h4 = d4 & 0x3ffffff mov d4,%rax and $0x3ffffff,%eax mov %eax,h4 # h1 += h0 >> 26 - mov %ebx,%eax - shr $26,%eax + mov %rbx,%rax + shr $26,%rax add %eax,h1 # h0 = h0 & 0x3ffffff andl $0x3ffffff,%ebx
@@ -518,6 +518,12 @@ ENTRY(poly1305_2block_sse2) paddq t2,t1 movq t1,d4 + # Now do a partial reduction mod (2^130)-5, carrying h0 -> h1 -> h2 -> + # h3 -> h4 -> h0 -> h1 to get h0,h2,h3,h4 < 2^26 and h1 < 2^26 + a small + # amount. Careful: we must not assume the carry bits 'd0 >> 26', + # 'd1 >> 26', 'd2 >> 26', 'd3 >> 26', and '(d4 >> 26) * 5' fit in 32-bit + # integers. It's true in a single-block implementation, but not here. + # d1 += d0 >> 26 mov d0,%rax shr $26,%rax
@@ -556,16 +562,16 @@ ENTRY(poly1305_2block_sse2) # h0 += (d4 >> 26) * 5 mov d4,%rax shr $26,%rax - lea (%eax,%eax,4),%eax - add %eax,%ebx + lea (%rax,%rax,4),%rax + add %rax,%rbx # h4 = d4 & 0x3ffffff mov d4,%rax and $0x3ffffff,%eax mov %eax,h4 # h1 += h0 >> 26 - mov %ebx,%eax - shr $26,%eax + mov %rbx,%rax + shr $26,%rax add %eax,h1 # h0 = h0 & 0x3ffffff andl $0x3ffffff,%ebx
arch/x86/events/amd/core.c +26 -9
@@ -113,22 +113,39 @@ static __initconst const u64 amd_hw_cache_event_ids };/* -* AMD Performance Monitor K7 and later. +* AMD Performance Monitor K7 and later, up to and including Family 16h: */ static const u64 amd_perfmon_event_map[PERF_COUNT_HW_MAX ] = { - [PERF_COUNT_HW_CPU_CYCLES ] =0x0076 , - [PERF_COUNT_HW_INSTRUCTIONS ] =0x00c0 , - [PERF_COUNT_HW_CACHE_REFERENCES ] =0x077d , - [PERF_COUNT_HW_CACHE_MISSES ] =0x077e , - [PERF_COUNT_HW_BRANCH_INSTRUCTIONS ] =0x00c2 , - [PERF_COUNT_HW_BRANCH_MISSES ] =0x00c3 , - [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND ] =0x00d0 ,/* "Decoder empty" event */ - [PERF_COUNT_HW_STALLED_CYCLES_BACKEND ] =0x00d1 ,/* "Dispatch stalls" event */ + [PERF_COUNT_HW_CPU_CYCLES ] =0x0076 , + [PERF_COUNT_HW_INSTRUCTIONS ] =0x00c0 , + [PERF_COUNT_HW_CACHE_REFERENCES ] =0x077d , + [PERF_COUNT_HW_CACHE_MISSES ] =0x077e , + [PERF_COUNT_HW_BRANCH_INSTRUCTIONS ] =0x00c2 , + [PERF_COUNT_HW_BRANCH_MISSES ] =0x00c3 , + [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND ] =0x00d0 ,/* "Decoder empty" event */ + [PERF_COUNT_HW_STALLED_CYCLES_BACKEND ] =0x00d1 ,/* "Dispatch stalls" event */ +}; + +/* +* AMD Performance Monitor Family 17h and later: +*/ +static const u64 amd_f17h_perfmon_event_map[PERF_COUNT_HW_MAX ] = +{ + [PERF_COUNT_HW_CPU_CYCLES ] =0x0076 , + [PERF_COUNT_HW_INSTRUCTIONS ] =0x00c0 , + [PERF_COUNT_HW_CACHE_REFERENCES ] =0xff60 , + [PERF_COUNT_HW_BRANCH_INSTRUCTIONS ] =0x00c2 , + [PERF_COUNT_HW_BRANCH_MISSES ] =0x00c3 , + [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND ] =0x0287 , + [PERF_COUNT_HW_STALLED_CYCLES_BACKEND ] =0x0187 , };static u64 amd_pmu_event_map (int hw_event) { +if (boot_cpu_data.x86 >=0x17 ) +return amd_f17h_perfmon_event_map[hw_event]; +return amd_perfmon_event_map[hw_event]; }
arch/x86/kernel/kprobes/core.c +26 -0
@@ -545,6 +545,7 @@ void arch_prepare_kretprobe(struct kretprobe_instance *ri, struct pt_regs *regs)unsigned long *sara =stack_addr (regs); ri->ret_addr = (kprobe_opcode_t *) *sara; + ri->fp = sara;/* Replace the return addr with trampoline addr */ *sara = (unsigned long ) &kretprobe_trampoline;
@@ -746,15 +747,21 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)unsigned long flags, orig_ret_address =0 ;unsigned long trampoline_address = (unsigned long )&kretprobe_trampoline;kprobe_opcode_t *correct_ret_addr =NULL ; +void *frame_pointer; +bool skipped = false;INIT_HLIST_HEAD (&empty_rp);kretprobe_hash_lock (current, &head, &flags);/* fixup registers */ #ifdef CONFIG_X86_64 regs->cs = __KERNEL_CS; +/* On x86-64, we use pt_regs->sp for return address holder. */ + frame_pointer = ®s->sp;#else regs->cs = __KERNEL_CS |get_kernel_rpl (); regs->gs =0 ; +/* On x86-32, we use pt_regs->flags for return address holder. */ + frame_pointer = ®s->flags;#endif regs->ip = trampoline_address; regs->orig_ax = ~0UL ;
@@ -776,8 +783,25 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)if (ri->task != current)/* another task is sharing our hash bucket */ continue ; +/* +* Return probes must be pushed on this hash list correct +* order (same as return order) so that it can be poped +* correctly. However, if we find it is pushed it incorrect +* order, this means we find a function which should not be +* probed, because the wrong order entry is pushed on the +* path of processing other kretprobe itself. +*/ +if (ri->fp != frame_pointer) { +if (!skipped) +pr_warn ("kretprobe is stacked incorrectly. Trying to fixup.\n" ); + skipped = true; +continue ; + } orig_ret_address = (unsigned long )ri->ret_addr; +if (skipped) +pr_warn ("%ps must be blacklisted because of incorrect kretprobe order\n" , + ri->rp->kp.addr);if (orig_ret_address != trampoline_address)/*
@@ -795,6 +819,8 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)if (ri->task != current)/* another task is sharing our hash bucket */ continue ; +if (ri->fp != frame_pointer) +continue ; orig_ret_address = (unsigned long )ri->ret_addr;if (ri->rp && ri->rp->handler) {
arch/x86/kvm/emulate.c +11 -10
@@ -2579,15 +2579,13 @@ static int em_rsm(struct x86_emulate_ctxt *ctxt)* CR0/CR3/CR4/EFER. It's all a bit more complicated if the vCPU * supports long mode. */ - cr4 = ctxt->ops->get_cr (ctxt,4 );if (emulator_has_longmode (ctxt)) {struct desc_struct cs_desc;/* Zero CR4.PCIDE before CR0.PG. */ -if (cr4 &X86_CR4_PCIDE ) { + cr4 = ctxt->ops->get_cr (ctxt,4 ); +if (cr4 &X86_CR4_PCIDE ) ctxt->ops->set_cr (ctxt,4 , cr4 & ~X86_CR4_PCIDE ); - cr4 &= ~X86_CR4_PCIDE ; - }/* A 32-bit code segment is required to clear EFER.LMA. */ memset (&cs_desc,0 ,sizeof (cs_desc));
@@ -2601,13 +2599,16 @@ static int em_rsm(struct x86_emulate_ctxt *ctxt)if (cr0 &X86_CR0_PE ) ctxt->ops->set_cr (ctxt,0 , cr0 & ~(X86_CR0_PG |X86_CR0_PE )); -/* Now clear CR4.PAE (which must be done before clearing EFER.LME). */ -if (cr4 &X86_CR4_PAE ) - ctxt->ops->set_cr (ctxt,4 , cr4 & ~X86_CR4_PAE ); +if (emulator_has_longmode (ctxt)) { +/* Clear CR4.PAE before clearing EFER.LME. */ + cr4 = ctxt->ops->get_cr (ctxt,4 ); +if (cr4 &X86_CR4_PAE ) + ctxt->ops->set_cr (ctxt,4 , cr4 & ~X86_CR4_PAE ); -/* And finally go back to 32-bit mode. */ - efer =0 ; - ctxt->ops->set_msr (ctxt,MSR_EFER , efer); +/* And finally go back to 32-bit mode. */ + efer =0 ; + ctxt->ops->set_msr (ctxt,MSR_EFER , efer); + } smbase = ctxt->ops->get_smbase (ctxt);if (emulator_has_longmode (ctxt))
arch/x86/kvm/svm.c +15 -4
@@ -3940,14 +3940,25 @@ static int avic_incomplete_ipi_interception(struct vcpu_svm *svm)kvm_lapic_reg_write (apic,APIC_ICR , icrl);break ;case AVIC_IPI_FAILURE_TARGET_NOT_RUNNING : { +int i; +struct kvm_vcpu *vcpu; +struct kvm *kvm = svm->vcpu.kvm;struct kvm_lapic *apic = svm->vcpu.arch.apic;/* -* Update ICR high and low, then emulate sending IPI, -* which is handled when writing APIC_ICR. +* At this point, we expect that the AVIC HW has already +* set the appropriate IRR bits on the valid target +* vcpus. So, we just need to kick the appropriate vcpu. */ -kvm_lapic_reg_write (apic,APIC_ICR2 , icrh); -kvm_lapic_reg_write (apic,APIC_ICR , icrl); +kvm_for_each_vcpu (i, vcpu, kvm) { +bool m =kvm_apic_match_dest (vcpu, apic, + icrl &KVM_APIC_SHORT_MASK , +GET_APIC_DEST_FIELD (icrh), + icrl &KVM_APIC_DEST_MASK ); + +if (m && !avic_vcpu_is_running (vcpu)) +kvm_vcpu_wake_up (vcpu); + }break ; }case AVIC_IPI_FAILURE_INVALID_TARGET :
crypto/testmgr.h +43 -1
50 lines not on this page · raw message
drivers/char/tpm/tpm_i2c_atmel.c +9 -1
@@ -65,7 +65,15 @@ static int i2c_atmel_send(struct tpm_chip *chip, u8 *buf, size_t len)dev_dbg (&chip->dev,"%s(buf=%*ph len=%0zx) -> sts=%d\n" , __func__, (int )min_t (size_t,64 , len), buf, len, status); -return status; + +if (status <0 ) +return status; + +/* The upper layer does not support incomplete sends. */ +if (status != len) +return -E2BIG ; + +return 0 ; }static int i2c_atmel_recv (struct tpm_chip *chip,u8 *buf,size_t count)
drivers/crypto/amcc/crypto4xx_alg.c +2 -1
@@ -138,7 +138,8 @@ static int crypto4xx_setkey_aes(struct crypto_ablkcipher *cipher, sa = (struct dynamic_sa_ctl *) ctx->sa_in; ctx->hash_final =0 ; - set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, + set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, (cm == CRYPTO_MODE_CBC ? + SA_SAVE_IV : SA_NOT_SAVE_IV), SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, SA_NO_HEADER_PROC, SA_HASH_ALG_NULL, SA_CIPHER_ALG_AES, SA_PAD_TYPE_ZERO,
drivers/crypto/amcc/crypto4xx_core.c +9 -0
@@ -646,6 +646,15 @@ static u32 crypto4xx_ablkcipher_done(struct crypto4xx_device *dev, addr =dma_map_page (dev->core_dev->device,sg_page (dst), dst->offset, dst->length,DMA_FROM_DEVICE ); } + +if (pd_uinfo->sa_va->sa_command_0.bf.save_iv ==SA_SAVE_IV ) { +struct crypto_skcipher *skcipher =crypto_skcipher_reqtfm (req); + +crypto4xx_memcpy_from_le32 ((u32 *)req->iv, + pd_uinfo->sr_va->save_iv, +crypto_skcipher_ivsize (skcipher)); + } +crypto4xx_ret_sg_desc (dev, pd_uinfo);if (ablk_req->base.complete !=NULL ) ablk_req->base.complete (&ablk_req->base,0 );
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +2 -1
@@ -337,7 +337,8 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = { DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "FlexBook edge11 - M-FBE11"), }, .driver_data = (void *)&sipodev_desc - } + }, + { } /* Terminate list */ };
drivers/iio/accel/kxcjk-1013.c +2 -0
@@ -1340,6 +1340,8 @@ static int kxcjk1013_resume(struct device *dev)mutex_lock (&data->mutex); ret =kxcjk1013_set_mode (data,OPERATION ); +if (ret ==0 ) + ret =kxcjk1013_set_range (data, data->range);mutex_unlock (&data->mutex);return ret;
drivers/iio/adc/ad_sigma_delta.c +1 -0
@@ -121,6 +121,7 @@ static int ad_sd_read_reg_raw(struct ad_sigma_delta *sigma_delta,if (sigma_delta->info->has_registers) { data[0 ] = reg << sigma_delta->info->addr_shift; data[0 ] |= sigma_delta->info->read_mask; + data[0 ] |= sigma_delta->comm;spi_message_add_tail (&t[0 ], &m); }spi_message_add_tail (&t[1 ], &m);
drivers/iio/adc/at91_adc.c +17 -11
@@ -704,23 +704,29 @@ static int at91_adc_read_raw(struct iio_dev *idev, ret =wait_event_interruptible_timeout (st->wq_data_avail, st->done,msecs_to_jiffies (1000 )); -if (ret ==0 ) - ret = -ETIMEDOUT ; -if (ret <0 ) { -mutex_unlock (&st->lock); -return ret; - } - - *val = st->last_value; +/* Disable interrupts, regardless if adc conversion was +* successful or not +*/ at91_adc_writel (st,AT91_ADC_CHDR ,AT91_ADC_CH (chan->channel));at91_adc_writel (st,AT91_ADC_IDR ,BIT (chan->channel)); - st->last_value =0 ; - st->done = false; +if (ret >0 ) { +/* a valid conversion took place */ + *val = st->last_value; + st->last_value =0 ; + st->done = false; + ret =IIO_VAL_INT ; + }else if (ret ==0 ) { +/* conversion timeout */ +dev_err (&idev->dev,"ADC Channel %d timeout.\n" , + chan->channel); + ret = -ETIMEDOUT ; + } +mutex_unlock (&st->lock); -return IIO_VAL_INT ; +return ret;case IIO_CHAN_INFO_SCALE : *val = st->vref_mv;
drivers/iio/gyro/bmg160_core.c +3 -3
@@ -583,11 +583,10 @@ static int bmg160_read_raw(struct iio_dev *indio_dev,case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY :return bmg160_get_filter (data, val);case IIO_CHAN_INFO_SCALE : - *val =0 ;switch (chan->type) {case IIO_TEMP : - *val2 =500000 ; -return IIO_VAL_INT_PLUS_MICRO ; + *val =500 ; +return IIO_VAL_INT ;case IIO_ANGL_VEL : {int i;
@@ -595,6 +594,7 @@ static int bmg160_read_raw(struct iio_dev *indio_dev,for (i =0 ; i <ARRAY_SIZE (bmg160_scale_table); ++i) {if (bmg160_scale_table[i].dps_range == data->dps_range) { + *val =0 ; *val2 = bmg160_scale_table[i].scale;return IIO_VAL_INT_PLUS_MICRO ; }
drivers/mmc/host/sdhci.c +15 -25
@@ -944,8 +944,7 @@ static bool sdhci_needs_reset(struct sdhci_host *host, struct mmc_request *mrq)return (!(host->flags &SDHCI_DEVICE_DEAD ) && ((mrq->cmd && mrq->cmd->error) || (mrq->sbc && mrq->sbc->error) || - (mrq->data && ((mrq->data->error && !mrq->data->stop) || - (mrq->data->stop && mrq->data->stop->error))) || + (mrq->data && mrq->data->stop && mrq->data->stop->error) || (host->quirks &SDHCI_QUIRK_RESET_AFTER_REQUEST ))); }
@@ -997,6 +996,16 @@ static void sdhci_finish_data(struct sdhci_host *host) host->data =NULL ; host->data_cmd =NULL ; +/* +* The controller needs a reset of internal state machines upon error +* conditions. +*/ +if (data->error) { +if (!host->cmd || host->cmd == data_cmd) +sdhci_do_reset (host,SDHCI_RESET_CMD ); +sdhci_do_reset (host,SDHCI_RESET_DATA ); + } +if ((host->flags & (SDHCI_REQ_USE_DMA |SDHCI_USE_ADMA )) == (SDHCI_REQ_USE_DMA |SDHCI_USE_ADMA ))sdhci_adma_table_post (host, data);
@@ -1021,17 +1030,6 @@ static void sdhci_finish_data(struct sdhci_host *host)if (data->stop && (data->error || !data->mrq->sbc)) { - -/* -* The controller needs a reset of internal state machines -* upon error conditions. -*/ -if (data->error) { -if (!host->cmd || host->cmd == data_cmd) -sdhci_do_reset (host,SDHCI_RESET_CMD ); -sdhci_do_reset (host,SDHCI_RESET_DATA ); - } -/* * 'cap_cmd_during_tfr' request must not use the command line * after mmc_command_done() has been called. It is upper layer's
@@ -2457,7 +2455,7 @@ static void sdhci_timeout_data_timer(unsigned long data)* * \*****************************************************************************/ -static void sdhci_cmd_irq (struct sdhci_host *host,u32 intmask) +static void sdhci_cmd_irq (struct sdhci_host *host,u32 intmask,u32 *intmask_p) {if (!host->cmd) {/*
@@ -2480,20 +2478,12 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask)else host->cmd->error = -EILSEQ ; -/* -* If this command initiates a data phase and a response -* CRC error is signalled, the card can start transferring -* data - the card may have received the command without -* error. We must not terminate the mmc_request early. -* -* If the card did not receive the command or returned an -* error which prevented it sending data, the data phase -* will time out. -*/ +/* Treat data command CRC error the same as data CRC error */ if (host->cmd->data && (intmask & (SDHCI_INT_CRC |SDHCI_INT_TIMEOUT )) ==SDHCI_INT_CRC ) { host->cmd =NULL ; + *intmask_p |=SDHCI_INT_DATA_CRC ;return ; }
@@ -2722,7 +2712,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) }if (intmask &SDHCI_INT_CMD_MASK ) -sdhci_cmd_irq (host, intmask &SDHCI_INT_CMD_MASK ); +sdhci_cmd_irq (host, intmask &SDHCI_INT_CMD_MASK , &intmask);if (intmask &SDHCI_INT_DATA_MASK )sdhci_data_irq (host, intmask &SDHCI_INT_DATA_MASK );
drivers/net/bonding/bond_main.c +5 -1
@@ -3134,8 +3134,12 @@ static int bond_netdev_event(struct notifier_block *this,return NOTIFY_DONE ;if (event_dev->flags &IFF_MASTER ) { +int ret; +netdev_dbg (event_dev,"IFF_MASTER\n" ); -return bond_master_netdev_event (event, event_dev); + ret =bond_master_netdev_event (event, event_dev); +if (ret !=NOTIFY_DONE ) +return ret; }if (event_dev->flags &IFF_SLAVE ) {
drivers/net/team/team.c +26 -0
@@ -1251,6 +1251,23 @@ static int team_port_add(struct team *team, struct net_device *port_dev) goto err_option_port_add; } +/* set promiscuity level to new slave */ +if (dev->flags &IFF_PROMISC ) { + err =dev_set_promiscuity (port_dev,1 ); +if (err) + goto err_set_slave_promisc; + } + +/* set allmulti level to new slave */ +if (dev->flags &IFF_ALLMULTI ) { + err =dev_set_allmulti (port_dev,1 ); +if (err) { +if (dev->flags &IFF_PROMISC ) +dev_set_promiscuity (port_dev,-1 ); + goto err_set_slave_promisc; + } + } +netif_addr_lock_bh (dev);dev_uc_sync_multiple (port_dev, dev);dev_mc_sync_multiple (port_dev, dev);
@@ -1267,6 +1284,9 @@ static int team_port_add(struct team *team, struct net_device *port_dev)return 0 ; +err_set_slave_promisc: +__team_option_inst_del_port (team, port); + err_option_port_add:team_upper_dev_unlink (team, port);
@@ -1312,6 +1332,12 @@ static int team_port_del(struct team *team, struct net_device *port_dev)team_port_disable (team, port);list_del_rcu (&port->list); + +if (dev->flags &IFF_PROMISC ) +dev_set_promiscuity (port_dev,-1 ); +if (dev->flags &IFF_ALLMULTI ) +dev_set_allmulti (port_dev,-1 ); +team_upper_dev_unlink (team, port);netdev_rx_handler_unregister (port_dev);team_port_disable_netpoll (port);
drivers/net/wireless/ralink/rt2x00/rt2x00.h +0 -1
@@ -669,7 +669,6 @@ enum rt2x00_state_flags {CONFIG_CHANNEL_HT40 ,CONFIG_POWERSAVING ,CONFIG_HT_DISABLED , -CONFIG_QOS_DISABLED , CONFIG_MONITORING,/*
drivers/net/wireless/ralink/rt2x00/rt2x00mac.c +0 -10
@@ -666,18 +666,8 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, rt2x00dev->intf_associated--;rt2x00leds_led_assoc (rt2x00dev, !!rt2x00dev->intf_associated); - -clear_bit (CONFIG_QOS_DISABLED , &rt2x00dev->flags); } -/* -* Check for access point which do not support 802.11e . We have to -* generate data frames sequence number in S/W for such AP, because -* of H/W bug. -*/ -if (changes &BSS_CHANGED_QOS && !bss_conf->qos) -set_bit (CONFIG_QOS_DISABLED , &rt2x00dev->flags); -/* * When the erp information has changed, we should perform * additional configuration steps. For all other changes we are done.
drivers/net/wireless/ralink/rt2x00/rt2x00queue.c +9 -6
@@ -201,15 +201,18 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev,if (!rt2x00_has_cap_flag (rt2x00dev,REQUIRE_SW_SEQNO )) {/* * rt2800 has a H/W (or F/W) bug, device incorrectly increase -* seqno on retransmited data (non-QOS) frames. To workaround -* the problem let's generate seqno in software if QOS is -* disabled. +* seqno on retransmitted data (non-QOS) and management frames. +* To workaround the problem let's generate seqno in software. +* Except for beacons which are transmitted periodically by H/W +* hence hardware has to assign seqno for them. */ -if (test_bit (CONFIG_QOS_DISABLED , &rt2x00dev->flags)) -__clear_bit (ENTRY_TXD_GENERATE_SEQ , &txdesc->flags); -else +if (ieee80211_is_beacon (hdr->frame_control)) { +__set_bit (ENTRY_TXD_GENERATE_SEQ , &txdesc->flags);/* H/W will generate sequence number */ return ; + } + +__clear_bit (ENTRY_TXD_GENERATE_SEQ , &txdesc->flags); }/*
drivers/scsi/libfc/fc_rport.c +0 -1
@@ -1935,7 +1935,6 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)FC_RPORT_DBG (rdata,"Received LOGO request while in state %s\n" ,fc_rport_state (rdata)); - rdata->flags &= ~FC_RP_STARTED ;fc_rport_enter_delete (rdata,RPORT_EV_STOP );mutex_unlock (&rdata->rp_mutex);kref_put (&rdata->kref, rdata->local_port->tt.rport_destroy);
drivers/staging/comedi/drivers/ni_usb6501.c +4 -6
@@ -472,10 +472,8 @@ static int ni6501_alloc_usb_buffers(struct comedi_device *dev) size =usb_endpoint_maxp (devpriv->ep_tx); devpriv->usb_tx_buf =kzalloc (size,GFP_KERNEL ); -if (!devpriv->usb_tx_buf) { -kfree (devpriv->usb_rx_buf); +if (!devpriv->usb_tx_buf)return -ENOMEM ; - }return 0 ; }
@@ -527,6 +525,9 @@ static int ni6501_auto_attach(struct comedi_device *dev,if (!devpriv)return -ENOMEM ; +mutex_init (&devpriv->mut); +usb_set_intfdata (intf, devpriv); + ret =ni6501_find_endpoints (dev);if (ret)return ret;
@@ -535,9 +536,6 @@ static int ni6501_auto_attach(struct comedi_device *dev,if (ret)return ret; -mutex_init (&devpriv->mut); -usb_set_intfdata (intf, devpriv); - ret =comedi_alloc_subdevices (dev,2 );if (ret)return ret;
drivers/staging/comedi/drivers/vmk80xx.c +3 -5
@@ -691,10 +691,8 @@ static int vmk80xx_alloc_usb_buffers(struct comedi_device *dev) size =usb_endpoint_maxp (devpriv->ep_tx); devpriv->usb_tx_buf =kzalloc (size,GFP_KERNEL ); -if (!devpriv->usb_tx_buf) { -kfree (devpriv->usb_rx_buf); +if (!devpriv->usb_tx_buf)return -ENOMEM ; - }return 0 ; }
@@ -809,6 +807,8 @@ static int vmk80xx_auto_attach(struct comedi_device *dev, devpriv->model = board->model; +sema_init (&devpriv->limit_sem,8 ); + ret =vmk80xx_find_usb_endpoints (dev);if (ret)return ret;
@@ -817,8 +817,6 @@ static int vmk80xx_auto_attach(struct comedi_device *dev,if (ret)return ret; -sema_init (&devpriv->limit_sem,8 ); -usb_set_intfdata (intf, devpriv);if (devpriv->model ==VMK8055_MODEL )
drivers/staging/iio/adc/ad7192.c +4 -4
@@ -109,10 +109,10 @@#define AD7192_CH_AIN3 BIT(6)/* AIN3 - AINCOM */ #define AD7192_CH_AIN4 BIT(7)/* AIN4 - AINCOM */ -#define AD7193_CH_AIN1P_AIN2M 0x000/* AIN1(+) - AIN2(-) */ -#define AD7193_CH_AIN3P_AIN4M 0x001/* AIN3(+) - AIN4(-) */ -#define AD7193_CH_AIN5P_AIN6M 0x002/* AIN5(+) - AIN6(-) */ -#define AD7193_CH_AIN7P_AIN8M 0x004/* AIN7(+) - AIN8(-) */ +#define AD7193_CH_AIN1P_AIN2M 0x001/* AIN1(+) - AIN2(-) */ +#define AD7193_CH_AIN3P_AIN4M 0x002/* AIN3(+) - AIN4(-) */ +#define AD7193_CH_AIN5P_AIN6M 0x004/* AIN5(+) - AIN6(-) */ +#define AD7193_CH_AIN7P_AIN8M 0x008/* AIN7(+) - AIN8(-) */ #define AD7193_CH_TEMP 0x100/* Temp senseor */ #define AD7193_CH_AIN2P_AIN2M 0x200/* AIN2(+) - AIN2(-) */ #define AD7193_CH_AIN1 0x401/* AIN1 - AINCOM */
drivers/vhost/vhost.c +5 -1
@@ -863,8 +863,12 @@ static int vhost_new_umem_range(struct vhost_umem *umem, u64 start, u64 size, u64 end, u64 userspace_addr, int perm) { - struct vhost_umem_node *tmp, *node = kmalloc(sizeof(*node), GFP_ATOMIC); + struct vhost_umem_node *tmp, *node; +if (!size) +return -EFAULT ; + + node =kmalloc (sizeof (*node),GFP_ATOMIC );if (!node)return -ENOMEM ;
fs/cifs/cifsglob.h +2 -0
@@ -1157,6 +1157,7 @@ cifsFileInfo_get_locked(struct cifsFileInfo *cifs_file) }struct cifsFileInfo *cifsFileInfo_get (struct cifsFileInfo *cifs_file); +void _cifsFileInfo_put (struct cifsFileInfo *cifs_file,bool wait_oplock_hdlr);void cifsFileInfo_put (struct cifsFileInfo *cifs_file);#define CIFS_CACHE_READ_FLG 1
@@ -1651,6 +1652,7 @@ GLOBAL_EXTERN spinlock_t gidsidlock;#endif /* CONFIG_CIFS_ACL */ void cifs_oplock_break (struct work_struct *work); +void cifs_queue_oplock_break (struct cifsFileInfo *cfile);extern const struct slow_work_ops cifs_oplock_break_ops;extern struct workqueue_struct *cifsiod_wq;
fs/cifs/file.c +25 -5
@@ -358,12 +358,30 @@ cifsFileInfo_get(struct cifsFileInfo *cifs_file)return cifs_file; } -/* -* Release a reference on the file private data. This may involve closing -* the filehandle out on the server. Must be called without holding -* tcon->open_file_lock and cifs_file->file_info_lock. +/** +* cifsFileInfo_put - release a reference of file priv data +* +* Always potentially wait for oplock handler. See _cifsFileInfo_put(). */ void cifsFileInfo_put (struct cifsFileInfo *cifs_file) +{ +_cifsFileInfo_put (cifs_file, true); +} + +/** +* _cifsFileInfo_put - release a reference of file priv data +* +* This may involve closing the filehandle @cifs_file out on the +* server. Must be called without holding tcon->open_file_lock and +* cifs_file->file_info_lock. +* +* If @wait_for_oplock_handler is true and we are releasing the last +* reference, wait for any running oplock break handler of the file +* and cancel any pending one. If calling this function from the +* oplock break handler, you need to pass false. +* +*/ +void _cifsFileInfo_put (struct cifsFileInfo *cifs_file,bool wait_oplock_handler) {struct inode *inode =d_inode (cifs_file->dentry);struct cifs_tcon *tcon =tlink_tcon (cifs_file->tlink);
@@ -411,7 +429,8 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)spin_unlock (&tcon->open_file_lock); - oplock_break_cancelled =cancel_work_sync (&cifs_file->oplock_break); + oplock_break_cancelled = wait_oplock_handler ? +cancel_work_sync (&cifs_file->oplock_break) : false;if (!tcon->need_reconnect && !cifs_file->invalidHandle) {struct TCP_Server_Info *server = tcon->ses->server;
@@ -3913,6 +3932,7 @@ void cifs_oplock_break(struct work_struct *work) cinode);cifs_dbg (FYI ,"Oplock release rc = %d\n" , rc); } +_cifsFileInfo_put (cfile, false/* do not wait for ourself */ );cifs_done_oplock_break (cinode); }
fs/cifs/misc.c +23 -2
@@ -494,8 +494,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 , &pCifsInode->flags); -queue_work (cifsoplockd_wq, - &netfile->oplock_break); +cifs_queue_oplock_break (netfile); netfile->oplock_break_cancelled = false;spin_unlock (&tcon->open_file_lock);
@@ -592,6 +591,28 @@ void cifs_put_writer(struct cifsInodeInfo *cinode)spin_unlock (&cinode->writers_lock); } +/** +* cifs_queue_oplock_break - queue the oplock break handler for cfile +* +* This function is called from the demultiplex thread when it +* receives an oplock break for @cfile. +* +* Assumes the tcon->open_file_lock is held. +* Assumes cfile->file_info_lock is NOT held. +*/ +void cifs_queue_oplock_break (struct cifsFileInfo *cfile) +{ +/* +* Bump the handle refcount now while we hold the +* open_file_lock to enforce the validity of it for the oplock +* break handler. The matching put is done at the end of the +* handler. +*/ +cifsFileInfo_get (cfile); + +queue_work (cifsoplockd_wq, &cfile->oplock_break); +} +void cifs_done_oplock_break (struct cifsInodeInfo *cinode) {clear_bit (CIFS_INODE_PENDING_OPLOCK_BREAK , &cinode->flags);
fs/cifs/smb2misc.c +3 -3
@@ -512,7 +512,7 @@ smb2_tcon_has_lease(struct cifs_tcon *tcon, struct smb2_lease_break *rsp,clear_bit (CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 , &cinode->flags); -queue_work (cifsoplockd_wq, &cfile->oplock_break); +cifs_queue_oplock_break (cfile);kfree (lw);return true; }
@@ -656,8 +656,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 , &cinode->flags);spin_unlock (&cfile->file_info_lock); -queue_work (cifsoplockd_wq, - &cfile->oplock_break); + +cifs_queue_oplock_break (cfile);spin_unlock (&tcon->open_file_lock);spin_unlock (&cifs_tcp_ses_lock);
include/linux/kprobes.h +1 -0
@@ -197,6 +197,7 @@ struct kretprobe_instance {struct kretprobe *rp;kprobe_opcode_t *ret_addr;struct task_struct *task; +void *fp;char data[0 ]; };
kernel/kprobes.c +2 -4
@@ -668,7 +668,6 @@ static void unoptimize_kprobe(struct kprobe *p, bool force)static int reuse_unused_kprobe (struct kprobe *ap) {struct optimized_kprobe *op; -int ret;BUG_ON (!kprobe_unused (ap));/*
@@ -682,9 +681,8 @@ static int reuse_unused_kprobe(struct kprobe *ap)/* Enable the probe again */ ap->flags &= ~KPROBE_FLAG_DISABLED ;/* Optimize it again (remove from op->list) */ - ret =kprobe_optready (ap); -if (ret) -return ret; +if (!kprobe_optready (ap)) +return -EINVAL ;optimize_kprobe (ap);return 0 ;
kernel/locking/lockdep.c +0 -3
@@ -3446,9 +3446,6 @@ __lock_set_class(struct lockdep_map *lock, const char *name,unsigned int depth;int i; -if (unlikely (!debug_locks)) -return 0 ; - depth = curr->lockdep_depth;/* * This function is about (re)setting the class of a held lock,
kernel/sched/fair.c +25 -0
@@ -4347,12 +4347,15 @@ static enum hrtimer_restart sched_cfs_slack_timer(struct hrtimer *timer)return HRTIMER_NORESTART ; } +extern const u64 max_cfs_quota_period; +static enum hrtimer_restart sched_cfs_period_timer (struct hrtimer *timer) {struct cfs_bandwidth *cfs_b = container_of(timer, struct cfs_bandwidth, period_timer);int overrun;int idle =0 ; +int count =0 ;raw_spin_lock (&cfs_b->lock);for (;;) {
@@ -4360,6 +4363,28 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer)if (!overrun)break ; +if (++count >3 ) { +u64 new, old =ktime_to_ns (cfs_b->period); + + new = (old *147 ) /128 ;/* ~115% */ + new =min (new, max_cfs_quota_period); + + cfs_b->period =ns_to_ktime (new); + +/* since max is 1s, this is limited to 1e9^2, which fits in u64 */ + cfs_b->quota *= new; + cfs_b->quota =div64_u64 (cfs_b->quota, old); + +pr_warn_ratelimited ( +"cfs_period_timer[cpu%d]: period too short, scaling up (new cfs_period_us %lld, cfs_quota_us = %lld)\n" , +smp_processor_id (), +div_u64 (new,NSEC_PER_USEC ), +div_u64 (cfs_b->quota,NSEC_PER_USEC )); + +/* reset count so we don't come right back in here */ + count =0 ; + } + idle =do_sched_cfs_period_timer (cfs_b, overrun); }if (idle)
kernel/sysctl.c +2 -1
@@ -124,6 +124,7 @@ static int zero;static int __maybe_unused one =1 ;static int __maybe_unused two =2 ;static int __maybe_unused four =4 ; +static unsigned long zero_ul;static unsigned long one_ul =1 ;static unsigned long long_max =LONG_MAX ;static int one_hundred =100 ;
@@ -1683,7 +1684,7 @@ static struct ctl_table fs_table[] = { .maxlen = sizeof(files_stat.max_files), .mode = 0644, .proc_handler = proc_doulongvec_minmax, - .extra1 = &zero, + .extra1 = &zero_ul, .extra2 = &long_max, }, {
kernel/trace/ftrace.c +5 -1
@@ -32,6 +32,7 @@#include <linux/list.h> #include <linux/hash.h> #include <linux/rcupdate.h> +#include <linux/kprobes.h> #include <trace/events/sched.h>
@@ -5246,7 +5247,7 @@ void ftrace_reset_array_ops(struct trace_array *tr) tr->ops->func = ftrace_stub; } -static inline void +static nokprobe_inline void__ftrace_ops_list_func (unsigned long ip,unsigned long parent_ip,struct ftrace_ops *ignored,struct pt_regs *regs) {
@@ -5309,11 +5310,13 @@ static void ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, {__ftrace_ops_list_func (ip, parent_ip,NULL , regs); } +NOKPROBE_SYMBOL (ftrace_ops_list_func);#else static void ftrace_ops_no_ops (unsigned long ip,unsigned long parent_ip) {__ftrace_ops_list_func (ip, parent_ip,NULL ,NULL ); } +NOKPROBE_SYMBOL (ftrace_ops_no_ops);#endif /*
@@ -5343,6 +5346,7 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip,preempt_enable_notrace ();trace_clear_recursion (bit); } +NOKPROBE_SYMBOL (ftrace_ops_assist_func);/** * ftrace_ops_get_func - get the function a trampoline should call
mm/percpu.c +4 -4
@@ -2048,8 +2048,8 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, ai->groups[group].base_offset = areas[group] - base; } -pr_info ("Embedded %zu pages/cpu @%p s%zu r%zu d%zu u%zu\n" , -PFN_DOWN (size_sum), base, ai->static_size, ai->reserved_size, +pr_info ("Embedded %zu pages/cpu s%zu r%zu d%zu u%zu\n" , +PFN_DOWN (size_sum), ai->static_size, ai->reserved_size, ai->dyn_size, ai->unit_size); rc =pcpu_setup_first_chunk (ai, base);
@@ -2162,8 +2162,8 @@ int __init pcpu_page_first_chunk(size_t reserved_size, }/* we're ready, commit */ -pr_info ("%d %s pages/cpu @%p s%zu r%zu d%zu\n" , - unit_pages, psize_str, vm.addr, ai->static_size, +pr_info ("%d %s pages/cpu s%zu r%zu d%zu\n" , + unit_pages, psize_str, ai->static_size, ai->reserved_size, ai->dyn_size); rc =pcpu_setup_first_chunk (ai, vm.addr);
mm/vmstat.c +0 -5
@@ -1075,13 +1075,8 @@ const char * const vmstat_text[] = {#endif #endif /* CONFIG_MEMORY_BALLOON */ #ifdef CONFIG_DEBUG_TLBFLUSH -#ifdef CONFIG_SMP"nr_tlb_remote_flush" ,"nr_tlb_remote_flush_received" , -#else - "", /* nr_tlb_remote_flush */ - "", /* nr_tlb_remote_flush_received */ -#endif /* CONFIG_SMP */"nr_tlb_local_flush_all" , "nr_tlb_local_flush_one", #endif /* CONFIG_DEBUG_TLBFLUSH */
net/atm/lec.c +5 -1
@@ -721,7 +721,10 @@ static int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg)static int lec_mcast_attach (struct atm_vcc *vcc,int arg) { -if (arg <0 || arg >=MAX_LEC_ITF || !dev_lec[arg]) +if (arg <0 || arg >=MAX_LEC_ITF ) +return -EINVAL ; + arg =array_index_nospec (arg,MAX_LEC_ITF ); +if (!dev_lec[arg])return -EINVAL ; vcc->proto_data = dev_lec[arg];return lec_mcast_make (netdev_priv (dev_lec[arg]), vcc);
@@ -739,6 +742,7 @@ static int lecd_attach(struct atm_vcc *vcc, int arg) i = arg;if (arg >=MAX_LEC_ITF )return -EINVAL ; + i =array_index_nospec (arg,MAX_LEC_ITF );if (!dev_lec[i]) {int size;
net/bridge/br_input.c +14 -9
@@ -231,13 +231,10 @@ static void __br_handle_local_finish(struct sk_buff *skb)/* note: already called with rcu_read_lock */ static int br_handle_local_finish (struct net *net,struct sock *sk,struct sk_buff *skb) { -struct net_bridge_port *p =br_port_get_rcu (skb->dev); -__br_handle_local_finish (skb); -BR_INPUT_SKB_CB (skb)->brdev = p->br->dev; -br_pass_frame_up (skb); -return 0 ; +/* return 1 to signal the okfn() was called so it's ok to use the skb */ +return 1 ; }/*
@@ -308,10 +305,18 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb) goto forward; } -/* Deliver packet to local host only */ -NF_HOOK (NFPROTO_BRIDGE ,NF_BR_LOCAL_IN ,dev_net (skb->dev), -NULL , skb, skb->dev,NULL , br_handle_local_finish); -return RX_HANDLER_CONSUMED ; +/* The else clause should be hit when nf_hook(): +* - returns < 0 (drop/error) +* - returns = 0 (stolen/nf_queue) +* Thus return 1 from the okfn() to signal the skb is ok to pass +*/ +if (NF_HOOK (NFPROTO_BRIDGE ,NF_BR_LOCAL_IN , +dev_net (skb->dev),NULL , skb, skb->dev,NULL , + br_handle_local_finish) ==1 ) { +return RX_HANDLER_PASS ; + }else { +return RX_HANDLER_CONSUMED ; + } } forward:
net/bridge/br_multicast.c +3 -1
@@ -1983,7 +1983,8 @@ static void br_multicast_start_querier(struct net_bridge *br,__br_multicast_open (br, query); -list_for_each_entry (port, &br->port_list, list) { +rcu_read_lock (); +list_for_each_entry_rcu (port, &br->port_list, list) {if (port->state ==BR_STATE_DISABLED || port->state ==BR_STATE_BLOCKING )continue ;
@@ -1995,6 +1996,7 @@ static void br_multicast_start_querier(struct net_bridge *br,br_multicast_enable (&port->ip6_own_query);#endif } +rcu_read_unlock (); }int br_multicast_toggle (struct net_bridge *br,unsigned long val)
net/ipv4/fou.c +3 -1
@@ -119,6 +119,7 @@ static int gue_udp_recv(struct sock *sk, struct sk_buff *skb)struct guehdr *guehdr;void *data;u16 doffset =0 ; +u8 proto_ctype;if (!fou)return 1 ;
@@ -210,13 +211,14 @@ static int gue_udp_recv(struct sock *sk, struct sk_buff *skb)if (unlikely (guehdr->control))return gue_control_message (skb, guehdr); + proto_ctype = guehdr->proto_ctype;__skb_pull (skb,sizeof (struct udphdr ) + hdrlen);skb_reset_transport_header (skb);if (iptunnel_pull_offloads (skb)) goto drop; -return -guehdr->proto_ctype; +return -proto_ctype; drop:kfree_skb (skb);
net/ipv4/route.c +15 -1
@@ -1170,9 +1170,23 @@ static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie)static void ipv4_link_failure (struct sk_buff *skb) { +struct ip_options opt;struct rtable *rt; +int res; + +/* Recompile ip options since IPCB may not be valid anymore. +*/ +memset (&opt,0 ,sizeof (opt)); + opt.optlen =ip_hdr (skb)->ihl*4 -sizeof (struct iphdr ); + +rcu_read_lock (); + res =__ip_options_compile (dev_net (skb->dev), &opt, skb,NULL ); +rcu_read_unlock (); + +if (res) +return ; -icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_HOST_UNREACH ,0 ); +__icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_HOST_UNREACH ,0 , &opt); rt =skb_rtable (skb);if (rt)
net/ipv4/tcp_input.c +5 -5
@@ -389,11 +389,12 @@ static int __tcp_grow_window(const struct sock *sk, const struct sk_buff *skb)static void tcp_grow_window (struct sock *sk,const struct sk_buff *skb) {struct tcp_sock *tp =tcp_sk (sk); +int room; + + room =min_t (int, tp->window_clamp,tcp_space (sk)) - tp->rcv_ssthresh;/* Check #1 */ -if (tp->rcv_ssthresh < tp->window_clamp && - (int )tp->rcv_ssthresh <tcp_space (sk) && - !tcp_under_memory_pressure (sk)) { +if (room >0 && !tcp_under_memory_pressure (sk)) {int incr;/* Check #2. Increase window, if skb with such overhead
@@ -406,8 +407,7 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb)if (incr) { incr =max_t (int, incr,2 * skb->len); - tp->rcv_ssthresh =min (tp->rcv_ssthresh + incr, - tp->window_clamp); + tp->rcv_ssthresh +=min (room, incr);inet_csk (sk)->icsk_ack.quick |=1 ; } }
net/mac80211/driver-ops.h +3 -0
@@ -1163,6 +1163,9 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local, {struct ieee80211_sub_if_data *sdata =vif_to_sdata (txq->txq.vif); +if (local->in_reconfig) +return ; +if (!check_sdata_in_driver (sdata))return ;
scripts/mod/file2alias.c +47 -94
388 lines not on this page · raw message
security/device_cgroup.c +1 -1
@@ -568,7 +568,7 @@ static int propagate_exception(struct dev_cgroup *devcg_root, devcg->behavior == DEVCG_DEFAULT_ALLOW) { rc = dev_exception_add(devcg, ex); if (rc) - break; + return rc; } else {/* * in the other possible cases:
sound/core/info.c +10 -2
@@ -724,8 +724,11 @@ snd_info_create_entry(const char *name, struct snd_info_entry *parent)INIT_LIST_HEAD (&entry->children);INIT_LIST_HEAD (&entry->list); entry->parent = parent; -if (parent) +if (parent) { +mutex_lock (&parent->access);list_add_tail (&entry->list, &parent->children); +mutex_unlock (&parent->access); + }return entry; }
@@ -809,7 +812,12 @@ void snd_info_free_entry(struct snd_info_entry * entry)list_for_each_entry_safe (p, n, &entry->children, list)snd_info_free_entry (p); -list_del (&entry->list); + p = entry->parent; +if (p) { +mutex_lock (&p->access); +list_del (&entry->list); +mutex_unlock (&p->access); + }kfree (entry->name);if (entry->private_free) entry->private_free (entry);
sound/core/init.c +9 -9
@@ -408,14 +408,7 @@ int snd_card_disconnect(struct snd_card *card) card->shutdown =1 ;spin_unlock (&card->files_lock); -/* phase 1: disable fops (user space) operations for ALSA API */ -mutex_lock (&snd_card_mutex); - snd_cards[card->number] =NULL ; -clear_bit (card->number, snd_cards_lock); -mutex_unlock (&snd_card_mutex); - -/* phase 2: replace file->f_op with special dummy operations */ - +/* replace file->f_op with special dummy operations */ spin_lock (&card->files_lock);list_for_each_entry (mfile, &card->files_list, list) {/* it's critical part, use endless loop */
@@ -431,7 +424,7 @@ int snd_card_disconnect(struct snd_card *card) }spin_unlock (&card->files_lock); -/* phase 3: notify all connected devices about disconnection */ +/* notify all connected devices about disconnection */ /* at this point, they cannot respond to any calls except release() */ #if IS_ENABLED (CONFIG_SND_MIXER_OSS )
@@ -447,6 +440,13 @@ int snd_card_disconnect(struct snd_card *card)device_del (&card->card_dev); card->registered = false; } + +/* disable fops (user space) operations for ALSA API */ +mutex_lock (&snd_card_mutex); + snd_cards[card->number] =NULL ; +clear_bit (card->number, snd_cards_lock); +mutex_unlock (&snd_card_mutex); +#ifdef CONFIG_PM wake_up (&card->power_sleep);#endif