Linux 4.19.44
Greg KH
maintainerI'm announcing the release of the 4.19.44 kernel.
All users of the 4.19 kernel series must upgrade.
The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/kernel/head-nommu.S | 2 arch/mips/ath79/setup.c | 6 arch/powerpc/include/asm/book3s/64/pgalloc.h | 3 arch/powerpc/include/asm/reg_booke.h | 2 arch/powerpc/kernel/idle_book3s.S | 20 arch/powerpc/kernel/security.c | 1 arch/powerpc/kernel/smp.c | 90 +-- arch/um/drivers/port_user.c | 2 arch/x86/kernel/kprobes/core.c | 22 arch/x86/kernel/reboot.c | 21 arch/x86/kernel/vmlinux.lds.S | 2 arch/x86/kvm/lapic.c | 4 arch/x86/kvm/trace.h | 4 block/bfq-iosched.c | 8 block/blk-mq.c | 2 drivers/acpi/nfit/core.c | 12 drivers/char/ipmi/ipmi_si_hardcode.c | 2 drivers/clocksource/Kconfig | 1 drivers/clocksource/timer-oxnas-rps.c | 2 drivers/gpu/drm/amd/display/dc/core/dc.c | 19 drivers/gpu/drm/amd/display/dc/dc.h | 3 drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 9 drivers/gpu/drm/amd/display/dc/dce/dce_aux.h | 6 drivers/gpu/drm/imx/ipuv3-crtc.c | 2 drivers/gpu/drm/sun4i/sun4i_drv.c | 7 drivers/gpu/ipu-v3/ipu-dp.c | 12 drivers/hid/hid-input.c | 14 drivers/hwmon/pwm-fan.c | 2 drivers/iio/adc/xilinx-xadc-core.c | 3 drivers/infiniband/hw/hns/hns_roce_qp.c | 2 drivers/input/rmi4/rmi_driver.c | 6 drivers/irqchip/irq-ath79-misc.c | 11 drivers/isdn/gigaset/bas-gigaset.c | 9 drivers/isdn/mISDN/socket.c | 4 drivers/md/raid5.c | 19 drivers/net/bonding/bond_options.c | 7 drivers/net/dsa/mv88e6xxx/port.c | 24 - drivers/net/ethernet/cadence/macb_main.c | 6 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 drivers/net/ethernet/freescale/fec_main.c | 30 - drivers/net/ethernet/freescale/ucc_geth_ethtool.c | 8 drivers/net/ethernet/mellanox/mlxsw/core.c | 6 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 drivers/net/ethernet/mscc/ocelot.c | 2 drivers/net/ethernet/neterion/vxge/vxge-config.c | 1 drivers/net/ethernet/qlogic/qede/qede_ptp.c | 7 drivers/net/ethernet/seeq/sgiseeq.c | 1 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 drivers/net/phy/spi_ks8995.c | 9 drivers/net/tun.c | 14 drivers/net/wireless/marvell/mwl8k.c | 13 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 1 drivers/net/wireless/st/cw1200/scan.c | 5 drivers/nfc/st95hf/core.c | 7 drivers/nvdimm/btt_devs.c | 18 drivers/nvdimm/namespace_devs.c | 5 drivers/nvdimm/pmem.c | 8 drivers/pci/controller/pci-hyperv.c | 23 drivers/platform/x86/dell-laptop.c | 6 drivers/platform/x86/sony-laptop.c | 8 drivers/platform/x86/thinkpad_acpi.c | 72 ++- drivers/s390/block/dasd_eckd.c | 6 drivers/s390/char/con3270.c | 2 drivers/s390/char/fs3270.c | 3 drivers/s390/char/raw3270.c | 3 drivers/s390/char/raw3270.h | 4 drivers/s390/char/tty3270.c | 3 drivers/s390/crypto/pkey_api.c | 3 drivers/s390/net/ctcm_main.c | 1 drivers/scsi/aic7xxx/aic7770_osm.c | 1 drivers/scsi/aic7xxx/aic7xxx.h | 1 drivers/scsi/aic7xxx/aic7xxx_osm.c | 10 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | 1 drivers/usb/serial/generic.c | 39 + drivers/usb/typec/typec_wcove.c | 9 drivers/virt/fsl_hypervisor.c | 29 - drivers/virt/vboxguest/vboxguest_core.c | 31 + fs/afs/write.c | 1 fs/kernfs/dir.c | 5 include/linux/efi.h | 7 include/linux/elevator.h | 1 include/linux/kvm_host.h | 10 include/net/netfilter/nf_conntrack.h | 2 include/net/nfc/nci_core.h | 2 init/main.c | 4 mm/memory.c | 11 mm/memory_hotplug.c | 1 mm/vmscan.c | 29 - net/8021q/vlan_dev.c | 4 net/bridge/br_if.c | 13 net/core/fib_rules.c | 6 net/dsa/dsa.c | 11 net/ipv4/raw.c | 4 net/ipv6/sit.c | 2 net/mac80211/mesh_pathtbl.c | 2 net/mac80211/trace_msg.h | 7 net/mac80211/tx.c | 3 net/netfilter/ipvs/ip_vs_core.c | 2 net/netfilter/nf_conntrack_core.c | 35 + net/netfilter/nf_conntrack_netlink.c | 34 + net/netfilter/nf_conntrack_proto.c | 2 net/netfilter/nf_tables_api.c | 11 net/nfc/nci/hci.c | 8 net/packet/af_packet.c | 25 - net/strparser/strparser.c | 12 net/tipc/socket.c | 4 net/tls/tls_device.c | 5 net/wireless/nl80211.c | 18 net/wireless/reg.c | 39 + security/selinux/hooks.c | 8 tools/lib/traceevent/event-parse.c | 2 tools/testing/selftests/net/fib_tests.sh | 94 +-- tools/testing/selftests/net/run_netsocktests | 2 tools/testing/selftests/netfilter/Makefile | 2 tools/testing/selftests/netfilter/conntrack_icmp_related.sh | 283 ++++++++++++ virt/kvm/irqchip.c | 5 virt/kvm/kvm_main.c | 6 118 files changed, 1112 insertions(+), 379 deletions(-)
Aditya Pakki (1):
libnvdimm/btt: Fix a kmemdup failure check
Andrea Parri (1):
kernfs: fix barrier usage in __kernfs_new_node()
Andrei Otcheretianski (1):
mac80211: Increase MAX_MSG_LEN
Andrei Vagin (1):
netfilter: fix nf_l4proto_log_invalid to log invalid packets
Andy Duan (1):
net: fec: manage ahb clock in runtime pm
Arnd Bergmann (2):
clocksource/drivers/npcm: select TIMER_OF
s390: ctcm: fix ctcm_new_device error return code
Breno Leitao (1):
powerpc/64s: Include cpu header
Christoph Hellwig (1):
scsi: aic7xxx: fix EISA support
Christophe Leroy (1):
net: ucc_geth - fix Oops when changing number of buffers in the ring
Claudiu Manoil (1):
ocelot: Don't sleep in atomic context (irqs_disabled())
Colin Ian King (2):
vxge: fix return of a free'd memblock on a failed dma mapping
qede: fix write to free'd pointer error and double free of ptp
Corentin Labbe (1):
net: ethernet: stmmac: dwmac-sun8i: enable support of unicast filtering
Dan Carpenter (5):
netfilter: nf_tables: prevent shift wrap in nft_chain_parse_hook()
NFC: nci: Add some bounds checking in nci_hci_cmd_received()
nfc: nci: Potential off by one in ->pipes[] array drivers/virt/fsl_hypervisor.c: dereferencing error pointers in ioctl drivers/virt/fsl_hypervisor.c: prevent integer overflow in ioctl
Dan Williams (2):
acpi/nfit: Always dump _DSM output payload
init: initialize jump labels before command line option parsing
Daniel Gomez (2):
spi: Micrel eth switch: declare missing of table
spi: ST ST95HF NFC: declare missing of table
David Ahern (2):
selftests: fib_tests: Fix 'Command line is not complete' errors
ipv4: Fix raw socket lookup for local traffic
David Francis (1):
drm/amd/display: If one stream full updates, full update all planes
David Hildenbrand (1):
mm/memory_hotplug.c: drop memory device reference after find_memory_block()
Dexuan Cui (3):
PCI: hv: Fix a memory leak in hv_eject_device_work()
PCI: hv: Add hv_pci_remove_slots() when we unload the driver
PCI: hv: Add pci_destroy_slot() in pci_devices_present_work(), if necessary
Dmitry Torokhov (3):
HID: input: add mapping for Expose/Overview key
HID: input: add mapping for keyboard Brightness Up/Down/Toggle keys
HID: input: add mapping for "Toggle Display" key
Felix Fietkau (2):
mac80211: fix unaligned access in mesh table hash function
mac80211: fix memory accounting with A-MSDU aggregation
Florian Westphal (2):
selftests: netfilter: check icmp pkttoobig errors are set as related
netfilter: ctnetlink: don't use conntrack/expect object addresses as id
Greg Kroah-Hartman (1):
Linux 4.19.44
Gustavo A. R. Silva (3):
platform/x86: sony-laptop: Fix unintentional fall-through
usb: typec: Fix unchecked return value
rtlwifi: rtl8723ae: Fix missing break in switch statement
Hangbin Liu (2):
fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied
vlan: disable SIOCSHWTSTAMP in container
Hans de Goede (1):
virt: vbox: Sanity-check parameter types for hgcm-calls coming from userspace
Harald Freudenberger (1):
s390/pkey: add one more argument space for debug feature entry
Harini Katakam (1):
net: macb: Change interrupt and napi enable order in open
Heiner Kallweit (1):
net: dsa: mv88e6xxx: fix few issues in mv88e6390x_port_set_cmode
Ido Schimmel (4):
mlxsw: spectrum_switchdev: Add MDB entries in prepare phase
mlxsw: core: Do not use WQ_MEM_RECLAIM for EMAD workqueue
mlxsw: core: Do not use WQ_MEM_RECLAIM for mlxsw ordered workqueue
mlxsw: core: Do not use WQ_MEM_RECLAIM for mlxsw workqueue
Ilan Peer (1):
cfg80211: Handle WMM rules in regulatory domain intersection
Jakub Kicinski (2):
net/tls: fix the IV leaks
net: strparser: partially revert "strparser: Call skb_unclone conditionally"
Jan Kara (1):
mm/memory.c: fix modifying of page protection by insert_pfn()
Jarod Wilson (1):
bonding: fix arp_validate toggling in active-backup mode
Jason Wang (2):
tuntap: fix dividing by zero in ebpf queue selection
tuntap: synchronize through tfiles array instead of tun->numqueues
Jens Axboe (1):
bfq: update internal depth state when queue depth changes
Jian-Hong Pan (1):
x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T
Jiaxun Yang (1):
platform/x86: thinkpad_acpi: Disable Bluetooth for some machines
Johan Hovold (1):
USB: serial: fix unthrottle races
Johannes Weiner (1):
mm: fix inactive list balancing between NUMA nodes and cgroups
Julian Anastasov (1):
ipvs: do not schedule icmp errors from tunnels
Kangjie Lu (1):
libnvdimm/namespace: Fix a potential NULL pointer dereference
Laurentiu Tudor (2):
dpaa_eth: fix SG frame cleanup
powerpc/booke64: set RI in default MSR
Li RongQing (1):
libnvdimm/pmem: fix a possible OOB access when read and write pmem
Lijun Ou (1):
RDMA/hns: Bugfix for mapping user db
Lucas Stach (2):
gpu: ipu-v3: dp: fix CSC handling
drm/imx: don't skip DP channel disable for background plane
Marc Dionne (1):
afs: Unlock pages for __pagevec_release()
Mario Limonciello (1):
platform/x86: dell-laptop: fix rfkill functionality
Martin Leung (1):
drm/amd/display: extending AUX SW Timeout
Martin Schwidefsky (1):
s390/3270: fix lockdep false positive on view->lock
Masami Hiramatsu (1):
x86/kprobes: Avoid kretprobe recursion bug
Neil Armstrong (1):
clocksource/drivers/oxnas: Fix OX820 compatible
Nicholas Piggin (2):
powerpc/smp: Fix NMI IPI timeout
powerpc/smp: Fix NMI IPI xmon timeout
Nigel Croxon (1):
Don't jump to compute_result state from check_result state
Pablo Neira Ayuso (1):
netfilter: nf_tables: use-after-free in dynamic operations
Pan Bian (1):
Input: synaptics-rmi4 - fix possible double free
Paolo Abeni (1):
selinux: do not report error on connect(AF_UNSPEC)
Paolo Bonzini (1):
KVM: fix spectrev1 gadgets
Parthasarathy Bhuvaragan (1):
tipc: fix hanging clients using poll with EPOLLOUT flag
Paul Bolle (1):
isdn: bas_gigaset: use usb_fill_int_urb() properly
Paul Kocialkowski (3):
drm/sun4i: Set device driver data at bind time for use in unbind drm/sun4i: Fix component unbinding and component master deletion drm/sun4i: Unbind components before releasing DRM and memory
Peter Oberparleiter (1):
s390/dasd: Fix capacity calculation for large volumes
Petr Štetiar (2):
MIPS: perf: ath79: Fix perfcount IRQ assignment
mwl8k: Fix rate_idx underflow
Po-Hsu Lin (1):
selftests/net: correct the return value for run_netsocktests
Rick Lindsley (1):
powerpc/book3s/64: check for NULL pointer in pgd_alloc()
Rikard Falkeborn (1):
tools lib traceevent: Fix missing equality check for strcmp
Ritesh Raj Sarraf (1):
um: Don't hardcode path as it is architecture dependent
Russell Currey (1):
powerpc/powernv/idle: Restore IAMR after idle
Sami Tolvanen (1):
x86/build/lto: Fix truncated .bss with -fdata-sections
Stefan Wahren (1):
hwmon: (pwm-fan) Disable PWM if fetching cooling data fails
Stephen Suryaputra (1):
vrf: sit mtu should not be updated when vrf netdev is the link
Sunil Dutt (1):
nl80211: Add NL80211_FLAG_CLEAR_SKB flag for other NL commands
Sven Van Asbroeck (3):
iio: adc: xilinx: fix potential use-after-free on remove
iio: adc: xilinx: fix potential use-after-free on probe
iio: adc: xilinx: prevent touching unclocked h/w on remove
Taehee Yoo (1):
netfilter: nf_tables: add missing ->release_ops() in error path of newrule()
Tetsuo Handa (1):
mISDN: Check address length before reading address family
Thomas Bogendoerfer (1):
net: seeq: fix crash caused by not set dev.parent
Tigran Tadevosyan (1):
ARM: 8856/1: NOMMU: Fix CCR register faulty initialization when MPU is disabled
Tobin C. Harding (1):
bridge: Fix error path for kobject_init_and_add()
Tony Camuso (1):
ipmi: ipmi_si_hardcode.c: init si_type array to fix a crash
Vitaly Kuznetsov (1):
KVM: x86: avoid misreporting level-triggered irqs as edge-triggered in tracing
Wei Yongjun (1):
cw1200: fix missing unlock on error in cw1200_hw_scan()
YueHaibing (2):
net: dsa: Fix error cleanup path in dsa_init_module
packet: Fix error path in packet_init
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 19 -SUBLEVEL = 43 +SUBLEVEL = 44 EXTRAVERSION = NAME = "People's Front"
arch/arm/kernel/head-nommu.S +1 -1
@@ -133,9 +133,9 @@ __secondary_data: */ .text __after_proc_init: -#ifdef CONFIG_ARM_MPU M_CLASS(movw r12, #:lower16:BASEADDR_V7M_SCB) M_CLASS(movt r12, #:upper16:BASEADDR_V7M_SCB) +#ifdef CONFIG_ARM_MPU M_CLASS(ldr r3, [r12, 0x50]) AR_CLASS(mrc p15, 0, r3, c0, c1, 4) @ Read ID_MMFR0 and r3, r3, #(MMFR0_PMSA) @ PMSA field
arch/mips/ath79/setup.c +0 -6
@@ -211,12 +211,6 @@ const char *get_system_type(void)return ath79_sys_type; } -int get_c0_perfcount_int (void ) -{ -return ATH79_MISC_IRQ (5 ); -} -EXPORT_SYMBOL_GPL (get_c0_perfcount_int); -unsigned int get_c0_compare_int (void ) {return CP0_LEGACY_COMPARE_IRQ ;
arch/powerpc/include/asm/book3s/64/pgalloc.h +3 -0
@@ -83,6 +83,9 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) pgd =kmem_cache_alloc (PGT_CACHE (PGD_INDEX_SIZE ),pgtable_gfp_flags (mm,GFP_KERNEL )); +if (unlikely (!pgd)) +return pgd; +/* * Don't scan the PGD for pointers, it contains references to PUDs but * those references are not full pointers and so can't be recognised by
arch/powerpc/include/asm/reg_booke.h +1 -1
@@ -41,7 +41,7 @@#if defined(CONFIG_PPC_BOOK3E_64 )#define MSR_64BIT MSR_CM -#define MSR_ (MSR_ME | MSR_CE) +#define MSR_ (MSR_ME | MSR_RI | MSR_CE)#define MSR_KERNEL (MSR_ | MSR_64BIT)#define MSR_USER32 (MSR_ | MSR_PR | MSR_EE)#define MSR_USER64 (MSR_USER32 | MSR_64BIT)
arch/powerpc/kernel/idle_book3s.S +20 -0
@@ -170,6 +170,9 @@ core_idle_lock_held: bne- core_idle_lock_held blr +/* Reuse an unused pt_regs slot for IAMR */ +#define PNV_POWERSAVE_IAMR _DAR + /* * Pass requested state in r3: * r3 - PNV_THREAD_NAP/SLEEP/WINKLE in POWER8
@@ -200,6 +203,12 @@ pnv_powersave_common: /* Continue saving state */ SAVE_GPR(2, r1) SAVE_NVGPRS(r1) + +BEGIN_FTR_SECTION + mfspr r5, SPRN_IAMR + std r5, PNV_POWERSAVE_IAMR(r1) +END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) + mfcr r5 std r5,_CCR(r1) std r1,PACAR1(r13)
@@ -924,6 +933,17 @@ BEGIN_FTR_SECTION END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) REST_NVGPRS(r1) REST_GPR(2, r1) + +BEGIN_FTR_SECTION + /* IAMR was saved in pnv_powersave_common() */ + ld r5, PNV_POWERSAVE_IAMR(r1) + mtspr SPRN_IAMR, r5 + /* + * We don't need an isync here because the upcoming mtmsrd is + * execution synchronizing. + */ +END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) + ld r4,PACAKMSR(r13) ld r5,_LINK(r1) ld r6,_CCR(r1)
arch/powerpc/kernel/security.c +1 -0
@@ -4,6 +4,7 @@// // Copyright 2018, Michael Ellerman, IBM Corporation. +#include <linux/cpu.h> #include <linux/kernel.h> #include <linux/device.h> #include <linux/seq_buf.h>
arch/powerpc/kernel/smp.c +28 -62
168 lines not on this page · raw message
arch/um/drivers/port_user.c +1 -1
@@ -168,7 +168,7 @@ int port_connection(int fd, int *socket, int *pid_out) {int new, err;char *argv[] = {"/usr/sbin/in.telnetd" ,"-L" , -"/usr/lib/uml/port-helper" ,NULL }; +OS_LIB_PATH "/uml/port-helper" ,NULL };struct port_pre_exec_data data; new =accept (fd,NULL ,0 );
arch/x86/kernel/kprobes/core.c +20 -2
@@ -749,11 +749,16 @@ asm(NOKPROBE_SYMBOL (kretprobe_trampoline);STACK_FRAME_NON_STANDARD (kretprobe_trampoline); +static struct kprobe kretprobe_kprobe = { + .addr = (void *)kretprobe_trampoline, +}; +/* * Called from kretprobe_trampoline */ __visible __used void *trampoline_handler(struct pt_regs *regs) { +struct kprobe_ctlblk *kcb;struct kretprobe_instance *ri =NULL ;struct hlist_head *head, empty_rp;struct hlist_node *tmp;
@@ -763,6 +768,17 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)void *frame_pointer;bool skipped = false; +preempt_disable (); + +/* +* Set a dummy kprobe for avoiding kretprobe recursion. +* Since kretprobe never run in kprobe handler, kprobe must not +* be running at this point. +*/ + kcb =get_kprobe_ctlblk (); +__this_cpu_write (current_kprobe, &kretprobe_kprobe); + kcb->kprobe_status =KPROBE_HIT_ACTIVE ; +INIT_HLIST_HEAD (&empty_rp);kretprobe_hash_lock (current, &head, &flags);/* fixup registers */
@@ -838,10 +854,9 @@ __visible __used void *trampoline_handler(struct pt_regs *regs) orig_ret_address = (unsigned long )ri->ret_addr;if (ri->rp && ri->rp->handler) {__this_cpu_write (current_kprobe, &ri->rp->kp); -get_kprobe_ctlblk ()->kprobe_status =KPROBE_HIT_ACTIVE ; ri->ret_addr = correct_ret_addr; ri->rp->handler (ri, regs); -__this_cpu_write (current_kprobe,NULL ); +__this_cpu_write (current_kprobe, &kretprobe_kprobe); }recycle_rp_inst (ri, &empty_rp);
@@ -857,6 +872,9 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)kretprobe_hash_unlock (current, &flags); +__this_cpu_write (current_kprobe,NULL ); +preempt_enable (); +hlist_for_each_entry_safe (ri, tmp, &empty_rp, hlist) {hlist_del (&ri->hlist);kfree (ri);
arch/x86/kernel/reboot.c +21 -0
@@ -81,6 +81,19 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)return 0 ; } +/* +* Some machines don't handle the default ACPI reboot method and +* require the EFI reboot method: +*/ +static int __init set_efi_reboot (const struct dmi_system_id *d) +{ +if (reboot_type !=BOOT_EFI && !efi_runtime_disabled ()) { + reboot_type =BOOT_EFI ; +pr_info ("%s series board detected. Selecting EFI-method for reboot.\n" , d->ident); + } +return 0 ; +} +void __noreturn machine_real_restart (unsigned int type) {local_irq_disable ();
@@ -166,6 +179,14 @@ static const struct dmi_system_id reboot_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"), }, }, + { /* Handle reboot issue on Acer TravelMate X514-51T */ + .callback = set_efi_reboot, + .ident = "Acer TravelMate X514-51T", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"), + }, + },/* Apple */ {/* Handle problems with rebooting on Apple MacBook5 */
arch/x86/kernel/vmlinux.lds.S +1 -1
@@ -372,7 +372,7 @@ SECTIONS .bss : AT(ADDR(.bss) - LOAD_OFFSET) { __bss_start = .; *(.bss..page_aligned) - *(.bss) + *(BSS_MAIN) BSS_DECRYPTED . = ALIGN(PAGE_SIZE); __bss_stop = .;
arch/x86/kvm/lapic.c +3 -1
@@ -133,6 +133,7 @@ static inline bool kvm_apic_map_get_logical_dest(struct kvm_apic_map *map,if (offset <= max_apic_id) {u8 cluster_size =min (max_apic_id - offset +1 ,16U ); + offset =array_index_nospec (offset, map->max_apic_id +1 ); *cluster = &map->phys_map[offset]; *mask = dest_id & (0xffff >> (16 - cluster_size)); }else {
@@ -896,7 +897,8 @@ static inline bool kvm_apic_map_get_dest_lapic(struct kvm *kvm,if (irq->dest_id > map->max_apic_id) { *bitmap =0 ; }else { - *dst = &map->phys_map[irq->dest_id]; +u32 dest_id =array_index_nospec (irq->dest_id, map->max_apic_id +1 ); + *dst = &map->phys_map[dest_id]; *bitmap =1 ; }return true;
arch/x86/kvm/trace.h +2 -2
@@ -438,13 +438,13 @@ TRACE_EVENT(kvm_apic_ipi, ); TRACE_EVENT(kvm_apic_accept_irq, - TP_PROTO(__u32 apicid, __u16 dm, __u8 tm, __u8 vec), + TP_PROTO(__u32 apicid, __u16 dm, __u16 tm, __u8 vec), TP_ARGS(apicid, dm, tm, vec), TP_STRUCT__entry( __field( __u32, apicid ) __field( __u16, dm ) - __field( __u8, tm ) + __field( __u16, tm ) __field( __u8, vec ) ),
block/bfq-iosched.c +7 -1
@@ -5226,7 +5226,7 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd,return min_shallow; } -static int bfq_init_hctx (struct blk_mq_hw_ctx *hctx,unsigned int index) +static void bfq_depth_updated (struct blk_mq_hw_ctx *hctx) {struct bfq_data *bfqd = hctx->queue->elevator->elevator_data;struct blk_mq_tags *tags = hctx->sched_tags;
@@ -5234,6 +5234,11 @@ static int bfq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int index) min_shallow =bfq_update_depths (bfqd, &tags->bitmap_tags);sbitmap_queue_min_shallow_depth (&tags->bitmap_tags, min_shallow); +} + +static int bfq_init_hctx (struct blk_mq_hw_ctx *hctx,unsigned int index) +{ +bfq_depth_updated (hctx);return 0 ; }
@@ -5656,6 +5661,7 @@ static struct elevator_type iosched_bfq_mq = { .requests_merged = bfq_requests_merged, .request_merged = bfq_request_merged, .has_work = bfq_has_work, + .depth_updated = bfq_depth_updated, .init_hctx = bfq_init_hctx, .init_sched = bfq_init_queue, .exit_sched = bfq_exit_queue,
block/blk-mq.c +2 -0
@@ -2887,6 +2887,8 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr) }if (ret)break ; +if (q->elevator && q->elevator->type->ops.mq.depth_updated) + q->elevator->type->ops.mq.depth_updated (hctx); }if (!ret)
drivers/acpi/nfit/core.c +6 -6
@@ -542,6 +542,12 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, goto out; } +dev_dbg (dev,"%s cmd: %s output length: %d\n" , dimm_name, + cmd_name, out_obj->buffer.length); +print_hex_dump_debug (cmd_name,DUMP_PREFIX_OFFSET ,4 ,4 , + out_obj->buffer.pointer, +min_t (u32,128 , out_obj->buffer.length), true); +if (call_pkg) { call_pkg->nd_fw_size = out_obj->buffer.length; memcpy(call_pkg->nd_payload + call_pkg->nd_size_in,
@@ -560,12 +566,6 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,return 0 ; } -dev_dbg (dev,"%s cmd: %s output length: %d\n" , dimm_name, - cmd_name, out_obj->buffer.length); -print_hex_dump_debug (cmd_name,DUMP_PREFIX_OFFSET ,4 ,4 , - out_obj->buffer.pointer, -min_t (u32,128 , out_obj->buffer.length), true); -for (i =0 , offset =0 ; i < desc->out_num; i++) { u32 out_size = nd_cmd_out_size(nvdimm, cmd, desc, i, buf, (u32 *) out_obj->buffer.pointer,
drivers/char/ipmi/ipmi_si_hardcode.c +2 -0
@@ -200,6 +200,8 @@ void __init ipmi_hardcode_init(void)char *str;char *si_type[SI_MAX_PARMS ]; +memset (si_type,0 ,sizeof (si_type)); +/* Parse out the si_type string into its components. */ str = si_type_str;if (*str !='\0' ) {
drivers/clocksource/Kconfig +1 -0
@@ -136,6 +136,7 @@ config VT8500_TIMER config NPCM7XX_TIMER bool "NPCM7xx timer driver" if COMPILE_TEST depends on HAS_IOMEM + select TIMER_OF select CLKSRC_MMIO help Enable 24-bit TIMER0 and TIMER1 counters in the NPCM7xx architecture,
drivers/clocksource/timer-oxnas-rps.c +1 -1
@@ -296,4 +296,4 @@ static int __init oxnas_rps_timer_init(struct device_node *np)TIMER_OF_DECLARE (ox810se_rps,"oxsemi,ox810se-rps-timer" , oxnas_rps_timer_init);TIMER_OF_DECLARE (ox820_rps, -"oxsemi,ox820se-rps-timer" , oxnas_rps_timer_init); +"oxsemi,ox820-rps-timer" , oxnas_rps_timer_init);
drivers/gpu/drm/amd/display/dc/core/dc.c +19 -0
@@ -1213,6 +1213,11 @@ static enum surface_update_type det_surface_update(const struct dc *dc,return UPDATE_TYPE_FULL ; } +if (u->surface->force_full_update) { + update_flags->bits.full_update =1 ; +return UPDATE_TYPE_FULL ; + } + type =get_plane_info_update_type (u);elevate_update_type (&overall_type, type);
@@ -1467,6 +1472,14 @@ void dc_commit_updates_for_stream(struct dc *dc, }dc_resource_state_copy_construct (state, context); + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *new_pipe = &context->res_ctx.pipe_ctx[i]; +struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i]; + +if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state) + new_pipe->plane_state->force_full_update = true; + } }
@@ -1510,6 +1523,12 @@ void dc_commit_updates_for_stream(struct dc *dc, dc->current_state = context;dc_release_state (old); +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; + +if (pipe_ctx->plane_state && pipe_ctx->stream == stream) + pipe_ctx->plane_state->force_full_update = false; + } }/*let's use current_state to update watermark etc*/ if (update_type >=UPDATE_TYPE_FULL )
drivers/gpu/drm/amd/display/dc/dc.h +3 -0
@@ -505,6 +505,9 @@ struct dc_plane_state {struct dc_plane_status status;struct dc_context *ctx; +/* HACK: Workaround for forcing full reprogramming under some conditions */ +bool force_full_update; +/* private to dc_surface.c */ enum dc_irq_source irq_source;struct kref refcount;
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +6 -3
@@ -189,6 +189,12 @@ static void submit_channel_request(1 , 0); } + +REG_UPDATE (AUX_INTERRUPT_CONTROL ,AUX_SW_DONE_ACK ,1 ); + +REG_WAIT (AUX_SW_STATUS ,AUX_SW_DONE ,0 , +10 , aux110->timeout_period/10 ); +/* set the delay and the number of bytes to write */ /* The length include
@@ -241,9 +247,6 @@ static void submit_channel_request( } } -REG_UPDATE (AUX_INTERRUPT_CONTROL ,AUX_SW_DONE_ACK ,1 ); -REG_WAIT (AUX_SW_STATUS ,AUX_SW_DONE ,0 , -10 , aux110->timeout_period/10 );REG_UPDATE (AUX_SW_CONTROL ,AUX_SW_GO ,1 ); }
drivers/gpu/drm/amd/display/dc/dce/dce_aux.h +3 -3
@@ -69,11 +69,11 @@ enum { /* This is the timeout as defined in DP 1.2a,* at most within ~240usec. That means, * increasing this timeout will not affect normal operation, * and we'll timeout after -* SW_AUX_TIMEOUT_PERIOD_MULTIPLIER * AUX_TIMEOUT_PERIOD = 1600usec. +* SW_AUX_TIMEOUT_PERIOD_MULTIPLIER * AUX_TIMEOUT_PERIOD = 2400usec. * This timeout is especially important for -* resume from S3 and CTS. +* converters, resume from S3, and CTS. */ -SW_AUX_TIMEOUT_PERIOD_MULTIPLIER =4 +SW_AUX_TIMEOUT_PERIOD_MULTIPLIER =6 };struct aux_engine_dce110 {struct aux_engine base;
drivers/gpu/drm/imx/ipuv3-crtc.c +1 -1
@@ -78,7 +78,7 @@ static void ipu_crtc_disable_planes(struct ipu_crtc *ipu_crtc,if (disable_partial)ipu_plane_disable (ipu_crtc->plane[1 ], true);if (disable_full) -ipu_plane_disable (ipu_crtc->plane[0 ], false); +ipu_plane_disable (ipu_crtc->plane[0 ], true); } static void ipu_crtc_atomic_disable(struct drm_crtc *crtc,
drivers/gpu/drm/sun4i/sun4i_drv.c +7 -0
@@ -92,6 +92,8 @@ static int sun4i_drv_bind(struct device *dev) ret = -ENOMEM ; goto free_drm; } + +dev_set_drvdata (dev, drm); drm->dev_private = drv;INIT_LIST_HEAD (&drv->frontend_list);INIT_LIST_HEAD (&drv->engine_list);
@@ -156,7 +158,10 @@ static void sun4i_drv_unbind(struct device *dev)drm_kms_helper_poll_fini (drm);sun4i_framebuffer_free (drm);drm_mode_config_cleanup (drm); + +component_unbind_all (dev,NULL );of_reserved_mem_device_release (dev); +drm_dev_put (drm); }
@@ -405,6 +410,8 @@ static int sun4i_drv_probe(struct platform_device *pdev)static int sun4i_drv_remove (struct platform_device *pdev) { +component_master_del (&pdev->dev, &sun4i_drv_master_ops); +return 0 ; }
drivers/gpu/ipu-v3/ipu-dp.c +9 -3
@@ -195,7 +195,8 @@ int ipu_dp_setup_channel(struct ipu_dp *dp,ipu_dp_csc_init (flow, flow->foreground.in_cs, flow->out_cs,DP_COM_CONF_CSC_DEF_BOTH ); }else { -if (flow->foreground.in_cs == flow->out_cs) +if (flow->foreground.in_cs ==IPUV3_COLORSPACE_UNKNOWN || + flow->foreground.in_cs == flow->out_cs)/* * foreground identical to output, apply color * conversion on background
@@ -261,6 +262,8 @@ void ipu_dp_disable_channel(struct ipu_dp *dp, bool sync)struct ipu_dp_priv *priv = flow->priv;u32 reg, csc; + dp->in_cs =IPUV3_COLORSPACE_UNKNOWN ; +if (!dp->foreground)return ;
@@ -268,8 +271,9 @@ void ipu_dp_disable_channel(struct ipu_dp *dp, bool sync) reg =readl (flow->base +DP_COM_CONF ); csc = reg &DP_COM_CONF_CSC_DEF_MASK ; -if (csc ==DP_COM_CONF_CSC_DEF_FG ) - reg &= ~DP_COM_CONF_CSC_DEF_MASK ; + reg &= ~DP_COM_CONF_CSC_DEF_MASK ; +if (csc ==DP_COM_CONF_CSC_DEF_BOTH || csc ==DP_COM_CONF_CSC_DEF_BG ) + reg |=DP_COM_CONF_CSC_DEF_BG ; reg &= ~DP_COM_CONF_FG_EN ;writel (reg, flow->base +DP_COM_CONF );
@@ -347,6 +351,8 @@ int ipu_dp_init(struct ipu_soc *ipu, struct device *dev, unsigned long base)mutex_init (&priv->mutex);for (i =0 ; i <IPUV3_NUM_FLOWS ; i++) { + priv->flow[i].background.in_cs =IPUV3_COLORSPACE_UNKNOWN ; + priv->flow[i].foreground.in_cs =IPUV3_COLORSPACE_UNKNOWN ; priv->flow[i].foreground.foreground = true; priv->flow[i].base = priv->base + ipu_dp_flow_base[i]; priv->flow[i].priv = priv;
drivers/hid/hid-input.c +14 -0
@@ -677,6 +677,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielbreak ; } +if ((usage->hid &0xf0 ) ==0xb0 ) {/* SC - Display */ +switch (usage->hid &0xf ) { +case 0x05 :map_key_clear (KEY_SWITCHVIDEOMODE );break ; +default : goto ignore; + } +break ; + } +/* * Some lazy vendors declare 255 usages for System Control, * leading to the creation of ABS_X|Y axis and too many others.
@@ -895,6 +903,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x074 :map_key_clear (KEY_BRIGHTNESS_MAX );break ;case 0x075 :map_key_clear (KEY_BRIGHTNESS_AUTO );break ; +case 0x079 :map_key_clear (KEY_KBDILLUMUP );break ; +case 0x07a :map_key_clear (KEY_KBDILLUMDOWN );break ; +case 0x07c :map_key_clear (KEY_KBDILLUMTOGGLE );break ; +case 0x082 :map_key_clear (KEY_VIDEO_NEXT );break ;case 0x083 :map_key_clear (KEY_LAST );break ;case 0x084 :map_key_clear (KEY_ENTER );break ;
@@ -1026,6 +1038,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x2cb :map_key_clear (KEY_KBDINPUTASSIST_ACCEPT );break ;case 0x2cc :map_key_clear (KEY_KBDINPUTASSIST_CANCEL );break ; +case 0x29f :map_key_clear (KEY_SCALE );break ; +default :map_key_clear (KEY_UNKNOWN ); }break ;
drivers/hwmon/pwm-fan.c +1 -1
@@ -250,7 +250,7 @@ static int pwm_fan_probe(struct platform_device *pdev) ret =pwm_fan_of_get_cooling_data (&pdev->dev, ctx);if (ret) -return ret; + goto err_pwm_disable; ctx->pwm_fan_state = ctx->pwm_fan_max_state;if (IS_ENABLED (CONFIG_THERMAL )) {
drivers/iio/adc/xilinx-xadc-core.c +2 -1
@@ -1290,6 +1290,7 @@ static int xadc_probe(struct platform_device *pdev) err_free_irq:free_irq (xadc->irq, indio_dev); +cancel_delayed_work_sync (&xadc->zynq_unmask_work); err_clk_disable_unprepare:clk_disable_unprepare (xadc->clk); err_free_samplerate_trigger:
@@ -1319,8 +1320,8 @@ static int xadc_remove(struct platform_device *pdev)iio_triggered_buffer_cleanup (indio_dev); }free_irq (xadc->irq, indio_dev); +cancel_delayed_work_sync (&xadc->zynq_unmask_work);clk_disable_unprepare (xadc->clk); -cancel_delayed_work (&xadc->zynq_unmask_work);kfree (xadc->data);kfree (indio_dev->channels);
drivers/infiniband/hw/hns/hns_roce_qp.c +1 -1
@@ -494,7 +494,7 @@ static int hns_roce_set_kernel_sq_size(struct hns_roce_dev *hr_dev,static int hns_roce_qp_has_sq (struct ib_qp_init_attr *attr) { -if (attr->qp_type ==IB_QPT_XRC_TGT ) +if (attr->qp_type ==IB_QPT_XRC_TGT || !attr->cap.max_send_wr)return 0 ;return 1 ;
drivers/input/rmi4/rmi_driver.c +1 -5
@@ -860,7 +860,7 @@ static int rmi_create_function(struct rmi_device *rmi_dev, error =rmi_register_function (fn);if (error) - goto err_put_fn; +return error;if (pdt->function_number ==0x01 ) data->f01_container = fn;
@@ -870,10 +870,6 @@ static int rmi_create_function(struct rmi_device *rmi_dev,list_add_tail (&fn->node, &data->function_list);return RMI_SCAN_CONTINUE ; - -err_put_fn: -put_device (&fn->dev); -return error; }void rmi_enable_irq (struct rmi_device *rmi_dev,bool clear_wake)
drivers/irqchip/irq-ath79-misc.c +11 -0
@@ -22,6 +22,15 @@#define AR71XX_RESET_REG_MISC_INT_ENABLE 4#define ATH79_MISC_IRQ_COUNT 32 +#define ATH79_MISC_PERF_IRQ 5 + +static int ath79_perfcount_irq; + +int get_c0_perfcount_int (void ) +{ +return ath79_perfcount_irq; +} +EXPORT_SYMBOL_GPL (get_c0_perfcount_int);static void ath79_misc_irq_handler (struct irq_desc *desc) {
@@ -113,6 +122,8 @@ static void __init ath79_misc_intc_domain_init( {void __iomem *base = domain->host_data; + ath79_perfcount_irq =irq_create_mapping (domain,ATH79_MISC_PERF_IRQ ); +/* Disable and clear all interrupts */ __raw_writel (0 , base +AR71XX_RESET_REG_MISC_INT_ENABLE );__raw_writel (0 , base +AR71XX_RESET_REG_MISC_INT_STATUS );
drivers/isdn/gigaset/bas-gigaset.c +5 -4
@@ -958,6 +958,7 @@ static void write_iso_callback(struct urb *urb)*/ static int starturbs (struct bc_state *bcs) { +struct usb_device *udev = bcs->cs->hw.bas->udev;struct bas_bc_state *ubc = bcs->hw.bas;struct urb *urb;int j, k;
@@ -975,8 +976,8 @@ static int starturbs(struct bc_state *bcs) rc = -EFAULT ; goto error; } -usb_fill_int_urb (urb, bcs->cs->hw.bas->udev, -usb_rcvisocpipe (urb->dev,3 +2 * bcs->channel), +usb_fill_int_urb (urb, udev, +usb_rcvisocpipe (udev,3 +2 * bcs->channel), ubc->isoinbuf + k *BAS_INBUFSIZE ,BAS_INBUFSIZE , read_iso_callback, bcs,BAS_FRAMETIME );
@@ -1006,8 +1007,8 @@ static int starturbs(struct bc_state *bcs) rc = -EFAULT ; goto error; } - usb_fill_int_urb(urb, bcs->cs->hw.bas->udev, - usb_sndisocpipe(urb->dev, 4 + 2 * bcs->channel), + usb_fill_int_urb(urb, udev, + usb_sndisocpipe(udev, 4 + 2 * bcs->channel), ubc->isooutbuf->data, sizeof(ubc->isooutbuf->data), write_iso_callback, &ubc->isoouturbs[k],
drivers/isdn/mISDN/socket.c +2 -2
@@ -711,10 +711,10 @@ base_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)struct sock *sk = sock->sk;int err =0 ; -if (!maddr || maddr->family !=AF_ISDN ) +if (addr_len <sizeof (struct sockaddr_mISDN ))return -EINVAL ; -if (addr_len <sizeof (struct sockaddr_mISDN )) +if (!maddr || maddr->family !=AF_ISDN )return -EINVAL ;lock_sock (sk);
drivers/md/raid5.c +4 -15
@@ -4221,26 +4221,15 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh,case check_state_check_result: sh->check_state = check_state_idle; +if (s->failed >1 ) +break ;/* handle a successful check operation, if parity is correct * we are done. Otherwise update the mismatch count and repair * parity if !MD_RECOVERY_CHECK */ if (sh->ops.zero_sum_result ==0 ) { -/* both parities are correct */ -if (!s->failed) -set_bit (STRIPE_INSYNC , &sh->state); -else { -/* in contrast to the raid5 case we can validate -* parity, but still have a failure to write -* back -*/ - sh->check_state = check_state_compute_result; -/* Returning at this point means that we may go -* off and bring p and/or q uptodate again so -* we make sure to check zero_sum_result again -* to verify if p or q need writeback -*/ - } +/* Any parity checked was correct */ +set_bit (STRIPE_INSYNC , &sh->state); }else {atomic64_add (STRIPE_SECTORS , &conf->mddev->resync_mismatches);if (test_bit (MD_RECOVERY_CHECK , &conf->mddev->recovery)) {
drivers/net/bonding/bond_options.c +0 -7
@@ -1098,13 +1098,6 @@ static int bond_option_arp_validate_set(struct bonding *bond, {netdev_dbg (bond->dev,"Setting arp_validate to %s (%llu)\n" , newval->string, newval->value); - -if (bond->dev->flags &IFF_UP ) { -if (!newval->value) - bond->recv_probe =NULL ; -else if (bond->params.arp_interval) - bond->recv_probe = bond_arp_rcv; - } bond->params.arp_validate = newval->value;return 0 ;
drivers/net/dsa/mv88e6xxx/port.c +16 -8
@@ -379,18 +379,22 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,return 0 ; lane =mv88e6390x_serdes_get_lane (chip, port); -if (lane <0 ) +if (lane <0 && lane != -ENODEV )return lane; -if (chip->ports[port].serdes_irq) { - err =mv88e6390_serdes_irq_disable (chip, port, lane); +if (lane >=0 ) { +if (chip->ports[port].serdes_irq) { + err =mv88e6390_serdes_irq_disable (chip, port, lane); +if (err) +return err; + } + + err =mv88e6390x_serdes_power (chip, port, false);if (err)return err; } - err =mv88e6390x_serdes_power (chip, port, false); -if (err) -return err; + chip->ports[port].cmode =0 ;if (cmode) { err =mv88e6xxx_port_read (chip, port,MV88E6XXX_PORT_STS , ®);
@@ -404,6 +408,12 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,if (err)return err; + chip->ports[port].cmode = cmode; + + lane =mv88e6390x_serdes_get_lane (chip, port); +if (lane <0 ) +return lane; + err =mv88e6390x_serdes_power (chip, port, true);if (err)return err;
@@ -415,8 +425,6 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port, } } - chip->ports[port].cmode = cmode; -return 0 ; }
drivers/net/ethernet/cadence/macb_main.c +3 -3
@@ -2419,12 +2419,12 @@ static int macb_open(struct net_device *dev)return err; } - bp->macbgem_ops.mog_init_rings (bp); -macb_init_hw (bp); -for (q =0 , queue = bp->queues; q < bp->num_queues; ++q, ++queue)napi_enable (&queue->napi); + bp->macbgem_ops.mog_init_rings (bp); +macb_init_hw (bp); +/* schedule a link state check */ phy_start (dev->phydev);
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +1 -1
@@ -1648,7 +1648,7 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv, qm_sg_entry_get_len(&sgt[0]), dma_dir);/* remaining pages were mapped with skb_frag_dma_map() */ -for (i =1 ; i < nr_frags; i++) { +for (i =1 ; i <= nr_frags; i++) {WARN_ON (qm_sg_entry_is_ext (&sgt[i])); dma_unmap_page(dev, qm_sg_addr(&sgt[i]),
drivers/net/ethernet/freescale/fec_main.c +21 -9
@@ -1850,13 +1850,9 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable)int ret;if (enable) { - ret =clk_prepare_enable (fep->clk_ahb); -if (ret) -return ret; - ret =clk_prepare_enable (fep->clk_enet_out);if (ret) - goto failed_clk_enet_out; +return ret;if (fep->clk_ptp) {mutex_lock (&fep->ptp_clk_mutex);
@@ -1876,7 +1872,6 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable)phy_reset_after_clk_enable (ndev->phydev); }else { -clk_disable_unprepare (fep->clk_ahb);clk_disable_unprepare (fep->clk_enet_out);if (fep->clk_ptp) {mutex_lock (&fep->ptp_clk_mutex);
@@ -1895,8 +1890,6 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable) failed_clk_ptp:if (fep->clk_enet_out)clk_disable_unprepare (fep->clk_enet_out); -failed_clk_enet_out: -clk_disable_unprepare (fep->clk_ahb);return ret; }
@@ -3485,6 +3478,9 @@ fec_probe(struct platform_device *pdev) ret =clk_prepare_enable (fep->clk_ipg);if (ret) goto failed_clk_ipg; + ret =clk_prepare_enable (fep->clk_ahb); +if (ret) + goto failed_clk_ahb; fep->reg_phy =devm_regulator_get (&pdev->dev,"phy" );if (!IS_ERR (fep->reg_phy)) {
@@ -3578,6 +3574,9 @@ fec_probe(struct platform_device *pdev)pm_runtime_put (&pdev->dev);pm_runtime_disable (&pdev->dev); failed_regulator: +clk_disable_unprepare (fep->clk_ahb); +failed_clk_ahb: +clk_disable_unprepare (fep->clk_ipg); failed_clk_ipg:fec_enet_clk_enable (ndev, false); failed_clk:
@@ -3701,6 +3700,7 @@ static int __maybe_unused fec_runtime_suspend(struct device *dev)struct net_device *ndev =dev_get_drvdata (dev);struct fec_enet_private *fep =netdev_priv (ndev); +clk_disable_unprepare (fep->clk_ahb);clk_disable_unprepare (fep->clk_ipg);return 0 ;
@@ -3710,8 +3710,20 @@ static int __maybe_unused fec_runtime_resume(struct device *dev) {struct net_device *ndev =dev_get_drvdata (dev);struct fec_enet_private *fep =netdev_priv (ndev); +int ret; -return clk_prepare_enable (fep->clk_ipg); + ret =clk_prepare_enable (fep->clk_ahb); +if (ret) +return ret; + ret =clk_prepare_enable (fep->clk_ipg); +if (ret) + goto failed_clk_ipg; + +return 0 ; + +failed_clk_ipg: +clk_disable_unprepare (fep->clk_ahb); +return ret; }static const struct dev_pm_ops fec_pm_ops = {
drivers/net/ethernet/freescale/ucc_geth_ethtool.c +3 -5
@@ -252,14 +252,12 @@ uec_set_ringparam(struct net_device *netdev,return -EINVAL ; } +if (netif_running (netdev)) +return -EBUSY ; + ug_info->bdRingLenRx[queue] = ring->rx_pending; ug_info->bdRingLenTx[queue] = ring->tx_pending; -if (netif_running (netdev)) { -/* FIXME: restart automatically */ -netdev_info (netdev,"Please re-open the interface\n" ); - } -return ret; }
drivers/net/ethernet/mellanox/mlxsw/core.c +3 -3
@@ -568,7 +568,7 @@ static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core)if (!(mlxsw_core->bus->features &MLXSW_BUS_F_TXRX ))return 0 ; - emad_wq =alloc_workqueue ("mlxsw_core_emad" ,WQ_MEM_RECLAIM ,0 ); + emad_wq =alloc_workqueue ("mlxsw_core_emad" ,0 ,0 );if (!emad_wq)return -ENOMEM ; mlxsw_core->emad_wq = emad_wq;
@@ -1875,10 +1875,10 @@ static int __init mlxsw_core_module_init(void) {int err; - mlxsw_wq =alloc_workqueue (mlxsw_core_driver_name,WQ_MEM_RECLAIM ,0 ); + mlxsw_wq =alloc_workqueue (mlxsw_core_driver_name,0 ,0 );if (!mlxsw_wq)return -ENOMEM ; - mlxsw_owq =alloc_ordered_workqueue ("%s_ordered" ,WQ_MEM_RECLAIM , + mlxsw_owq =alloc_ordered_workqueue ("%s_ordered" ,0 , mlxsw_core_driver_name);if (!mlxsw_owq) { err = -ENOMEM ;
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +1 -1
@@ -1585,7 +1585,7 @@ static int mlxsw_sp_port_mdb_add(struct mlxsw_sp_port *mlxsw_sp_port,u16 fid_index;int err =0 ; -if (switchdev_trans_ph_prepare (trans)) +if (switchdev_trans_ph_commit (trans))return 0 ; bridge_port =mlxsw_sp_bridge_port_find (mlxsw_sp->bridge, orig_dev);
drivers/net/ethernet/mscc/ocelot.c +1 -1
@@ -605,7 +605,7 @@ static int ocelot_mact_mc_add(struct ocelot_port *port, struct netdev_hw_addr *hw_addr) {struct ocelot *ocelot = port->ocelot; -struct netdev_hw_addr *ha =kzalloc (sizeof (*ha),GFP_KERNEL ); +struct netdev_hw_addr *ha =kzalloc (sizeof (*ha),GFP_ATOMIC );if (!ha)return -ENOMEM ;
drivers/net/ethernet/neterion/vxge/vxge-config.c +1 -0
@@ -2365,6 +2365,7 @@ static void *__vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size, dma_object->addr))) {vxge_os_dma_free (devh->pdev, memblock, &dma_object->acc_handle); + memblock =NULL ; goto exit; }
drivers/net/ethernet/qlogic/qede/qede_ptp.c +3 -4
@@ -490,18 +490,17 @@ int qede_ptp_enable(struct qede_dev *edev, bool init_tc) ptp->clock =ptp_clock_register (&ptp->clock_info, &edev->pdev->dev);if (IS_ERR (ptp->clock)) { - rc = -EINVAL ;DP_ERR (edev,"PTP clock registration failed\n" ); +qede_ptp_disable (edev); + rc = -EINVAL ; goto err2; }return 0 ; -err2: -qede_ptp_disable (edev); - ptp->clock =NULL ; err1:kfree (ptp); +err2: edev->ptp =NULL ;return rc;
drivers/net/ethernet/seeq/sgiseeq.c +1 -0
@@ -735,6 +735,7 @@ static int sgiseeq_probe(struct platform_device *pdev) }platform_set_drvdata (pdev, dev); +SET_NETDEV_DEV (dev, &pdev->dev); sp =netdev_priv (dev);/* Make private data page aligned */
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +2 -0
@@ -1015,6 +1015,8 @@ static struct mac_device_info *sun8i_dwmac_setup(void *ppriv) mac->mac = &sun8i_dwmac_ops; mac->dma = &sun8i_dwmac_dma_ops; + priv->dev->priv_flags |=IFF_UNICAST_FLT ; +/* The loopback bit seems to be re-set when link change * Simply mask it each time * Speed 10/100/1000 are set in BIT(2)/BIT(3)
drivers/net/phy/spi_ks8995.c +9 -0
@@ -162,6 +162,14 @@ static const struct spi_device_id ks8995_id[] = { };MODULE_DEVICE_TABLE (spi, ks8995_id); +static const struct of_device_id ks8895_spi_of_match[] = { + { .compatible ="micrel,ks8995" }, + { .compatible ="micrel,ksz8864" }, + { .compatible ="micrel,ksz8795" }, + { }, + }; +MODULE_DEVICE_TABLE (of, ks8895_spi_of_match); +static inline u8 get_chip_id (u8 val) {return (val >>ID1_CHIPID_S ) &ID1_CHIPID_M ;
@@ -529,6 +537,7 @@ static int ks8995_remove(struct spi_device *spi)static struct spi_driver ks8995_driver = { .driver = { .name ="spi-ks8995" , + .of_match_table =of_match_ptr (ks8895_spi_of_match), }, .probe = ks8995_probe, .remove = ks8995_remove,
drivers/net/tun.c +12 -2
@@ -599,13 +599,18 @@ static u16 tun_automq_select_queue(struct tun_struct *tun, struct sk_buff *skb)static u16 tun_ebpf_select_queue (struct tun_struct *tun,struct sk_buff *skb) {struct tun_prog *prog; +u32 numqueues;u16 ret =0 ; + numqueues =READ_ONCE (tun->numqueues); +if (!numqueues) +return 0 ; + prog =rcu_dereference (tun->steering_prog);if (prog) ret =bpf_prog_run_clear_cb (prog->prog, skb); -return ret % tun->numqueues; +return ret % numqueues; } static u16 tun_select_queue(struct net_device *dev, struct sk_buff *skb,
@@ -703,6 +708,8 @@ static void __tun_detach(struct tun_file *tfile, bool clean) tun->tfiles[tun->numqueues - 1]); ntfile =rtnl_dereference (tun->tfiles[index]); ntfile->queue_index = index; +rcu_assign_pointer (tun->tfiles[tun->numqueues -1 ], +NULL ); --tun->numqueues;if (clean) {
@@ -1085,7 +1092,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) tfile =rcu_dereference (tun->tfiles[txq]);/* Drop packet if interface is not attached */ -if (txq >= tun->numqueues) +if (!tfile) goto drop;if (!rcu_dereference (tun->steering_prog))
@@ -1276,6 +1283,7 @@ static int tun_xdp_xmit(struct net_device *dev, int n,rcu_read_lock (); +resample: numqueues =READ_ONCE (tun->numqueues);if (!numqueues) {rcu_read_unlock ();
@@ -1284,6 +1292,8 @@ static int tun_xdp_xmit(struct net_device *dev, int n, tfile =rcu_dereference (tun->tfiles[smp_processor_id () % numqueues]); +if (unlikely (!tfile)) + goto resample;spin_lock (&tfile->tx_ring.producer_lock);for (i =0 ; i < n; i++) {
drivers/net/wireless/marvell/mwl8k.c +9 -4
@@ -441,6 +441,9 @@ static const struct ieee80211_rate mwl8k_rates_50[] = {#define MWL8K_CMD_UPDATE_STADB 0x1123#define MWL8K_CMD_BASTREAM 0x1125 +#define MWL8K_LEGACY_5G_RATE_OFFSET \ + (ARRAY_SIZE(mwl8k_rates_24) - ARRAY_SIZE(mwl8k_rates_50)) +static const char *mwl8k_cmd_name (__le16 cmd,char *buf,int bufsize) {u16 command =le16_to_cpu (cmd);
@@ -1016,8 +1019,9 @@ mwl8k_rxd_ap_process(void *_rxd, struct ieee80211_rx_status *status,if (rxd->channel >14 ) { status->band =NL80211_BAND_5GHZ ; -if (!(status->encoding ==RX_ENC_HT )) - status->rate_idx -=5 ; +if (!(status->encoding ==RX_ENC_HT ) && + status->rate_idx >=MWL8K_LEGACY_5G_RATE_OFFSET ) + status->rate_idx -=MWL8K_LEGACY_5G_RATE_OFFSET ; }else { status->band =NL80211_BAND_2GHZ ; }
@@ -1124,8 +1128,9 @@ mwl8k_rxd_sta_process(void *_rxd, struct ieee80211_rx_status *status,if (rxd->channel >14 ) { status->band =NL80211_BAND_5GHZ ; -if (!(status->encoding ==RX_ENC_HT )) - status->rate_idx -=5 ; +if (!(status->encoding ==RX_ENC_HT ) && + status->rate_idx >=MWL8K_LEGACY_5G_RATE_OFFSET ) + status->rate_idx -=MWL8K_LEGACY_5G_RATE_OFFSET ; }else { status->band =NL80211_BAND_2GHZ ; }
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c +1 -0
@@ -1699,6 +1699,7 @@ static void _rtl8723e_read_adapter_info(struct ieee80211_hw *hw, rtlhal->oem_id =RT_CID_819X_LENOVO ;break ; } +break ;case 0x1025 : rtlhal->oem_id =RT_CID_819X_ACER ;break ;
drivers/net/wireless/st/cw1200/scan.c +4 -1
@@ -84,8 +84,11 @@ int cw1200_hw_scan(struct ieee80211_hw *hw, frame.skb =ieee80211_probereq_get (hw, priv->vif->addr,NULL ,0 , req->ie_len); -if (!frame.skb) +if (!frame.skb) { +mutex_unlock (&priv->conf_mutex); +up (&priv->scan.lock);return -ENOMEM ; + }if (req->ie_len)skb_put_data (frame.skb, req->ie, req->ie_len);
drivers/nfc/st95hf/core.c +7 -0
@@ -1074,6 +1074,12 @@ static const struct spi_device_id st95hf_id[] = { };MODULE_DEVICE_TABLE (spi, st95hf_id); +static const struct of_device_id st95hf_spi_of_match[] = { + { .compatible ="st,st95hf" }, + { }, +}; +MODULE_DEVICE_TABLE (of, st95hf_spi_of_match); +static int st95hf_probe (struct spi_device *nfc_spi_dev) {int ret;
@@ -1260,6 +1266,7 @@ static struct spi_driver st95hf_driver = { .driver = { .name = "st95hf", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(st95hf_spi_of_match), }, .id_table = st95hf_id, .probe = st95hf_probe,
drivers/nvdimm/btt_devs.c +13 -5
@@ -190,14 +190,15 @@ static struct device *__nd_btt_create(struct nd_region *nd_region,return NULL ; nd_btt->id =ida_simple_get (&nd_region->btt_ida,0 ,0 ,GFP_KERNEL ); -if (nd_btt->id <0 ) { -kfree (nd_btt); -return NULL ; - } +if (nd_btt->id <0 ) + goto out_nd_btt; nd_btt->lbasize = lbasize; -if (uuid) +if (uuid) { uuid =kmemdup (uuid,16 ,GFP_KERNEL ); +if (!uuid) + goto out_put_id; + } nd_btt->uuid = uuid; dev = &nd_btt->dev;dev_set_name (dev,"btt%d.%d" , nd_region->id, nd_btt->id);
@@ -212,6 +213,13 @@ static struct device *__nd_btt_create(struct nd_region *nd_region,return NULL ; }return dev; + +out_put_id: +ida_simple_remove (&nd_region->btt_ida, nd_btt->id); + +out_nd_btt: +kfree (nd_btt); +return NULL ; }struct device *nd_btt_create (struct nd_region *nd_region)
drivers/nvdimm/namespace_devs.c +4 -1
@@ -2251,9 +2251,12 @@ static struct device *create_namespace_blk(struct nd_region *nd_region,if (!nsblk->uuid) goto blk_err;memcpy (name, nd_label->name,NSLABEL_NAME_LEN ); -if (name[0 ]) +if (name[0 ]) { nsblk->alt_name =kmemdup (name,NSLABEL_NAME_LEN ,GFP_KERNEL ); +if (!nsblk->alt_name) + goto blk_err; + } res =nsblk_add_resource (nd_region, ndd, nsblk,__le64_to_cpu (nd_label->dpa));if (!res)
drivers/nvdimm/pmem.c +4 -4
@@ -113,13 +113,13 @@ static void write_pmem(void *pmem_addr, struct page *page,while (len) { mem =kmap_atomic (page); - chunk = min_t(unsigned int, len, PAGE_SIZE); + chunk = min_t(unsigned int, len, PAGE_SIZE - off);memcpy_flushcache (pmem_addr, mem + off, chunk);kunmap_atomic (mem); len -= chunk; off =0 ; page++; - pmem_addr +=PAGE_SIZE ; + pmem_addr += chunk; } }
@@ -132,7 +132,7 @@ static blk_status_t read_pmem(struct page *page, unsigned int off,while (len) { mem =kmap_atomic (page); - chunk = min_t(unsigned int, len, PAGE_SIZE); + chunk = min_t(unsigned int, len, PAGE_SIZE - off); rem =memcpy_mcsafe (mem + off, pmem_addr, chunk);kunmap_atomic (mem);if (rem)
@@ -140,7 +140,7 @@ static blk_status_t read_pmem(struct page *page, unsigned int off, len -= chunk; off =0 ; page++; - pmem_addr +=PAGE_SIZE ; + pmem_addr += chunk; }return BLK_STS_OK ; }
drivers/pci/controller/pci-hyperv.c +23 -0
@@ -1491,6 +1491,21 @@ static void hv_pci_assign_slots(struct hv_pcibus_device *hbus) } } +/* +* Remove entries in sysfs pci slot directory. +*/ +static void hv_pci_remove_slots (struct hv_pcibus_device *hbus) +{ +struct hv_pci_dev *hpdev; + +list_for_each_entry (hpdev, &hbus->children, list_entry) { +if (!hpdev->pci_slot) +continue ; +pci_destroy_slot (hpdev->pci_slot); + hpdev->pci_slot =NULL ; + } +} +/** * create_root_hv_pci_bus() - Expose a new root PCI bus * @hbus: Root PCI bus, as understood by this driver
@@ -1766,6 +1781,10 @@ static void pci_devices_present_work(struct work_struct *work) hpdev = list_first_entry(&removed, struct hv_pci_dev, list_entry);list_del (&hpdev->list_entry); + +if (hpdev->pci_slot) +pci_destroy_slot (hpdev->pci_slot); +put_pcichild (hpdev); }
@@ -1905,6 +1924,9 @@ static void hv_eject_device_work(struct work_struct *work)sizeof (*ejct_pkt), (unsigned long )&ctxt.pkt, VM_PKT_DATA_INBAND, 0); +/* For the get_pcichild() in hv_pci_eject_device() */ +put_pcichild (hpdev); +/* For the two refs got in new_pcichild_device() */ put_pcichild (hpdev);put_pcichild (hpdev);put_hvpcibus (hpdev->hbus);
@@ -2682,6 +2704,7 @@ static int hv_pci_remove(struct hv_device *hdev)pci_lock_rescan_remove ();pci_stop_root_bus (hbus->pci_bus);pci_remove_root_bus (hbus->pci_bus); +hv_pci_remove_slots (hbus);pci_unlock_rescan_remove (); hbus->state = hv_pcibus_removed; }
drivers/platform/x86/dell-laptop.c +3 -3
@@ -532,7 +532,7 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data)return ; } -dell_fill_request (&buffer,0 ,0x2 ,0 ,0 ); +dell_fill_request (&buffer,0x2 ,0 ,0 ,0 ); ret =dell_send_request (&buffer,CLASS_INFO ,SELECT_RFKILL ); hwswitch = buffer.output[1 ];
@@ -563,7 +563,7 @@ static int dell_debugfs_show(struct seq_file *s, void *data)return ret; status = buffer.output[1 ]; -dell_fill_request (&buffer,0 ,0x2 ,0 ,0 ); +dell_fill_request (&buffer,0x2 ,0 ,0 ,0 ); hwswitch_ret =dell_send_request (&buffer,CLASS_INFO ,SELECT_RFKILL );if (hwswitch_ret)return hwswitch_ret;
@@ -648,7 +648,7 @@ static void dell_update_rfkill(struct work_struct *ignored)if (ret !=0 )return ; -dell_fill_request (&buffer,0 ,0x2 ,0 ,0 ); +dell_fill_request (&buffer,0x2 ,0 ,0 ,0 ); ret =dell_send_request (&buffer,CLASS_INFO ,SELECT_RFKILL );if (ret ==0 && (status &BIT (0 )))
drivers/platform/x86/sony-laptop.c +5 -3
@@ -4424,14 +4424,16 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) }return AE_OK ; } + +case ACPI_RESOURCE_TYPE_END_TAG : +return AE_OK ; +default :dprintk ("Resource %d isn't an IRQ nor an IO port\n" , resource->type); +return AE_CTRL_TERMINATE ; -case ACPI_RESOURCE_TYPE_END_TAG : -return AE_OK ; } -return AE_CTRL_TERMINATE ; }static int sony_pic_possible_resources (struct acpi_device *device)
drivers/platform/x86/thinkpad_acpi.c +70 -2
90 lines not on this page · raw message
drivers/s390/block/dasd_eckd.c +3 -3
@@ -2004,14 +2004,14 @@ static int dasd_eckd_end_analysis(struct dasd_block *block) blk_per_trk =recs_per_track (&private->rdc_data,0 , block->bp_block); raw: - block->blocks = (private->real_cyl * + block->blocks = ((unsigned long ) private->real_cyl * private->rdc_data.trk_per_cyl * blk_per_trk); dev_info(&device->cdev->dev, - "DASD with %d KB/block, %d KB total size, %d KB/track, " + "DASD with %u KB/block, %lu KB total size, %u KB/track, " "%s\n", (block->bp_block >> 10), - ((private->real_cyl * + (((unsigned long) private->real_cyl * private->rdc_data.trk_per_cyl * blk_per_trk * (block->bp_block >> 9)) >> 1), ((blk_per_trk * block->bp_block) >> 10),
drivers/s390/char/con3270.c +1 -1
@@ -629,7 +629,7 @@ con3270_init(void) (void (*)(unsigned long )) con3270_read_tasklet, (unsigned long) condev->read); -raw3270_add_view (&condev->view, &con3270_fn,1 ); +raw3270_add_view (&condev->view, &con3270_fn,1 ,RAW3270_VIEW_LOCK_IRQ );INIT_LIST_HEAD (&condev->freemem);for (i =0 ; i <CON3270_STRING_PAGES ; i++) {
drivers/s390/char/fs3270.c +2 -1
@@ -463,7 +463,8 @@ fs3270_open(struct inode *inode, struct file *filp)init_waitqueue_head (&fp->wait); fp->fs_pid =get_pid (task_pid (current)); - rc =raw3270_add_view (&fp->view, &fs3270_fn, minor); + rc =raw3270_add_view (&fp->view, &fs3270_fn, minor, +RAW3270_VIEW_LOCK_BH );if (rc) {fs3270_free_view (&fp->view); goto out;
drivers/s390/char/raw3270.c +2 -1
@@ -920,7 +920,7 @@ raw3270_deactivate_view(struct raw3270_view *view)* Add view to device with minor "minor". */ int -raw3270_add_view (struct raw3270_view *view,struct raw3270_fn *fn,int minor) +raw3270_add_view (struct raw3270_view *view,struct raw3270_fn *fn,int minor,int subclass) {unsigned long flags;struct raw3270 *rp;
@@ -942,6 +942,7 @@ raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn, int minor) view->cols = rp->cols; view->ascebc = rp->ascebc;spin_lock_init (&view->lock); +lockdep_set_subclass (&view->lock, subclass);list_add (&view->list, &rp->view_list); rc =0 ;spin_unlock_irqrestore (get_ccwdev_lock (rp->cdev), flags);
drivers/s390/char/raw3270.h +3 -1
@@ -150,6 +150,8 @@ struct raw3270_fn {struct raw3270_view {struct list_head list;spinlock_t lock; +#define RAW3270_VIEW_LOCK_IRQ 0 +#define RAW3270_VIEW_LOCK_BH 1atomic_t ref_count;struct raw3270 *dev;struct raw3270_fn *fn;
@@ -158,7 +160,7 @@ struct raw3270_view {unsigned char *ascebc;/* ascii -> ebcdic table */ }; -int raw3270_add_view (struct raw3270_view *,struct raw3270_fn *,int ); +int raw3270_add_view (struct raw3270_view *,struct raw3270_fn *,int ,int );int raw3270_activate_view (struct raw3270_view *);void raw3270_del_view (struct raw3270_view *);void raw3270_deactivate_view (struct raw3270_view *);
drivers/s390/char/tty3270.c +2 -1
@@ -980,7 +980,8 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty)return PTR_ERR (tp); rc =raw3270_add_view (&tp->view, &tty3270_fn, - tty->index +RAW3270_FIRSTMINOR ); + tty->index +RAW3270_FIRSTMINOR , +RAW3270_VIEW_LOCK_BH );if (rc) {tty3270_free_view (tp);return rc;
drivers/s390/crypto/pkey_api.c +2 -1
@@ -45,7 +45,8 @@ static debug_info_t *debug_info;static void __init pkey_debug_init (void ) { - debug_info =debug_register ("pkey" ,1 ,1 ,4 *sizeof (long )); +/* 5 arguments per dbf entry (including the format string ptr) */ + debug_info =debug_register ("pkey" ,1 ,1 ,5 *sizeof (long ));debug_register_view (debug_info, &debug_sprintf_view);debug_set_level (debug_info,3 ); }
drivers/s390/net/ctcm_main.c +1 -0
@@ -1595,6 +1595,7 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev)if (priv->channel[direction] ==NULL ) {if (direction ==CTCM_WRITE )channel_free (priv->channel[CTCM_READ ]); + result = -ENODEV ; goto out_dev; } priv->channel[direction]->netdev = dev;
drivers/scsi/aic7xxx/aic7770_osm.c +1 -0
@@ -91,6 +91,7 @@ aic7770_probe(struct device *dev) ahc =ahc_alloc (&aic7xxx_driver_template, name);if (ahc ==NULL )return (ENOMEM ); + ahc->dev = dev; error =aic7770_config (ahc, aic7770_ident_table + edev->id.driver_data, eisaBase);if (error !=0 ) {
drivers/scsi/aic7xxx/aic7xxx.h +1 -0
@@ -949,6 +949,7 @@ struct ahc_softc {* Platform specific device information. */ ahc_dev_softc_t dev_softc; +struct device *dev;/* * Bus specific device information.
drivers/scsi/aic7xxx/aic7xxx_osm.c +4 -6
@@ -861,8 +861,8 @@ int ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr, int flags, bus_dmamap_t *mapp) { - *vaddr =pci_alloc_consistent (ahc->dev_softc, - dmat->maxsize, mapp); +/* XXX: check if we really need the GFP_ATOMIC and unwind this mess! */ + *vaddr =dma_alloc_coherent (ahc->dev, dmat->maxsize, mapp,GFP_ATOMIC );if (*vaddr ==NULL )return ENOMEM ;return 0 ;
@@ -872,8 +872,7 @@ void ahc_dmamem_free(struct ahc_softc *ahc, bus_dma_tag_t dmat, void* vaddr, bus_dmamap_t map) { - pci_free_consistent(ahc->dev_softc, dmat->maxsize, - vaddr, map); + dma_free_coherent(ahc->dev, dmat->maxsize, vaddr, map); }int
@@ -1124,8 +1123,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa host->transportt = ahc_linux_transport_template; - retval =scsi_add_host (host, - (ahc->dev_softc ? &ahc->dev_softc->dev :NULL )); + retval =scsi_add_host (host, ahc->dev);if (retval) {printk (KERN_WARNING "aic7xxx: scsi_add_host failed\n" );scsi_host_put (host);
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +1 -0
@@ -250,6 +250,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } } ahc->dev_softc = pci; + ahc->dev = &pci->dev; error =ahc_pci_config (ahc, entry);if (error !=0 ) {ahc_free (ahc);
drivers/usb/serial/generic.c +32 -7
@@ -376,6 +376,7 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)struct usb_serial_port *port = urb->context;unsigned char *data = urb->transfer_buffer;unsigned long flags; +bool stopped = false;int status = urb->status;int i;
@@ -383,33 +384,51 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)if (urb == port->read_urbs[i])break ; } -set_bit (i, &port->read_urbs_free);dev_dbg (&port->dev,"%s - urb %d, len %d\n" , __func__, i, urb->actual_length);switch (status) {case 0 : +usb_serial_debug_data (&port->dev, __func__, urb->actual_length, + data); + port->serial->type->process_read_urb (urb);break ;case -ENOENT :case -ECONNRESET :case -ESHUTDOWN :dev_dbg (&port->dev,"%s - urb stopped: %d\n" , __func__, status); -return ; + stopped = true; +break ;case -EPIPE :dev_err (&port->dev,"%s - urb stopped: %d\n" , __func__, status); -return ; + stopped = true; +break ;default :dev_dbg (&port->dev,"%s - nonzero urb status: %d\n" , __func__, status); - goto resubmit; +break ; } -usb_serial_debug_data (&port->dev, __func__, urb->actual_length, data); - port->serial->type->process_read_urb (urb); +/* +* Make sure URB processing is done before marking as free to avoid +* racing with unthrottle() on another CPU. Matches the barriers +* implied by the test_and_clear_bit() in +* usb_serial_generic_submit_read_urb(). +*/ +smp_mb__before_atomic (); +set_bit (i, &port->read_urbs_free); +/* +* Make sure URB is marked as free before checking the throttled flag +* to avoid racing with unthrottle() on another CPU. Matches the +* smp_mb() in unthrottle(). +*/ +smp_mb__after_atomic (); + +if (stopped) +return ; -resubmit:/* Throttle the device if requested by tty */ spin_lock_irqsave (&port->lock, flags); port->throttled = port->throttle_req;
@@ -484,6 +503,12 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty) port->throttled = port->throttle_req =0 ;spin_unlock_irq (&port->lock); +/* +* Matches the smp_mb__after_atomic() in +* usb_serial_generic_read_bulk_callback(). +*/ +smp_mb (); +if (was_throttled)usb_serial_generic_submit_read_urbs (port,GFP_KERNEL ); }
drivers/usb/typec/typec_wcove.c +7 -2
@@ -615,8 +615,13 @@ static int wcove_typec_probe(struct platform_device *pdev) wcove->dev = &pdev->dev; wcove->regmap = pmic->regmap; - irq =regmap_irq_get_virq (pmic->irq_chip_data_chgr, -platform_get_irq (pdev,0 )); + irq =platform_get_irq (pdev,0 ); +if (irq <0 ) { +dev_err (&pdev->dev,"Failed to get IRQ: %d\n" , irq); +return irq; + } + + irq =regmap_irq_get_virq (pmic->irq_chip_data_chgr, irq);if (irq <0 )return irq;
drivers/virt/fsl_hypervisor.c +16 -13
@@ -215,6 +215,9 @@ static long ioctl_memcpy(struct fsl_hv_ioctl_memcpy __user *p)* hypervisor. */ lb_offset = param.local_vaddr & (PAGE_SIZE -1 ); +if (param.count ==0 || + param.count >U64_MAX - lb_offset -PAGE_SIZE +1 ) +return -EINVAL ; num_pages = (param.count + lb_offset +PAGE_SIZE -1 ) >>PAGE_SHIFT ;/* Allocate the buffers we need */
@@ -331,8 +334,8 @@ static long ioctl_dtprop(struct fsl_hv_ioctl_prop __user *p, int set)struct fsl_hv_ioctl_prop param;char __user *upath, *upropname;void __user *upropval; -char *path =NULL , *propname =NULL ; -void *propval =NULL ; +char *path, *propname; +void *propval;int ret =0 ;/* Get the parameters from the user. */
@@ -344,32 +347,30 @@ static long ioctl_dtprop(struct fsl_hv_ioctl_prop __user *p, int set) upropval = (void __user *)(uintptr_t )param.propval; path =strndup_user (upath,FH_DTPROP_MAX_PATHLEN ); -if (IS_ERR (path)) { - ret =PTR_ERR (path); - goto out; - } +if (IS_ERR (path)) +return PTR_ERR (path); propname =strndup_user (upropname,FH_DTPROP_MAX_PATHLEN );if (IS_ERR (propname)) { ret =PTR_ERR (propname); - goto out; + goto err_free_path; }if (param.proplen >FH_DTPROP_MAX_PROPLEN ) { ret = -EINVAL ; - goto out; + goto err_free_propname; } propval =kmalloc (param.proplen,GFP_KERNEL );if (!propval) { ret = -ENOMEM ; - goto out; + goto err_free_propname; }if (set) {if (copy_from_user (propval, upropval, param.proplen)) { ret = -EFAULT ; - goto out; + goto err_free_propval; } param.ret = fh_partition_set_dtprop(param.handle,
@@ -388,7 +389,7 @@ static long ioctl_dtprop(struct fsl_hv_ioctl_prop __user *p, int set)if (copy_to_user (upropval, propval, param.proplen) ||put_user (param.proplen, &p->proplen)) { ret = -EFAULT ; - goto out; + goto err_free_propval; } } }
@@ -396,10 +397,12 @@ static long ioctl_dtprop(struct fsl_hv_ioctl_prop __user *p, int set)if (put_user (param.ret, &p->ret)) ret = -EFAULT ; -out: -kfree (path); +err_free_propval:kfree (propval); +err_free_propname:kfree (propname); +err_free_path: +kfree (path);return ret; }
drivers/virt/vboxguest/vboxguest_core.c +31 -0
@@ -1263,6 +1263,20 @@ static int vbg_ioctl_hgcm_disconnect(struct vbg_dev *gdev,return ret; } +static bool vbg_param_valid (enum vmmdev_hgcm_function_parameter_type type) +{ +switch (type) { +case VMMDEV_HGCM_PARM_TYPE_32BIT : +case VMMDEV_HGCM_PARM_TYPE_64BIT : +case VMMDEV_HGCM_PARM_TYPE_LINADDR : +case VMMDEV_HGCM_PARM_TYPE_LINADDR_IN : +case VMMDEV_HGCM_PARM_TYPE_LINADDR_OUT : +return true; +default : +return false; + } +} +static int vbg_ioctl_hgcm_call (struct vbg_dev *gdev,struct vbg_session *session,bool f32bit,struct vbg_ioctl_hgcm_call *call)
@@ -1298,6 +1312,23 @@ static int vbg_ioctl_hgcm_call(struct vbg_dev *gdev, } call->hdr.size_out = actual_size; +/* Validate parameter types */ +if (f32bit) { +struct vmmdev_hgcm_function_parameter32 *parm = +VBG_IOCTL_HGCM_CALL_PARMS32 (call); + +for (i =0 ; i < call->parm_count; i++) +if (!vbg_param_valid (parm[i].type)) +return -EINVAL ; + }else { +struct vmmdev_hgcm_function_parameter *parm = +VBG_IOCTL_HGCM_CALL_PARMS (call); + +for (i =0 ; i < call->parm_count; i++) +if (!vbg_param_valid (parm[i].type)) +return -EINVAL ; + } +/* * Validate the client id. */
fs/afs/write.c +1 -0
@@ -253,6 +253,7 @@ static void afs_kill_pages(struct address_space *mapping, first = page->index +1 ;lock_page (page);generic_error_remove_page (mapping, page); +unlock_page (page); }__pagevec_release (&pv);
fs/kernfs/dir.c +2 -3
@@ -650,11 +650,10 @@ static struct kernfs_node *__kernfs_new_node(struct kernfs_root *root, kn->id.generation = gen;/* -* set ino first. This barrier is paired with atomic_inc_not_zero in +* set ino first. This RELEASE is paired with atomic_inc_not_zero in * kernfs_find_and_get_node_by_ino */ -smp_mb__before_atomic (); -atomic_set (&kn->count,1 ); +atomic_set_release (&kn->count,1 );atomic_set (&kn->active,KN_DEACTIVATED_BIAS );RB_CLEAR_NODE (&kn->rb);
include/linux/efi.h +6 -1
@@ -1564,7 +1564,12 @@ efi_status_t efi_setup_gop(efi_system_table_t *sys_table_arg, struct screen_info *si, efi_guid_t *proto, unsigned long size); -bool efi_runtime_disabled (void ); +#ifdef CONFIG_EFI +extern bool efi_runtime_disabled (void ); +#else +static inline bool efi_runtime_disabled (void ) {return true; } +#endif +extern void efi_call_virt_check_flags (unsigned long flags,const char *call);enum efi_secureboot_mode {
include/linux/elevator.h +1 -0
@@ -99,6 +99,7 @@ struct elevator_mq_ops {void (*exit_sched)(struct elevator_queue *);int (*init_hctx)(struct blk_mq_hw_ctx *,unsigned int );void (*exit_hctx)(struct blk_mq_hw_ctx *,unsigned int ); +void (*depth_updated)(struct blk_mq_hw_ctx *);bool (*allow_merge)(struct request_queue *,struct request *,struct bio *);bool (*bio_merge)(struct blk_mq_hw_ctx *,struct bio *);
include/linux/kvm_host.h +6 -4
@@ -28,6 +28,7 @@#include <linux/irqbypass.h> #include <linux/swait.h> #include <linux/refcount.h> +#include <linux/nospec.h> #include <asm/signal.h> #include <linux/kvm.h>
@@ -491,10 +492,10 @@ static inline struct kvm_io_bus *kvm_get_bus(struct kvm *kvm, enum kvm_bus idx)static inline struct kvm_vcpu *kvm_get_vcpu (struct kvm *kvm,int i) { -/* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu, in case -* the caller has read kvm->online_vcpus before (as is the case -* for kvm_for_each_vcpu, for example). -*/ +int num_vcpus =atomic_read (&kvm->online_vcpus); + i =array_index_nospec (i, num_vcpus); + +/* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu. */ smp_rmb ();return kvm->vcpus[i]; }
@@ -578,6 +579,7 @@ void kvm_put_kvm(struct kvm *kvm);static inline struct kvm_memslots *__kvm_memslots (struct kvm *kvm,int as_id) { + as_id =array_index_nospec (as_id,KVM_ADDRESS_SPACE_NUM );return srcu_dereference_check (kvm->memslots[as_id], &kvm->srcu,lockdep_is_held (&kvm->slots_lock) || !refcount_read (&kvm->users_count));
include/net/netfilter/nf_conntrack.h +2 -0
@@ -313,6 +313,8 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net, gfp_t flags);void nf_ct_tmpl_free (struct nf_conn *tmpl); +u32 nf_ct_get_id (const struct nf_conn *ct); +static inline void nf_ct_set (struct sk_buff *skb,struct nf_conn *ct,enum ip_conntrack_info info) {
include/net/nfc/nci_core.h +1 -1
@@ -166,7 +166,7 @@ struct nci_conn_info {* According to specification 102 622 chapter 4.4 Pipes, * the pipe identifier is 7 bits long. */ -#define NCI_HCI_MAX_PIPES 127 +#define NCI_HCI_MAX_PIPES 128struct nci_hci_gate {u8 gate;
init/main.c +2 -2
@@ -568,6 +568,8 @@ asmlinkage __visible void __init start_kernel(void)page_alloc_init ();pr_notice ("Kernel command line: %s\n" , boot_command_line); +/* parameters may set static keys */ +jump_label_init ();parse_early_param (); after_dashes = parse_args("Booting kernel", static_command_line, __start___param,
@@ -577,8 +579,6 @@ asmlinkage __visible void __init start_kernel(void)parse_args ("Setting init args" , after_dashes,NULL ,0 ,-1 ,-1 ,NULL , set_init_arg); -jump_label_init (); -/* * These use large bootmem allocations and must precede * kmem_cache_init()
mm/memory.c +6 -5
@@ -1796,10 +1796,12 @@ static int insert_pfn(struct vm_area_struct *vma, unsigned long addr,WARN_ON_ONCE (!is_zero_pfn (pte_pfn (*pte))); goto out_unlock; } - entry = *pte; - goto out_mkwrite; - }else - goto out_unlock; + entry =pte_mkyoung (*pte); + entry =maybe_mkwrite (pte_mkdirty (entry), vma); +if (ptep_set_access_flags (vma, addr, pte, entry,1 )) +update_mmu_cache (vma, addr, pte); + } + goto out_unlock; }/* Ok, finally just insert the thing.. */
@@ -1808,7 +1810,6 @@ static int insert_pfn(struct vm_area_struct *vma, unsigned long addr,else entry =pte_mkspecial (pfn_t_pte (pfn, prot)); -out_mkwrite:if (mkwrite) { entry =pte_mkyoung (entry); entry =maybe_mkwrite (pte_mkdirty (entry), vma);
mm/memory_hotplug.c +1 -0
@@ -901,6 +901,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ*/ mem =find_memory_block (__pfn_to_section (pfn)); nid = mem->nid; +put_device (&mem->dev);/* associate pfn range with the zone */ zone =move_pfn_range (online_type, nid, pfn, nr_pages);
mm/vmscan.c +9 -20
@@ -2190,7 +2190,6 @@ static void shrink_active_list(unsigned long nr_to_scan,* 10TB 320 32GB */ static bool inactive_list_is_low (struct lruvec *lruvec,bool file, -struct mem_cgroup *memcg,struct scan_control *sc,bool actual_reclaim) {enum lru_list active_lru = file *LRU_FILE +LRU_ACTIVE ;
@@ -2211,16 +2210,12 @@ static bool inactive_list_is_low(struct lruvec *lruvec, bool file, inactive =lruvec_lru_size (lruvec, inactive_lru, sc->reclaim_idx); active =lruvec_lru_size (lruvec, active_lru, sc->reclaim_idx); -if (memcg) - refaults =memcg_page_state (memcg,WORKINGSET_ACTIVATE ); -else - refaults =node_page_state (pgdat,WORKINGSET_ACTIVATE ); -/* * When refaults are being observed, it means a new workingset * is being established. Disable active list protection to get * rid of the stale workingset quickly. */ + refaults =lruvec_page_state (lruvec,WORKINGSET_ACTIVATE );if (file && actual_reclaim && lruvec->refaults != refaults) { inactive_ratio =0 ; }else {
@@ -2241,12 +2236,10 @@ static bool inactive_list_is_low(struct lruvec *lruvec, bool file, }static unsigned long shrink_list (enum lru_list lru,unsigned long nr_to_scan, -struct lruvec *lruvec,struct mem_cgroup *memcg, -struct scan_control *sc) +struct lruvec *lruvec,struct scan_control *sc) {if (is_active_lru (lru)) { -if (inactive_list_is_low (lruvec,is_file_lru (lru), - memcg, sc, true)) +if (inactive_list_is_low (lruvec,is_file_lru (lru), sc, true))shrink_active_list (nr_to_scan, lruvec, sc, lru);return 0 ; }
@@ -2346,7 +2339,7 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,* anonymous pages on the LRU in eligible zones. * Otherwise, the small LRU gets thrashed. */ -if (!inactive_list_is_low (lruvec, false, memcg, sc, false) && +if (!inactive_list_is_low (lruvec, false, sc, false) &&lruvec_lru_size (lruvec,LRU_INACTIVE_ANON , sc->reclaim_idx) >> sc->priority) { scan_balance =SCAN_ANON ;
@@ -2364,7 +2357,7 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,* lruvec even if it has plenty of old anonymous pages unless the * system is under heavy pressure. */ -if (!inactive_list_is_low (lruvec, true, memcg, sc, false) && +if (!inactive_list_is_low (lruvec, true, sc, false) &&lruvec_lru_size (lruvec,LRU_INACTIVE_FILE , sc->reclaim_idx) >> sc->priority) { scan_balance =SCAN_FILE ; goto out;
@@ -2517,7 +2510,7 @@ static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memc nr[lru] -= nr_to_scan; nr_reclaimed +=shrink_list (lru, nr_to_scan, - lruvec, memcg, sc); + lruvec, sc); } }
@@ -2584,7 +2577,7 @@ static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memc* Even if we did not try to evict anon pages at all, we want to * rebalance the anon lru active/inactive ratio. */ -if (inactive_list_is_low (lruvec, false, memcg, sc, true)) +if (inactive_list_is_low (lruvec, false, sc, true))shrink_active_list (SWAP_CLUSTER_MAX , lruvec, sc,LRU_ACTIVE_ANON ); }
@@ -2982,12 +2975,8 @@ static void snapshot_refaults(struct mem_cgroup *root_memcg, pg_data_t *pgdat)unsigned long refaults;struct lruvec *lruvec; -if (memcg) - refaults =memcg_page_state (memcg,WORKINGSET_ACTIVATE ); -else - refaults =node_page_state (pgdat,WORKINGSET_ACTIVATE ); - lruvec =mem_cgroup_lruvec (pgdat, memcg); + refaults =lruvec_page_state (lruvec,WORKINGSET_ACTIVATE ); lruvec->refaults = refaults; }while ((memcg =mem_cgroup_iter (root_memcg, memcg,NULL ))); }
@@ -3344,7 +3333,7 @@ static void age_active_anon(struct pglist_data *pgdat, do { struct lruvec *lruvec = mem_cgroup_lruvec(pgdat, memcg); - if (inactive_list_is_low(lruvec, false, memcg, sc, true)) + if (inactive_list_is_low(lruvec, false, sc, true)) shrink_active_list(SWAP_CLUSTER_MAX, lruvec, sc, LRU_ACTIVE_ANON);
net/8021q/vlan_dev.c +3 -1
@@ -368,10 +368,12 @@ static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ifrr.ifr_ifru = ifr->ifr_ifru;switch (cmd) { +case SIOCSHWTSTAMP : +if (!net_eq (dev_net (dev), &init_net)) +break ;case SIOCGMIIPHY :case SIOCGMIIREG :case SIOCSMIIREG : -case SIOCSHWTSTAMP :case SIOCGHWTSTAMP :if (netif_device_present (real_dev) && ops->ndo_do_ioctl) err = ops->ndo_do_ioctl (real_dev, &ifrr, cmd);
net/bridge/br_if.c +6 -7
@@ -603,13 +603,15 @@ int br_add_if(struct net_bridge *br, struct net_device *dev,call_netdevice_notifiers (NETDEV_JOIN , dev); err =dev_set_allmulti (dev,1 ); -if (err) - goto put_back; +if (err) { +kfree (p);/* kobject not yet init'd, manually free */ + goto err1; + } err =kobject_init_and_add (&p->kobj, &brport_ktype, &(dev->dev.kobj),SYSFS_BRIDGE_PORT_ATTR );if (err) - goto err1; + goto err2; err =br_sysfs_addif (p);if (err)
@@ -692,12 +694,9 @@ int br_add_if(struct net_bridge *br, struct net_device *dev,sysfs_remove_link (br->ifobj, p->dev->name); err2:kobject_put (&p->kobj); - p =NULL ;/* kobject_put frees */ -err1:dev_set_allmulti (dev,-1 ); -put_back: +err1:dev_put (dev); -kfree (p);return err; }
net/core/fib_rules.c +3 -3
@@ -756,9 +756,9 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh,if (err) goto errout; -if ((nlh->nlmsg_flags &NLM_F_EXCL ) && -rule_exists (ops, frh, tb, rule)) { - err = -EEXIST ; +if (rule_exists (ops, frh, tb, rule)) { +if (nlh->nlmsg_flags &NLM_F_EXCL ) + err = -EEXIST ; goto errout_free; }
net/dsa/dsa.c +9 -2
@@ -293,15 +293,22 @@ static int __init dsa_init_module(void) rc =dsa_slave_register_notifier ();if (rc) -return rc; + goto register_notifier_fail; rc =dsa_legacy_register ();if (rc) -return rc; + goto legacy_register_fail;dev_add_pack (&dsa_pack_type);return 0 ; + +legacy_register_fail: +dsa_slave_unregister_notifier (); +register_notifier_fail: +destroy_workqueue (dsa_owq); + +return rc; }module_init (dsa_init_module);
net/ipv4/raw.c +2 -2
@@ -174,6 +174,7 @@ static int icmp_filter(const struct sock *sk, const struct sk_buff *skb)static int raw_v4_input (struct sk_buff *skb,const struct iphdr *iph,int hash) {int sdif =inet_sdif (skb); +int dif =inet_iif (skb);struct sock *sk;struct hlist_head *head;int delivered =0 ;
@@ -186,8 +187,7 @@ static int raw_v4_input(struct sk_buff *skb, const struct iphdr *iph, int hash) net =dev_net (skb->dev); sk =__raw_v4_lookup (net,__sk_head (head), iph->protocol, - iph->saddr, iph->daddr, - skb->dev->ifindex, sdif); + iph->saddr, iph->daddr, dif, sdif);while (sk) { delivered =1 ;
net/ipv6/sit.c +1 -1
@@ -1084,7 +1084,7 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev)if (!tdev && tunnel->parms.link) tdev =__dev_get_by_index (tunnel->net, tunnel->parms.link); -if (tdev) { +if (tdev && !netif_is_l3_master (tdev)) {int t_hlen = tunnel->hlen +sizeof (struct iphdr ); dev->hard_header_len = tdev->hard_header_len +sizeof (struct iphdr );
net/mac80211/mesh_pathtbl.c +1 -1
@@ -23,7 +23,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl, struct mesh_path *mpath);static u32 mesh_table_hash (const void *addr,u32 len,u32 seed) {/* Use last four bytes of hw addr as hash index */ -return jhash_1word (*(u32 *)(addr+2 ), seed); +return jhash_1word (__get_unaligned_cpu32 ((u8 *)addr +2 ), seed); }static const struct rhashtable_params mesh_rht_params = {
net/mac80211/trace_msg.h +6 -1
@@ -1,4 +1,9 @@/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Portions of this file +* Copyright (C) 2019 Intel Corporation +*/ +#ifdef CONFIG_MAC80211_MESSAGE_TRACING #if !defined(__MAC80211_MSG_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ )
@@ -11,7 +16,7 @@#undef TRACE_SYSTEM#define TRACE_SYSTEM mac80211_msg -#define MAX_MSG_LEN 100 +#define MAX_MSG_LEN 120 DECLARE_EVENT_CLASS(mac80211_msg_event, TP_PROTO(struct va_format *vaf),
net/mac80211/tx.c +3 -0
@@ -3185,6 +3185,7 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata,u8 max_subframes = sta->sta.max_amsdu_subframes;int max_frags = local->hw.max_tx_fragments;int max_amsdu_len = sta->sta.max_amsdu_len; +int orig_truesize;__be16 len;void *data;bool ret = false;
@@ -3218,6 +3219,7 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata,if (!head) goto out; + orig_truesize = head->truesize; orig_len = head->len;if (skb->len + head->len > max_amsdu_len)
@@ -3272,6 +3274,7 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata, *frag_tail = skb; out_recalc: + fq->memory_usage += head->truesize - orig_truesize;if (head->len != orig_len) { flow->backlog += head->len - orig_len; tin->backlog_bytes += head->len - orig_len;
net/netfilter/ipvs/ip_vs_core.c +1 -1
@@ -1647,7 +1647,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,if (!cp) {int v; -if (!sysctl_schedule_icmp (ipvs)) +if (ipip || !sysctl_schedule_icmp (ipvs))return NF_ACCEPT ;if (!ip_vs_try_to_schedule (ipvs,AF_INET , skb, pd, &v, &cp, &ciph))
net/netfilter/nf_conntrack_core.c +35 -0
@@ -25,6 +25,7 @@#include <linux/slab.h> #include <linux/random.h> #include <linux/jhash.h> +#include <linux/siphash.h> #include <linux/err.h> #include <linux/percpu.h> #include <linux/moduleparam.h>
@@ -424,6 +425,40 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, }EXPORT_SYMBOL_GPL (nf_ct_invert_tuple); +/* Generate a almost-unique pseudo-id for a given conntrack. +* +* intentionally doesn't re-use any of the seeds used for hash +* table location, we assume id gets exposed to userspace. +* +* Following nf_conn items do not change throughout lifetime +* of the nf_conn after it has been committed to main hash table: +* +* 1. nf_conn address +* 2. nf_conn->ext address +* 3. nf_conn->master address (normally NULL) +* 4. tuple +* 5. the associated net namespace +*/ +u32 nf_ct_get_id (const struct nf_conn *ct) +{ +static __read_mostly siphash_key_t ct_id_seed; +unsigned long a, b, c, d; + +net_get_random_once (&ct_id_seed,sizeof (ct_id_seed)); + + a = (unsigned long )ct; + b = (unsigned long )ct->master ^net_hash_mix (nf_ct_net (ct)); + c = (unsigned long )ct->ext; + d = (unsigned long )siphash (&ct->tuplehash,sizeof (ct->tuplehash), + &ct_id_seed); +#ifdef CONFIG_64BIT +return siphash_4u64 ((u64 )a, (u64 )b, (u64 )c, (u64 )d, &ct_id_seed); +#else +return siphash_4u32 ((u32 )a, (u32 )b, (u32 )c, (u32 )d, &ct_id_seed); +#endif +} +EXPORT_SYMBOL_GPL (nf_ct_get_id); +static void clean_from_lists (struct nf_conn *ct) {
net/netfilter/nf_conntrack_netlink.c +29 -5
@@ -29,6 +29,7 @@#include <linux/spinlock.h> #include <linux/interrupt.h> #include <linux/slab.h> +#include <linux/siphash.h> #include <linux/netfilter.h> #include <net/netlink.h>
@@ -487,7 +488,9 @@ static int ctnetlink_dump_ct_synproxy(struct sk_buff *skb, struct nf_conn *ct)static int ctnetlink_dump_id (struct sk_buff *skb,const struct nf_conn *ct) { -if (nla_put_be32 (skb,CTA_ID ,htonl ((unsigned long )ct))) +__be32 id = (__force __be32 )nf_ct_get_id (ct); + +if (nla_put_be32 (skb,CTA_ID , id)) goto nla_put_failure;return 0 ;
@@ -1275,8 +1278,9 @@ static int ctnetlink_del_conntrack(struct net *net, struct sock *ctnl, }if (cda[CTA_ID ]) { -u_int32_t id =ntohl (nla_get_be32 (cda[CTA_ID ])); -if (id != (u32 )(unsigned long )ct) { +__be32 id =nla_get_be32 (cda[CTA_ID ]); + +if (id != (__force __be32 )nf_ct_get_id (ct)) {nf_ct_put (ct);return -ENOENT ; }
@@ -2675,6 +2679,25 @@ static int ctnetlink_exp_dump_mask(struct sk_buff *skb,static const union nf_inet_addr any_addr; +static __be32 nf_expect_get_id (const struct nf_conntrack_expect *exp) +{ +static __read_mostly siphash_key_t exp_id_seed; +unsigned long a, b, c, d; + +net_get_random_once (&exp_id_seed,sizeof (exp_id_seed)); + + a = (unsigned long )exp; + b = (unsigned long )exp->helper; + c = (unsigned long )exp->master; + d = (unsigned long )siphash (&exp->tuple,sizeof (exp->tuple), &exp_id_seed); + +#ifdef CONFIG_64BIT +return (__force __be32 )siphash_4u64 ((u64 )a, (u64 )b, (u64 )c, (u64 )d, &exp_id_seed); +#else +return (__force __be32 )siphash_4u32 ((u32 )a, (u32 )b, (u32 )c, (u32 )d, &exp_id_seed); +#endif +} +static int ctnetlink_exp_dump_expect (struct sk_buff *skb,const struct nf_conntrack_expect *exp)
@@ -2722,7 +2745,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb, }#endif if (nla_put_be32 (skb,CTA_EXPECT_TIMEOUT ,htonl (timeout)) || -nla_put_be32 (skb,CTA_EXPECT_ID ,htonl ((unsigned long )exp)) || +nla_put_be32 (skb,CTA_EXPECT_ID ,nf_expect_get_id (exp)) ||nla_put_be32 (skb,CTA_EXPECT_FLAGS ,htonl (exp->flags)) ||nla_put_be32 (skb,CTA_EXPECT_CLASS ,htonl (exp->class))) goto nla_put_failure;
@@ -3027,7 +3050,8 @@ static int ctnetlink_get_expect(struct net *net, struct sock *ctnl,if (cda[CTA_EXPECT_ID ]) {__be32 id =nla_get_be32 (cda[CTA_EXPECT_ID ]); -if (ntohl (id) != (u32 )(unsigned long )exp) { + +if (id !=nf_expect_get_id (exp)) {nf_ct_expect_put (exp);return -ENOENT ; }
net/netfilter/nf_conntrack_proto.c +1 -1
@@ -86,7 +86,7 @@ void nf_l4proto_log_invalid(const struct sk_buff *skb,struct va_format vaf;va_list args; -if (net->ct.sysctl_log_invalid != protonum || +if (net->ct.sysctl_log_invalid != protonum && net->ct.sysctl_log_invalid !=IPPROTO_RAW )return ;
net/netfilter/nf_tables_api.c +8 -3
@@ -1496,7 +1496,7 @@ static int nft_chain_parse_hook(struct net *net,if (IS_ERR (type))return PTR_ERR (type); } -if (!(type->hook_mask & (1 << hook->num))) +if (hook->num >NF_MAX_HOOKS || !(type->hook_mask & (1 << hook->num)))return -EOPNOTSUPP ; if (type->type == NFT_CHAIN_T_NAT &&
@@ -2113,9 +2113,11 @@ static int nf_tables_newexpr(const struct nft_ctx *ctx,static void nf_tables_expr_destroy (const struct nft_ctx *ctx,struct nft_expr *expr) { +const struct nft_expr_type *type = expr->ops->type; +if (expr->ops->destroy) expr->ops->destroy (ctx, expr); -module_put (expr->ops->type->owner); +module_put (type->owner); } struct nft_expr *nft_expr_init(const struct nft_ctx *ctx,
@@ -2717,8 +2719,11 @@ static int nf_tables_newrule(struct net *net, struct sock *nlsk,nf_tables_rule_release (&ctx, rule); err1:for (i =0 ; i < n; i++) { -if (info[i].ops !=NULL ) +if (info[i].ops) {module_put (info[i].ops->type->owner); +if (info[i].ops->type->release_ops) + info[i].ops->type->release_ops (info[i].ops); + } }kvfree (info);return err;
net/nfc/nci/hci.c +8 -0
@@ -312,6 +312,10 @@ static void nci_hci_cmd_received(struct nci_dev *ndev, u8 pipe, create_info = (struct nci_hci_create_pipe_resp *)skb->data; dest_gate = create_info->dest_gate; new_pipe = create_info->pipe; +if (new_pipe >=NCI_HCI_MAX_PIPES ) { + status =NCI_HCI_ANY_E_NOK ; + goto exit; + }/* Save the new created pipe and bind with local gate, * the description for skb->data[3] is destination gate id
@@ -336,6 +340,10 @@ static void nci_hci_cmd_received(struct nci_dev *ndev, u8 pipe, goto exit; } delete_info = (struct nci_hci_delete_pipe_noti *)skb->data; +if (delete_info->pipe >=NCI_HCI_MAX_PIPES ) { + status =NCI_HCI_ANY_E_NOK ; + goto exit; + } ndev->hci_dev->pipes[delete_info->pipe].gate =NCI_HCI_INVALID_GATE ;
net/packet/af_packet.c +20 -5
@@ -4578,14 +4578,29 @@ static void __exit packet_exit(void)static int __init packet_init (void ) { -int rc =proto_register (&packet_proto,0 ); +int rc; -if (rc !=0 ) + rc =proto_register (&packet_proto,0 ); +if (rc) goto out; + rc =sock_register (&packet_family_ops); +if (rc) + goto out_proto; + rc =register_pernet_subsys (&packet_net_ops); +if (rc) + goto out_sock; + rc =register_netdevice_notifier (&packet_netdev_notifier); +if (rc) + goto out_pernet; -sock_register (&packet_family_ops); -register_pernet_subsys (&packet_net_ops); -register_netdevice_notifier (&packet_netdev_notifier); +return 0 ; + +out_pernet: +unregister_pernet_subsys (&packet_net_ops); +out_sock: +sock_unregister (PF_PACKET ); +out_proto: +proto_unregister (&packet_proto); out:return rc; }
net/strparser/strparser.c +5 -7
@@ -140,13 +140,11 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,/* We are going to append to the frags_list of head. * Need to unshare the frag_list. */ -if (skb_has_frag_list (head)) { - err =skb_unclone (head,GFP_ATOMIC ); -if (err) { -STRP_STATS_INCR (strp->stats.mem_fail); - desc->error = err; -return 0 ; - } + err =skb_unclone (head,GFP_ATOMIC ); +if (err) { +STRP_STATS_INCR (strp->stats.mem_fail); + desc->error = err; +return 0 ; }if (unlikely (skb_shinfo (head)->frag_list)) {
net/tipc/socket.c +2 -2
@@ -726,11 +726,11 @@ static __poll_t tipc_poll(struct file *file, struct socket *sock,switch (sk->sk_state) {case TIPC_ESTABLISHED : -case TIPC_CONNECTING :if (!tsk->cong_link_cnt && !tsk_conn_cong (tsk)) revents |=EPOLLOUT ;/* fall thru' */ case TIPC_LISTEN : +case TIPC_CONNECTING :if (!skb_queue_empty (&sk->sk_receive_queue)) revents |=EPOLLIN |EPOLLRDNORM ;break ;
@@ -2039,7 +2039,7 @@ static bool tipc_sk_filter_connect(struct tipc_sock *tsk, struct sk_buff *skb)return true;/* If empty 'ACK-' message, wake up sleeping connect() */ - sk->sk_data_ready (sk); + sk->sk_state_change (sk);/* 'ACK-' message is neither accepted nor rejected: */ msg_set_dest_droppable (hdr,1 );
net/tls/tls_device.c +4 -1
@@ -52,8 +52,11 @@ static DEFINE_SPINLOCK(tls_device_lock);static void tls_device_free_ctx (struct tls_context *ctx) { -if (ctx->tx_conf ==TLS_HW ) +if (ctx->tx_conf ==TLS_HW ) {kfree (tls_offload_ctx_tx (ctx)); +kfree (ctx->tx.rec_seq); +kfree (ctx->tx.iv); + }if (ctx->rx_conf ==TLS_HW )kfree (tls_offload_ctx_rx (ctx));
net/wireless/nl80211.c +12 -6
@@ -13392,7 +13392,8 @@ static const struct genl_ops nl80211_ops[] = { .policy = nl80211_policy, .flags = GENL_UNS_ADMIN_PERM, .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_DEAUTHENTICATE,
@@ -13443,7 +13444,8 @@ static const struct genl_ops nl80211_ops[] = { .policy = nl80211_policy, .flags = GENL_UNS_ADMIN_PERM, .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_UPDATE_CONNECT_PARAMS,
@@ -13451,7 +13453,8 @@ static const struct genl_ops nl80211_ops[] = { .policy = nl80211_policy, .flags = GENL_ADMIN_PERM, .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_DISCONNECT,
@@ -13480,7 +13483,8 @@ static const struct genl_ops nl80211_ops[] = { .policy = nl80211_policy, .flags = GENL_UNS_ADMIN_PERM, .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_DEL_PMKSA,
@@ -13832,7 +13836,8 @@ static const struct genl_ops nl80211_ops[] = { .policy = nl80211_policy, .flags = GENL_UNS_ADMIN_PERM, .internal_flags = NL80211_FLAG_NEED_WIPHY | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_SET_QOS_MAP,
@@ -13887,7 +13892,8 @@ static const struct genl_ops nl80211_ops[] = { .doit = nl80211_set_pmk, .policy = nl80211_policy, .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_DEL_PMK,
net/wireless/reg.c +39 -0
@@ -1287,6 +1287,16 @@ reg_intersect_dfs_region(const enum nl80211_dfs_regions dfs_region1,return dfs_region1; } +static void reg_wmm_rules_intersect (const struct ieee80211_wmm_ac *wmm_ac1, +const struct ieee80211_wmm_ac *wmm_ac2, +struct ieee80211_wmm_ac *intersect) +{ + intersect->cw_min =max_t (u16, wmm_ac1->cw_min, wmm_ac2->cw_min); + intersect->cw_max =max_t (u16, wmm_ac1->cw_max, wmm_ac2->cw_max); + intersect->cot =min_t (u16, wmm_ac1->cot, wmm_ac2->cot); + intersect->aifsn =max_t (u8, wmm_ac1->aifsn, wmm_ac2->aifsn); +} +/* * Helper for regdom_intersect(), this does the real * mathematical intersection fun
@@ -1301,6 +1311,8 @@ static int reg_rules_intersect(const struct ieee80211_regdomain *rd1,struct ieee80211_freq_range *freq_range;const struct ieee80211_power_rule *power_rule1, *power_rule2;struct ieee80211_power_rule *power_rule; +const struct ieee80211_wmm_rule *wmm_rule1, *wmm_rule2; +struct ieee80211_wmm_rule *wmm_rule;u32 freq_diff, max_bandwidth1, max_bandwidth2; freq_range1 = &rule1->freq_range;
@@ -1311,6 +1323,10 @@ static int reg_rules_intersect(const struct ieee80211_regdomain *rd1, power_rule2 = &rule2->power_rule; power_rule = &intersected_rule->power_rule; + wmm_rule1 = &rule1->wmm_rule; + wmm_rule2 = &rule2->wmm_rule; + wmm_rule = &intersected_rule->wmm_rule; + freq_range->start_freq_khz =max (freq_range1->start_freq_khz, freq_range2->start_freq_khz); freq_range->end_freq_khz = min(freq_range1->end_freq_khz,
@@ -1354,6 +1370,29 @@ static int reg_rules_intersect(const struct ieee80211_regdomain *rd1, intersected_rule->dfs_cac_ms =max (rule1->dfs_cac_ms, rule2->dfs_cac_ms); +if (rule1->has_wmm && rule2->has_wmm) { +u8 ac; + +for (ac =0 ; ac <IEEE80211_NUM_ACS ; ac++) { +reg_wmm_rules_intersect (&wmm_rule1->client[ac], + &wmm_rule2->client[ac], + &wmm_rule->client[ac]); +reg_wmm_rules_intersect (&wmm_rule1->ap[ac], + &wmm_rule2->ap[ac], + &wmm_rule->ap[ac]); + } + + intersected_rule->has_wmm = true; + }else if (rule1->has_wmm) { + *wmm_rule = *wmm_rule1; + intersected_rule->has_wmm = true; + }else if (rule2->has_wmm) { + *wmm_rule = *wmm_rule2; + intersected_rule->has_wmm = true; + }else { + intersected_rule->has_wmm = false; + } +if (!is_valid_reg_rule (intersected_rule))return -EINVAL ;
security/selinux/hooks.c +4 -4
@@ -4800,7 +4800,7 @@ static int selinux_socket_connect_helper(struct socket *sock,struct lsm_network_audit net = {0 ,};struct sockaddr_in *addr4 =NULL ;struct sockaddr_in6 *addr6 =NULL ; -unsigned short snum; +unsigned short snum =0 ;u32 sid, perm;/* sctp_connectx(3) calls via selinux_sctp_bind_connect()
@@ -4823,12 +4823,12 @@ static int selinux_socket_connect_helper(struct socket *sock,break ;default :/* Note that SCTP services expect -EINVAL, whereas -* others expect -EAFNOSUPPORT. +* others must handle this at the protocol level: +* connect(AF_UNSPEC) on a connected socket is +* a documented way disconnect the socket. */ if (sksec->sclass ==SECCLASS_SCTP_SOCKET )return -EINVAL ; -else -return -EAFNOSUPPORT ; } err =sel_netport_sid (sk->sk_protocol, snum, &sid);
tools/lib/traceevent/event-parse.c +1 -1
@@ -2192,7 +2192,7 @@ eval_type_str(unsigned long long val, const char *type, int pointer)return val &0xffffffff ;if (strcmp (type,"u64" ) ==0 || -strcmp (type,"s64" )) +strcmp (type,"s64" ) ==0 )return val;if (strcmp (type,"s8" ) ==0 )
tools/testing/selftests/net/fib_tests.sh +40 -54
132 lines not on this page · raw message
tools/testing/selftests/net/run_netsocktests +1 -1
@@ -7,7 +7,7 @@ echo "--------------------" ./socket if [ $? -ne 0 ]; then echo "[FAIL]" + exit 1 else echo "[PASS]" fi -
tools/testing/selftests/netfilter/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for netfilter selftests -TEST_PROGS := nft_trans_stress.sh nft_nat.sh +TEST_PROGS := nft_trans_stress.sh nft_nat.sh conntrack_icmp_related.sh include ../lib.mk
tools/testing/selftests/netfilter/conntrack_icmp_related.sh new file +283 -0
264 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.