Linux 4.20.15
Greg KH
maintainerI'm announcing the release of the 4.20.15 kernel.
All users of the 4.20 kernel series must upgrade.
The updated 4.20.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.20.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 | 2 arch/mips/kernel/irq.c | 4 arch/x86/boot/compressed/pgtable_64.c | 19 +++- arch/x86/kernel/cpu/amd.c | 8 - arch/xtensa/kernel/process.c | 4 drivers/android/binder.c | 106 ++++++++++++++++++----- drivers/base/dd.c | 2 drivers/bluetooth/btrtl.c | 10 +- drivers/char/applicom.c | 35 +++++-- drivers/cpufreq/cpufreq.c | 6 - drivers/cpufreq/intel_pstate.c | 23 ++--- drivers/gnss/sirf.c | 32 +++---- drivers/net/dsa/mv88e6xxx/chip.c | 27 ++++-- drivers/net/dsa/mv88e6xxx/port.c | 10 +- drivers/net/dsa/mv88e6xxx/port.h | 1 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 + drivers/net/ethernet/marvell/sky2.c | 24 +++++ drivers/net/ethernet/microchip/lan743x_main.c | 16 ++- drivers/net/ethernet/mscc/ocelot_board.c | 14 ++- drivers/net/geneve.c | 11 +- drivers/net/hyperv/netvsc_drv.c | 22 ++++ drivers/net/phy/micrel.c | 13 ++ drivers/net/phy/phylink.c | 4 drivers/net/team/team_mode_loadbalance.c | 15 +++ drivers/net/tun.c | 4 drivers/net/usb/qmi_wwan.c | 26 ++++- drivers/net/xen-netback/hash.c | 2 drivers/net/xen-netback/interface.c | 7 + drivers/net/xen-netback/netback.c | 10 +- drivers/scsi/scsi_lib.c | 1 drivers/staging/android/ashmem.c | 67 +++++++++------ drivers/staging/android/ion/ion_system_heap.c | 2 drivers/staging/comedi/drivers/ni_660x.c | 1 drivers/staging/erofs/inode.c | 8 - drivers/staging/erofs/internal.h | 11 +- drivers/staging/erofs/unzip_vle.c | 115 ++++++++++++++++---------- drivers/staging/erofs/unzip_vle.h | 3 drivers/staging/erofs/unzip_vle_lz4.c | 19 +--- drivers/staging/erofs/xattr.c | 65 +++++++++++--- drivers/staging/wilc1000/linux_wlan.c | 4 drivers/usb/host/xhci-pci.c | 1 drivers/usb/host/xhci-tegra.c | 4 drivers/usb/serial/cp210x.c | 12 ++ drivers/usb/serial/ftdi_sio.c | 2 drivers/usb/serial/ftdi_sio_ids.h | 6 + drivers/usb/serial/option.c | 2 fs/aio.c | 12 ++ fs/exec.c | 2 include/linux/cpufreq.h | 12 -- include/net/bluetooth/bluetooth.h | 2 include/net/icmp.h | 9 +- include/net/ip.h | 4 include/net/sch_generic.h | 31 ++----- include/uapi/linux/android/binder.h | 19 ++++ kernel/bpf/verifier.c | 3 kernel/trace/trace_events_filter.c | 5 - net/bluetooth/af_bluetooth.c | 16 ++- net/bluetooth/l2cap_sock.c | 2 net/bluetooth/rfcomm/sock.c | 2 net/bluetooth/sco.c | 2 net/core/gen_stats.c | 2 net/core/net-sysfs.c | 3 net/ipv4/cipso_ipv4.c | 20 +++- net/ipv4/fib_frontend.c | 4 net/ipv4/icmp.c | 7 - net/ipv4/ip_input.c | 9 +- net/ipv4/ip_options.c | 22 +++- net/ipv4/netlink.c | 17 ++- net/ipv4/route.c | 2 net/ipv6/ip6mr.c | 8 - net/ipv6/route.c | 7 + net/ipv6/sit.c | 1 net/mpls/af_mpls.c | 3 net/netlabel/netlabel_kapi.c | 3 net/nfc/llcp_commands.c | 20 ++++ net/nfc/llcp_core.c | 24 ++++- net/sched/act_ipt.c | 3 net/sched/act_skbedit.c | 3 net/sched/act_tunnel_key.c | 3 net/sched/sch_generic.c | 13 +- net/sched/sch_netem.c | 10 +- net/sctp/socket.c | 1 net/socket.c | 1 net/tipc/socket.c | 8 + tools/testing/selftests/firmware/fw_lib.sh | 2 85 files changed, 782 insertions(+), 321 deletions(-)
Ajay Singh (1):
staging: wilc1000: fix to set correct value for 'vif_num'
Andrew Lunn (2):
net: dsa: mv88e6xxx: Fix statistics on mv88e6161
net: dsa: mv88e6xxx: Fix u64 statistics
Balaji Manoharan (1):
usb: xhci: Fix for Enabling USB ROLE SWITCH QUIRK on INTEL_SUNRISEPOINT_LP_XHCI
Bart Van Assche (1):
aio: Fix locking in aio_poll()
Bryan Whitehead (1):
lan743x: Fix TX Stall Issue
Daniel Borkmann (1):
bpf: fix sanitation rewrite in case of non-pointers
Daniele Palmas (1):
USB: serial: option: add Telit ME910 ECM composition
David Ahern (4):
ipv4: Return error for RTA_VIA attribute
ipv6: Return error for RTA_VIA attribute
mpls: Return error for RTA_GATEWAY attribute
ipv4: Pass original device to ip_rcv_finish_core
Davide Caratti (2):
net/sched: act_ipt: fix refcount leak when replace fails net/sched: act_skbedit: fix refcount leak when replace fails
Eric Biggers (1):
net: socket: set sock->sk to NULL after calling proto_ops::release()
Eric Dumazet (1):
net: sched: put back q.qlen into a single location
Erik Hugne (1):
tipc: fix RDM/DGRAM connect() regression
Gao Xiang (5):
staging: erofs: fix mis-acted TAIL merging behavior
staging: erofs: fix fast symlink w/o xattr when fs xattr is on
staging: erofs: fix race of initializing xattrs of a inode at the same time
staging: erofs: fix illegal address access under memory pressure
staging: erofs: compressed_pages should not be accessed again after freed
Geert Uytterhoeven (1):
driver core: Postpone DMA tear-down until after devres release
Greg Kroah-Hartman (1):
Linux 4.20.15
Gustavo A. R. Silva (2):
staging: comedi: ni_660x: fix missing break in switch statement
applicom: Fix potential Spectre v1 vulnerabilities
Haiyang Zhang (1):
hv_netvsc: Fix IP header checksum for coalesced packets
Hangbin Liu (1):
ipv4: Add ICMPv6 support when parse route ipproto
Heiner Kallweit (5):
net: dsa: mv88e6xxx: add call to mv88e6xxx_ports_cmode_init to probe for new DSA framework
net: dsa: mv88e6xxx: handle unknown duplex modes gracefully in mv88e6xxx_port_set_duplex
net: dsa: mv8e6xxx: fix number of internal PHYs for 88E6x90 family
net: phy: phylink: fix uninitialized variable in phylink_get_mac_state
net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode
Ido Schimmel (2):
ip6mr: Do not call __IP6_INC_STATS() from preemptible context
team: Free BPF filter when unregistering netdev
Igor Druzhinin (2):
xen-netback: don't populate the hash cache on XenBus disconnect
xen-netback: fix occasional leak of grant ref mappings under memory pressure
Ivan Mironov (1):
USB: serial: cp210x: add ID for Ingenico 3070
Jiaxun Yang (1):
x86/CPU/AMD: Set the CPB bit unconditionally on F17h
Jiri Benc (1):
geneve: correctly handle ipv6.disable module parameter
Johan Hovold (1):
gnss: sirf: fix premature wakeup interrupt enable
Kai-Heng Feng (2):
sky2: Disable MSI on Dell Inspiron 1545 and Gateway P-79
Bluetooth: btrtl: Restore old logic to assume firmware is already loaded
Karoly Pados (1):
USB: serial: cp210x: fix GPIO in autosuspend
Kavya Sree Kotagiri (1):
net: mscc: Enable all ports in QSGMII
Kirill A. Shutemov (1):
x86/boot/compressed/64: Do not read legacy ROM on EFI system
Kristian Evensen (1):
qmi_wwan: Add support for Quectel EG12/EM12
Liu Xiang (1):
MIPS: irq: Allocate accurate order pages for irq stack
Luis Chamberlain (1):
selftests: firmware: fix verify_reqs() return value
Mans Rullgard (1):
USB: serial: ftdi_sio: add ID for Hjelmslund Electronics USB485
Mao Wenan (1):
net: sit: fix memory leak in sit_init_net()
Martin Wilck (1):
scsi: core: reset host byte in DID_NEXUS_FAILURE case
Matthias Kaehlcke (1):
Bluetooth: Fix locking in bt_accept_enqueue() for BH context
Max Filippov (1):
xtensa: fix get_wchan
Maxime Chevallier (1):
net: dsa: mv88e6xxx: power serdes on/off for 10G interfaces on 6390X
Michael Chan (1):
bnxt_en: Drop oversize TX packets to prevent errors.
Nazarov Sergey (2):
net: Add __icmp_send helper.
net: avoid use IPCB in cipso_v4_error
Paul Moore (1):
netlabel: fix out-of-bounds memory accesses
Pavel Tikhomirov (1):
tracing: Fix event filters and triggers to handle negative numbers
Qing Xia (1):
staging: android: ion: fix sys heap pool's gfp_flags
Rajasingh Thavamani (1):
net: phy: Micrel KSZ8061: link failure after cable connect
Sheng Lan (1):
net: netem: fix skb length BUG_ON in __skb_to_sgvec
Sheng Yong (1):
staging: erofs: fix memleak of inode's shared xattr array
Tetsuo Handa (2):
staging: android: ashmem: Don't call fallocate() with ashmem_mutex held.
staging: android: ashmem: Avoid range_alloc() allocation with ashmem_mutex held.
Thierry Reding (1):
xhci: tegra: Prevent error pointer dereference
Timur Celik (2):
tun: fix blocking read
tun: remove unnecessary memory barrier
Todd Kjos (1):
binder: create node flag to request sender's security context
Tung Nguyen (1):
tipc: fix race condition causing hung sendto
Viresh Kumar (1):
cpufreq: Use struct kobj_attribute instead of struct global_attr
Vlad Buslov (1):
net: sched: act_tunnel_key: fix NULL pointer dereference during init
Xin Long (1):
sctp: call iov_iter_revert() after sending ABORT
YueHaibing (3):
net-sysfs: Fix mem leak in netdev_register_kobject
net: nfc: Fix NULL dereference on nfc_llcp_build_tlv fails
exec: Fix mem leak in kernel_read_file
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 20 -SUBLEVEL = 14 +SUBLEVEL = 15 EXTRAVERSION = NAME = Shy Crocodile
arch/mips/kernel/irq.c +2 -2
@@ -52,6 +52,7 @@ asmlinkage void spurious_interrupt(void)void __init init_IRQ (void ) {int i; +unsigned int order =get_order (IRQ_STACK_SIZE );for (i =0 ; i <NR_IRQS ; i++)irq_set_noprobe (i);
@@ -62,8 +63,7 @@ void __init init_IRQ(void)arch_init_irq ();for_each_possible_cpu (i) { -int irq_pages =IRQ_STACK_SIZE /PAGE_SIZE ; -void *s = (void *)__get_free_pages (GFP_KERNEL , irq_pages); +void *s = (void *)__get_free_pages (GFP_KERNEL , order); irq_stack[i] = s; pr_debug("CPU%d IRQ stack at 0x%p - 0x%p\n", i,
arch/x86/boot/compressed/pgtable_64.c +16 -3
@@ -1,5 +1,7 @@ +#include <linux/efi.h> #include <asm/e820/types.h> #include <asm/processor.h> +#include <asm/efi.h> #include "pgtable.h" #include "../string.h"
@@ -37,9 +39,10 @@ int cmdline_find_option_bool(const char *option);static unsigned long find_trampoline_placement (void ) { -unsigned long bios_start, ebda_start; +unsigned long bios_start =0 , ebda_start =0 ;unsigned long trampoline_start;struct boot_e820_entry *entry; +char *signature;int i;/*
@@ -47,8 +50,18 @@ static unsigned long find_trampoline_placement(void)* This code is based on reserve_bios_regions(). */ - ebda_start = *(unsigned short *)0x40e <<4 ; - bios_start = *(unsigned short *)0x413 <<10 ; +/* +* EFI systems may not provide legacy ROM. The memory may not be mapped +* at all. +* +* Only look for values in the legacy ROM for non-EFI system. +*/ + signature = (char *)&boot_params->efi_info.efi_loader_signature; +if (strncmp (signature,EFI32_LOADER_SIGNATURE ,4 ) && +strncmp (signature,EFI64_LOADER_SIGNATURE ,4 )) { + ebda_start = *(unsigned short *)0x40e <<4 ; + bios_start = *(unsigned short *)0x413 <<10 ; + }if (bios_start <BIOS_START_MIN || bios_start >BIOS_START_MAX ) bios_start =BIOS_START_MAX ;
arch/x86/kernel/cpu/amd.c +3 -5
@@ -818,11 +818,9 @@ static void init_amd_bd(struct cpuinfo_x86 *c)static void init_amd_zn (struct cpuinfo_x86 *c) {set_cpu_cap (c,X86_FEATURE_ZEN ); -/* -* Fix erratum 1076: CPB feature bit not being set in CPUID. It affects -* all up to and including B1. -*/ -if (c->x86_model <=1 && c->x86_stepping <=1 ) + +/* Fix erratum 1076: CPB feature bit not being set in CPUID. */ +if (!cpu_has (c,X86_FEATURE_CPB ))set_cpu_cap (c,X86_FEATURE_CPB ); }
arch/xtensa/kernel/process.c +2 -2
@@ -320,8 +320,8 @@ unsigned long get_wchan(struct task_struct *p)/* Stack layout: sp-4: ra, sp-3: sp' */ - pc =MAKE_PC_FROM_RA (*(unsigned long *)sp -4 , sp); - sp = *(unsigned long *)sp -3 ; + pc =MAKE_PC_FROM_RA (SPILL_SLOT (sp,0 ), sp); + sp =SPILL_SLOT (sp,1 ); }while (count++ <16 );return 0 ; }
drivers/android/binder.c +83 -23
239 lines not on this page · raw message
drivers/base/dd.c +1 -1
@@ -965,9 +965,9 @@ static void __device_release_driver(struct device *dev, struct device *parent) drv->remove (dev);device_links_driver_cleanup (dev); -arch_teardown_dma_ops (dev);devres_release_all (dev); +arch_teardown_dma_ops (dev); dev->driver =NULL ;dev_set_drvdata (dev,NULL );if (dev->pm_domain && dev->pm_domain->dismiss)
drivers/bluetooth/btrtl.c +7 -3
@@ -552,10 +552,9 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, hdev->bus);if (!btrtl_dev->ic_info) { -rtl_dev_err (hdev,"rtl: unknown IC info, lmp subver %04x, hci rev %04x, hci ver %04x" , +rtl_dev_info (hdev,"rtl: unknown IC info, lmp subver %04x, hci rev %04x, hci ver %04x" , lmp_subver, hci_rev, hci_ver); - ret = -EINVAL ; - goto err_free; +return btrtl_dev; }if (btrtl_dev->ic_info->has_rom_version) {
@@ -610,6 +609,11 @@ int btrtl_download_firmware(struct hci_dev *hdev,* standard btusb. Once that firmware is uploaded, the subver changes * to a different value. */ +if (!btrtl_dev->ic_info) { +rtl_dev_info (hdev,"rtl: assuming no firmware upload needed\n" ); +return 0 ; + } +switch (btrtl_dev->ic_info->lmp_subver) {case RTL_ROM_LMP_8723A :case RTL_ROM_LMP_3499 :
drivers/char/applicom.c +24 -11
@@ -32,6 +32,7 @@#include <linux/wait.h> #include <linux/init.h> #include <linux/fs.h> +#include <linux/nospec.h> #include <asm/io.h> #include <linux/uaccess.h>
@@ -386,7 +387,11 @@ static ssize_t ac_write(struct file *file, const char __user *buf, size_t count, TicCard = st_loc.tic_des_from_pc;/* tic number to send */ IndexCard = NumCard -1 ; -if ((NumCard <1 ) || (NumCard >MAX_BOARD ) || !apbs[IndexCard].RamIO) +if (IndexCard >=MAX_BOARD ) +return -EINVAL ; + IndexCard =array_index_nospec (IndexCard,MAX_BOARD ); + +if (!apbs[IndexCard].RamIO)return -EINVAL ;#ifdef DEBUG
@@ -697,6 +702,7 @@ static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)unsigned char IndexCard;void __iomem *pmem;int ret =0 ; +static int warncount =10 ;volatile unsigned char byte_reset_it;struct st_ram_io *adgl;void __user *argp = (void __user *)arg;
@@ -711,16 +717,12 @@ static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)mutex_lock (&ac_mutex); IndexCard = adgl->num_card-1 ; -if (cmd !=6 && ((IndexCard >=MAX_BOARD ) || !apbs[IndexCard].RamIO)) { -static int warncount =10 ; -if (warncount) { -printk (KERN_WARNING "APPLICOM driver IOCTL, bad board number %d\n" ,(int )IndexCard+1 ); - warncount--; - } -kfree (adgl); -mutex_unlock (&ac_mutex); -return -EINVAL ; - } +if (cmd !=6 && IndexCard >=MAX_BOARD ) + goto err; + IndexCard =array_index_nospec (IndexCard,MAX_BOARD ); + +if (cmd !=6 && !apbs[IndexCard].RamIO) + goto err;switch (cmd) {
@@ -838,5 +840,16 @@ static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)kfree (adgl);mutex_unlock (&ac_mutex);return 0 ; + +err: +if (warncount) { +pr_warn ("APPLICOM driver IOCTL, bad board number %d\n" , + (int )IndexCard +1 ); + warncount--; + } +kfree (adgl); +mutex_unlock (&ac_mutex); +return -EINVAL ; + }
drivers/cpufreq/cpufreq.c +3 -3
@@ -545,13 +545,13 @@ EXPORT_SYMBOL_GPL(cpufreq_policy_transition_delay_us);* SYSFS INTERFACE * *********************************************************************/ static ssize_t show_boost (struct kobject *kobj, -struct attribute *attr,char *buf) +struct kobj_attribute *attr,char *buf) {return sprintf (buf,"%d\n" , cpufreq_driver->boost_enabled); } -static ssize_t store_boost (struct kobject *kobj,struct attribute *attr, -const char *buf,size_t count) +static ssize_t store_boost (struct kobject *kobj,struct kobj_attribute *attr, +const char *buf,size_t count) {int ret, enable;
drivers/cpufreq/intel_pstate.c +12 -11
@@ -873,7 +873,7 @@ static void intel_pstate_update_policies(void)/************************** sysfs begin ************************/ #define show_one (file_name, object) \ static ssize_t show_##file_name \ - (struct kobject *kobj, struct attribute *attr, char *buf) \ + (struct kobject *kobj, struct kobj_attribute *attr, char *buf) \ { \ return sprintf(buf, "%u\n", global.object); \ }
@@ -882,7 +882,7 @@ static ssize_t intel_pstate_show_status(char *buf);static int intel_pstate_update_status (const char *buf,size_t size);static ssize_t show_status (struct kobject *kobj, -struct attribute *attr,char *buf) +struct kobj_attribute *attr,char *buf) {ssize_t ret;
@@ -893,7 +893,7 @@ static ssize_t show_status(struct kobject *kobj,return ret; } -static ssize_t store_status (struct kobject *a,struct attribute *b, +static ssize_t store_status (struct kobject *a,struct kobj_attribute *b,const char *buf,size_t count) {char *p =memchr (buf,'\n' , count);
@@ -907,7 +907,7 @@ static ssize_t store_status(struct kobject *a, struct attribute *b, }static ssize_t show_turbo_pct (struct kobject *kobj, -struct attribute *attr,char *buf) +struct kobj_attribute *attr,char *buf) {struct cpudata *cpu;int total, no_turbo, turbo_pct;
@@ -933,7 +933,7 @@ static ssize_t show_turbo_pct(struct kobject *kobj, }static ssize_t show_num_pstates (struct kobject *kobj, -struct attribute *attr,char *buf) +struct kobj_attribute *attr,char *buf) {struct cpudata *cpu;int total;
@@ -954,7 +954,7 @@ static ssize_t show_num_pstates(struct kobject *kobj, }static ssize_t show_no_turbo (struct kobject *kobj, -struct attribute *attr,char *buf) +struct kobj_attribute *attr,char *buf) {ssize_t ret;
@@ -976,7 +976,7 @@ static ssize_t show_no_turbo(struct kobject *kobj,return ret; } -static ssize_t store_no_turbo (struct kobject *a,struct attribute *b, +static ssize_t store_no_turbo (struct kobject *a,struct kobj_attribute *b,const char *buf,size_t count) {unsigned int input;
@@ -1023,7 +1023,7 @@ static ssize_t store_no_turbo(struct kobject *a, struct attribute *b,return count; } -static ssize_t store_max_perf_pct (struct kobject *a,struct attribute *b, +static ssize_t store_max_perf_pct (struct kobject *a,struct kobj_attribute *b,const char *buf,size_t count) {unsigned int input;
@@ -1053,7 +1053,7 @@ static ssize_t store_max_perf_pct(struct kobject *a, struct attribute *b,return count; } -static ssize_t store_min_perf_pct (struct kobject *a,struct attribute *b, +static ssize_t store_min_perf_pct (struct kobject *a,struct kobj_attribute *b,const char *buf,size_t count) {unsigned int input;
@@ -1085,12 +1085,13 @@ static ssize_t store_min_perf_pct(struct kobject *a, struct attribute *b, }static ssize_t show_hwp_dynamic_boost (struct kobject *kobj, -struct attribute *attr,char *buf) +struct kobj_attribute *attr,char *buf) {return sprintf (buf,"%u\n" , hwp_boost); } -static ssize_t store_hwp_dynamic_boost (struct kobject *a,struct attribute *b, +static ssize_t store_hwp_dynamic_boost (struct kobject *a, +struct kobj_attribute *b,const char *buf,size_t count) {unsigned int input;
drivers/gnss/sirf.c +17 -15
@@ -310,30 +310,26 @@ static int sirf_probe(struct serdev_device *serdev) ret = -ENODEV ; goto err_put_device; } + + ret =regulator_enable (data->vcc); +if (ret) + goto err_put_device; + +/* Wait for chip to boot into hibernate mode. */ +msleep (SIRF_BOOT_DELAY ); }if (data->wakeup) { ret =gpiod_to_irq (data->wakeup);if (ret <0 ) - goto err_put_device; - + goto err_disable_vcc; data->irq = ret; - ret =devm_request_threaded_irq (dev, data->irq,NULL , - sirf_wakeup_handler, + ret =request_threaded_irq (data->irq,NULL , sirf_wakeup_handler,IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING |IRQF_ONESHOT ,"wakeup" , data);if (ret) - goto err_put_device; - } - -if (data->on_off) { - ret =regulator_enable (data->vcc); -if (ret) - goto err_put_device; - -/* Wait for chip to boot into hibernate mode */ -msleep (SIRF_BOOT_DELAY ); + goto err_disable_vcc; }if (IS_ENABLED (CONFIG_PM )) {
@@ -342,7 +338,7 @@ static int sirf_probe(struct serdev_device *serdev) }else { ret =sirf_runtime_resume (dev);if (ret <0 ) - goto err_disable_vcc; + goto err_free_irq; } ret =gnss_register_device (gdev);
@@ -356,6 +352,9 @@ static int sirf_probe(struct serdev_device *serdev)pm_runtime_disable (dev); elsesirf_runtime_suspend (dev ); +err_free_irq: +if (data->wakeup) +free_irq (data->irq, data); err_disable_vcc:if (data->on_off)regulator_disable (data->vcc);
@@ -376,6 +375,9 @@ static void sirf_remove(struct serdev_device *serdev)else sirf_runtime_suspend (&serdev->dev); +if (data->wakeup) +free_irq (data->irq, data); +if (data->on_off)regulator_disable (data->vcc);
drivers/net/dsa/mv88e6xxx/chip.c +19 -8
@@ -896,7 +896,7 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip,default :return U64_MAX ; } - value = (((u64 )high) <<16 ) | low; + value = (((u64 )high) <<32 ) | low;return value; }
@@ -3082,7 +3082,7 @@ static const struct mv88e6xxx_ops mv88e6161_ops = { .port_disable_pri_override = mv88e6xxx_port_disable_pri_override, .port_link_state = mv88e6352_port_link_state, .port_get_cmode = mv88e6185_port_get_cmode, - .stats_snapshot = mv88e6320_g1_stats_snapshot, + .stats_snapshot = mv88e6xxx_g1_stats_snapshot, .stats_set_histogram = mv88e6095_g1_stats_set_histogram, .stats_get_sset_count = mv88e6095_stats_get_sset_count, .stats_get_strings = mv88e6095_stats_get_strings,
@@ -4206,7 +4206,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .name = "Marvell 88E6190", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ - .num_internal_phys = 11, + .num_internal_phys = 9, .num_gpio = 16, .max_vid = 8191, .port_base_addr = 0x0,
@@ -4229,7 +4229,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .name = "Marvell 88E6190X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ - .num_internal_phys = 11, + .num_internal_phys = 9, .num_gpio = 16, .max_vid = 8191, .port_base_addr = 0x0,
@@ -4252,7 +4252,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .name = "Marvell 88E6191", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ - .num_internal_phys = 11, + .num_internal_phys = 9, .max_vid = 8191, .port_base_addr = 0x0, .phy_base_addr = 0x0,
@@ -4299,7 +4299,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .name = "Marvell 88E6290", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ - .num_internal_phys = 11, + .num_internal_phys = 9, .num_gpio = 16, .max_vid = 8191, .port_base_addr = 0x0,
@@ -4461,7 +4461,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .name = "Marvell 88E6390", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ - .num_internal_phys = 11, + .num_internal_phys = 9, .num_gpio = 16, .max_vid = 8191, .port_base_addr = 0x0,
@@ -4484,7 +4484,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .name = "Marvell 88E6390X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ - .num_internal_phys = 11, + .num_internal_phys = 9, .num_gpio = 16, .max_vid = 8191, .port_base_addr = 0x0,
@@ -4579,6 +4579,14 @@ static int mv88e6xxx_smi_init(struct mv88e6xxx_chip *chip,return 0 ; } +static void mv88e6xxx_ports_cmode_init (struct mv88e6xxx_chip *chip) +{ +int i; + +for (i =0 ; i <mv88e6xxx_num_ports (chip); i++) + chip->ports[i].cmode =MV88E6XXX_PORT_STS_CMODE_INVALID ; +} +static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol (struct dsa_switch *ds,int port) {
@@ -4615,6 +4623,8 @@ static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,if (err) goto free; +mv88e6xxx_ports_cmode_init (chip); +mutex_lock (&chip->reg_lock); err =mv88e6xxx_switch_reset (chip);mutex_unlock (&chip->reg_lock);
@@ -4821,6 +4831,7 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)if (err) goto out; +mv88e6xxx_ports_cmode_init (chip);mv88e6xxx_phy_init (chip);if (chip->info->ops->get_eeprom) {
drivers/net/dsa/mv88e6xxx/port.c +7 -3
@@ -190,7 +190,7 @@ int mv88e6xxx_port_set_duplex(struct mv88e6xxx_chip *chip, int port, int dup)/* normal duplex detection */ break ;default : -return -EINVAL ; +return -EOPNOTSUPP ; } err =mv88e6xxx_port_write (chip, port,MV88E6XXX_PORT_MAC_CTL , reg);
@@ -395,6 +395,10 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port, cmode =0 ; } +/* cmode doesn't change, nothing to do for us */ +if (cmode == chip->ports[port].cmode) +return 0 ; + lane =mv88e6390x_serdes_get_lane (chip, port);if (lane <0 )return lane;
@@ -405,7 +409,7 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,return err; } - err =mv88e6390_serdes_power (chip, port, false); + err =mv88e6390x_serdes_power (chip, port, false);if (err)return err;
@@ -421,7 +425,7 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,if (err)return err; - err =mv88e6390_serdes_power (chip, port, true); + err =mv88e6390x_serdes_power (chip, port, true);if (err)return err;
drivers/net/dsa/mv88e6xxx/port.h +1 -0
@@ -52,6 +52,7 @@#define MV88E6185_PORT_STS_CMODE_1000BASE_X 0x0005#define MV88E6185_PORT_STS_CMODE_PHY 0x0006#define MV88E6185_PORT_STS_CMODE_DISABLED 0x0007 +#define MV88E6XXX_PORT_STS_CMODE_INVALID 0xff/* Offset 0x01: MAC (or PCS or Physical) Control Register */ #define MV88E6XXX_PORT_MAC_CTL 0x01
drivers/net/ethernet/broadcom/bnxt/bnxt.c +6 -0
@@ -497,6 +497,12 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) } length >>=9 ; +if (unlikely (length >=ARRAY_SIZE (bnxt_lhint_arr))) { +dev_warn_ratelimited (&pdev->dev,"Dropped oversize %d bytes TX packet.\n" , + skb->len); + i =0 ; + goto tx_dma_error; + } flags |= bnxt_lhint_arr[length]; txbd->tx_bd_len_flags_type =cpu_to_le32 (flags);
drivers/net/ethernet/marvell/sky2.c +23 -1
@@ -46,6 +46,7 @@#include <linux/mii.h> #include <linux/of_device.h> #include <linux/of_net.h> +#include <linux/dmi.h> #include <asm/irq.h>
@@ -93,7 +94,7 @@ static int copybreak __read_mostly = 128;module_param (copybreak, int,0 );MODULE_PARM_DESC (copybreak,"Receive copy threshold" ); -static int disable_msi =0 ; +static int disable_msi =-1 ;module_param (disable_msi, int,0 );MODULE_PARM_DESC (disable_msi,"Disable Message Signaled Interrupt (MSI)" );
@@ -4931,6 +4932,24 @@ static const char *sky2_name(u8 chipid, char *buf, int sz)return buf; } +static const struct dmi_system_id msi_blacklist[] = { + { + .ident ="Dell Inspiron 1545" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Inspiron 1545" ), + }, + }, + { + .ident ="Gateway P-79" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Gateway" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"P-79" ), + }, + }, + {} +}; +static int sky2_probe (struct pci_dev *pdev,const struct pci_device_id *ent) {struct net_device *dev, *dev1;
@@ -5042,6 +5061,9 @@ static int sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_out_free_pci; } +if (disable_msi ==-1 ) + disable_msi = !!dmi_check_system (msi_blacklist); +if (!disable_msi &&pci_enable_msi (pdev) ==0 ) { err =sky2_test_msi (hw);if (err) {
drivers/net/ethernet/microchip/lan743x_main.c +12 -4
@@ -1400,7 +1400,8 @@ static int lan743x_tx_frame_start(struct lan743x_tx *tx, }static void lan743x_tx_frame_add_lso (struct lan743x_tx *tx, -unsigned int frame_length) +unsigned int frame_length, +int nr_frags) {/* called only from within lan743x_tx_xmit_frame. * assuming tx->ring_lock has already been acquired.
@@ -1410,6 +1411,10 @@ static void lan743x_tx_frame_add_lso(struct lan743x_tx *tx,/* wrap up previous descriptor */ tx->frame_data0 |=TX_DESC_DATA0_EXT_ ; +if (nr_frags <=0 ) { + tx->frame_data0 |=TX_DESC_DATA0_LS_ ; + tx->frame_data0 |=TX_DESC_DATA0_IOC_ ; + } tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail]; tx_descriptor->data0 = tx->frame_data0;
@@ -1514,8 +1519,11 @@ static void lan743x_tx_frame_end(struct lan743x_tx *tx,u32 tx_tail_flags =0 ;/* wrap up previous descriptor */ - tx->frame_data0 |=TX_DESC_DATA0_LS_ ; - tx->frame_data0 |=TX_DESC_DATA0_IOC_ ; +if ((tx->frame_data0 &TX_DESC_DATA0_DTYPE_MASK_ ) == +TX_DESC_DATA0_DTYPE_DATA_ ) { + tx->frame_data0 |=TX_DESC_DATA0_LS_ ; + tx->frame_data0 |=TX_DESC_DATA0_IOC_ ; + } tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail]; buffer_info = &tx->buffer_info[tx->frame_tail];
@@ -1600,7 +1608,7 @@ static netdev_tx_t lan743x_tx_xmit_frame(struct lan743x_tx *tx, }if (gso) -lan743x_tx_frame_add_lso (tx, frame_length); +lan743x_tx_frame_add_lso (tx, frame_length, nr_frags);if (nr_frags <=0 ) goto finish;
drivers/net/ethernet/mscc/ocelot_board.c +11 -3
@@ -266,6 +266,7 @@ static int mscc_ocelot_probe(struct platform_device *pdev)struct phy *serdes;void __iomem *regs;char res_name[8 ]; +int phy_mode;u32 port;if (of_property_read_u32 (portnp,"reg" , &port))
@@ -291,11 +292,11 @@ static int mscc_ocelot_probe(struct platform_device *pdev)if (err)return err; - err =of_get_phy_mode (portnp); -if (err <0 ) + phy_mode =of_get_phy_mode (portnp); +if (phy_mode <0 ) ocelot->ports[port]->phy_mode =PHY_INTERFACE_MODE_NA ;else - ocelot->ports[port]->phy_mode = err; + ocelot->ports[port]->phy_mode = phy_mode;switch (ocelot->ports[port]->phy_mode) {case PHY_INTERFACE_MODE_NA :
@@ -303,6 +304,13 @@ static int mscc_ocelot_probe(struct platform_device *pdev)case PHY_INTERFACE_MODE_SGMII :break ;case PHY_INTERFACE_MODE_QSGMII : +/* Ensure clock signals and speed is set on all +* QSGMII links +*/ +ocelot_port_writel (ocelot->ports[port], +DEV_CLOCK_CFG_LINK_SPEED + (OCELOT_SPEED_1000 ), +DEV_CLOCK_CFG );break ;default : dev_err(ocelot->dev,
drivers/net/geneve.c +8 -3
@@ -637,15 +637,20 @@ static int geneve_sock_add(struct geneve_dev *geneve, bool ipv6)static int geneve_open (struct net_device *dev) {struct geneve_dev *geneve =netdev_priv (dev); -bool ipv6 = !!(geneve->info.mode &IP_TUNNEL_INFO_IPV6 );bool metadata = geneve->collect_md; +bool ipv4, ipv6;int ret =0 ; + ipv6 = geneve->info.mode &IP_TUNNEL_INFO_IPV6 || metadata; + ipv4 = !ipv6 || metadata;#if IS_ENABLED (CONFIG_IPV6 ) -if (ipv6 || metadata) +if (ipv6) { ret =geneve_sock_add (geneve, true); +if (ret <0 && ret != -EAFNOSUPPORT ) + ipv4 = false; + }#endif -if (!ret && (!ipv6 || metadata)) +if (ipv4) ret =geneve_sock_add (geneve, false);if (ret <0 )geneve_sock_release (geneve);
drivers/net/hyperv/netvsc_drv.c +19 -3
@@ -744,6 +744,14 @@ void netvsc_linkstatus_callback(struct net_device *net,schedule_delayed_work (&ndev_ctx->dwork,0 ); } +static void netvsc_comp_ipcsum (struct sk_buff *skb) +{ +struct iphdr *iph = (struct iphdr *)skb->data; + + iph->check =0 ; + iph->check =ip_fast_csum (iph, iph->ihl); +} +static struct sk_buff *netvsc_alloc_recv_skb (struct net_device *net,struct netvsc_channel *nvchan) {
@@ -770,9 +778,17 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,/* skb is already created with CHECKSUM_NONE */ skb_checksum_none_assert (skb); -/* -* In Linux, the IP checksum is always checked. -* Do L4 checksum offload if enabled and present. +/* Incoming packets may have IP header checksum verified by the host. +* They may not have IP header checksum computed after coalescing. +* We compute it here if the flags are set, because on Linux, the IP +* checksum is always checked. +*/ +if (csum_info && csum_info->receive.ip_checksum_value_invalid && + csum_info->receive.ip_checksum_succeeded && + skb->protocol ==htons (ETH_P_IP )) +netvsc_comp_ipcsum (skb); + +/* Do L4 checksum offload if enabled and present. */ if (csum_info && (net->features &NETIF_F_RXCSUM )) { if (csum_info->receive.tcp_checksum_succeeded ||
drivers/net/phy/micrel.c +12 -1
@@ -339,6 +339,17 @@ static int ksz8041_config_aneg(struct phy_device *phydev)return genphy_config_aneg (phydev); } +static int ksz8061_config_init (struct phy_device *phydev) +{ +int ret; + + ret =phy_write_mmd (phydev,MDIO_MMD_PMAPMD ,MDIO_DEVID1 ,0xB61A ); +if (ret) +return ret; + +return kszphy_config_init (phydev); +} + static int ksz9021_load_values_from_of(struct phy_device *phydev, const struct device_node *of_node, u16 reg,
@@ -1044,7 +1055,7 @@ static struct phy_driver ksphy_driver[] = { .phy_id_mask = MICREL_PHY_ID_MASK, .features = PHY_BASIC_FEATURES, .flags = PHY_HAS_INTERRUPT, - .config_init = kszphy_config_init, + .config_init = ksz8061_config_init, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, .suspend = genphy_suspend,
drivers/net/phy/phylink.c +4 -0
@@ -321,6 +321,10 @@ static int phylink_get_mac_state(struct phylink *pl, struct phylink_link_state *linkmode_zero (state->lp_advertising); state->interface = pl->link_config.interface; state->an_enabled = pl->link_config.an_enabled; + state->speed =SPEED_UNKNOWN ; + state->duplex =DUPLEX_UNKNOWN ; + state->pause =MLO_PAUSE_NONE ; + state->an_complete =0 ; state->link =1 ;return pl->ops->mac_link_state (ndev, state);
drivers/net/team/team_mode_loadbalance.c +15 -0
@@ -325,6 +325,20 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)return 0 ; } +static void lb_bpf_func_free (struct team *team) +{ +struct lb_priv *lb_priv =get_lb_priv (team); +struct bpf_prog *fp; + +if (!lb_priv->ex->orig_fprog) +return ; + +__fprog_destroy (lb_priv->ex->orig_fprog); + fp =rcu_dereference_protected (lb_priv->fp, +lockdep_is_held (&team->lock)); +bpf_prog_destroy (fp); +} +static int lb_tx_method_get (struct team *team,struct team_gsetter_ctx *ctx) {struct lb_priv *lb_priv =get_lb_priv (team);
@@ -639,6 +653,7 @@ static void lb_exit(struct team *team)team_options_unregister (team, lb_options,ARRAY_SIZE (lb_options)); +lb_bpf_func_free (team);cancel_delayed_work_sync (&lb_priv->ex->stats.refresh_dw);free_percpu (lb_priv->pcpu_stats);kfree (lb_priv->ex);
drivers/net/tun.c +2 -2
@@ -2147,9 +2147,9 @@ static void *tun_ring_recv(struct tun_file *tfile, int noblock, int *err) }add_wait_queue (&tfile->wq.wait, &wait); - current->state =TASK_INTERRUPTIBLE ;while (1 ) { +set_current_state (TASK_INTERRUPTIBLE ); ptr =ptr_ring_consume (&tfile->tx_ring);if (ptr)break ;
@@ -2165,7 +2165,7 @@ static void *tun_ring_recv(struct tun_file *tfile, int noblock, int *err)schedule (); } - current->state =TASK_RUNNING ; +__set_current_state (TASK_RUNNING );remove_wait_queue (&tfile->wq.wait, &wait); out:
drivers/net/usb/qmi_wwan.c +18 -8
@@ -976,6 +976,13 @@ static const struct usb_device_id products[] = { 0xff), .driver_info = (unsigned long )&qmi_wwan_info_quirk_dtr, }, + { /* Quectel EG12/EM12 */ +USB_DEVICE_AND_INTERFACE_INFO (0x2c7c ,0x0512 , +USB_CLASS_VENDOR_SPEC , +USB_SUBCLASS_VENDOR_SPEC , +0xff ), + .driver_info = (unsigned long)&qmi_wwan_info_quirk_dtr, + }, /* 3. Combined interface devices matching on interface number */ {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
@@ -1343,17 +1350,20 @@ static bool quectel_ec20_detected(struct usb_interface *intf)return false; } -static bool quectel_ep06_diag_detected (struct usb_interface *intf) +static bool quectel_diag_detected (struct usb_interface *intf) {struct usb_device *dev =interface_to_usbdev (intf);struct usb_interface_descriptor intf_desc = intf->cur_altsetting->desc; +u16 id_vendor =le16_to_cpu (dev->descriptor.idVendor); +u16 id_product =le16_to_cpu (dev->descriptor.idProduct); -if (le16_to_cpu (dev->descriptor.idVendor) ==0x2c7c && -le16_to_cpu (dev->descriptor.idProduct) ==0x0306 && - intf_desc.bNumEndpoints ==2 ) -return true; +if (id_vendor !=0x2c7c || intf_desc.bNumEndpoints !=2 ) +return false; -return false; +if (id_product ==0x0306 || id_product ==0x0512 ) +return true; +else +return false; } static int qmi_wwan_probe(struct usb_interface *intf,
@@ -1390,13 +1400,13 @@ static int qmi_wwan_probe(struct usb_interface *intf,return -ENODEV ; } -/* Quectel EP06/EM06/EG06 supports dynamic interface configuration, so +/* Several Quectel modems supports dynamic interface configuration, so * we need to match on class/subclass/protocol. These values are * identical for the diagnostic- and QMI-interface, but bNumEndpoints is * different. Ignore the current interface if the number of endpoints * the number for the diag interface (two). */ -if (quectel_ep06_diag_detected (intf)) +if (quectel_diag_detected (intf))return -ENODEV ;return usbnet_probe (intf, id);
drivers/net/xen-netback/hash.c +2 -0
@@ -454,6 +454,8 @@ void xenvif_init_hash(struct xenvif *vif)if (xenvif_hash_cache_size ==0 )return ; +BUG_ON (vif->hash.cache.count); +spin_lock_init (&vif->hash.cache.lock);INIT_LIST_HEAD (&vif->hash.cache.list); }
drivers/net/xen-netback/interface.c +7 -0
@@ -153,6 +153,13 @@ static u16 xenvif_select_queue(struct net_device *dev, struct sk_buff *skb, {struct xenvif *vif =netdev_priv (dev);unsigned int size = vif->hash.size; +unsigned int num_queues; + +/* If queues are not set up internally - always return 0 +* as the packet going to be dropped anyway */ + num_queues =READ_ONCE (vif->num_queues); +if (num_queues <1 ) +return 0 ;if (vif->hash.alg ==XEN_NETIF_CTRL_HASH_ALGORITHM_NONE )return fallback (dev, skb,NULL ) % dev->real_num_tx_queues;
drivers/net/xen-netback/netback.c +5 -5
@@ -1072,11 +1072,6 @@ static int xenvif_handle_frag_list(struct xenvif_queue *queue, struct sk_buff *sskb_frag_size_set (&frags[i], len); } -/* Copied all the bits from the frag list -- free it. */ -skb_frag_list_init (skb); -xenvif_skb_zerocopy_prepare (queue, nskb); -kfree_skb (nskb); -/* Release all the original (foreign) frags. */ for (f =0 ; f <skb_shinfo (skb)->nr_frags; f++)skb_frag_unref (skb, f);
@@ -1145,6 +1140,8 @@ static int xenvif_tx_submit(struct xenvif_queue *queue)xenvif_fill_frags (queue, skb);if (unlikely (skb_has_frag_list (skb))) { +struct sk_buff *nskb =skb_shinfo (skb)->frag_list; +xenvif_skb_zerocopy_prepare (queue, nskb);if (xenvif_handle_frag_list (queue, skb)) {if (net_ratelimit ()) netdev_err(queue->vif->dev,
@@ -1153,6 +1150,9 @@ static int xenvif_tx_submit(struct xenvif_queue *queue)kfree_skb (skb);continue ; } +/* Copied all the bits from the frag list -- free it. */ +skb_frag_list_init (skb); +kfree_skb (nskb); } skb->dev = queue->vif->dev;
drivers/scsi/scsi_lib.c +1 -0
@@ -757,6 +757,7 @@ static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result)set_host_byte (cmd,DID_OK );return BLK_STS_TARGET ;case DID_NEXUS_FAILURE : +set_host_byte (cmd,DID_OK );return BLK_STS_NEXUS ;case DID_ALLOC_FAILURE :set_host_byte (cmd,DID_OK );
drivers/staging/android/ashmem.c +44 -23
160 lines not on this page · raw message
drivers/staging/android/ion/ion_system_heap.c +1 -1
@@ -224,10 +224,10 @@ static void ion_system_heap_destroy_pools(struct ion_page_pool **pools)static int ion_system_heap_create_pools (struct ion_page_pool **pools) {int i; -gfp_t gfp_flags = low_order_gfp_flags;for (i =0 ; i <NUM_ORDERS ; i++) {struct ion_page_pool *pool; +gfp_t gfp_flags = low_order_gfp_flags;if (orders[i] >4 ) gfp_flags = high_order_gfp_flags;
drivers/staging/comedi/drivers/ni_660x.c +1 -0
@@ -656,6 +656,7 @@ static int ni_660x_set_pfi_routing(struct comedi_device *dev,case NI_660X_PFI_OUTPUT_DIO :if (chan >31 )return -EINVAL ; +break ;default :return -EINVAL ; }
drivers/staging/erofs/inode.c +4 -4
@@ -185,16 +185,16 @@ static int fill_inode(struct inode *inode, int isdir)/* setup the new inode */ if (S_ISREG (inode->i_mode)) {#ifdef CONFIG_EROFS_FS_XATTR -if (vi->xattr_isize) - inode->i_op = &erofs_generic_xattr_iops; + inode->i_op = &erofs_generic_xattr_iops;#endif inode->i_fop = &generic_ro_fops; }else if (S_ISDIR (inode->i_mode)) { inode->i_op = #ifdef CONFIG_EROFS_FS_XATTR - vi->xattr_isize ? &erofs_dir_xattr_iops : -#endif + &erofs_dir_xattr_iops; +#else &erofs_dir_iops; +#endif inode->i_fop = &erofs_dir_fops; }else if (S_ISLNK (inode->i_mode)) {/* by default, page_get_link is used for symlink */
drivers/staging/erofs/internal.h +8 -3
@@ -352,12 +352,17 @@ static inline erofs_off_t iloc(struct erofs_sb_info *sbi, erofs_nid_t nid)return blknr_to_addr (sbi->meta_blkaddr) + (nid << sbi->islotbits); } -#define inode_set_inited_xattr (inode) (EROFS_V(inode)->flags |= 1) -#define inode_has_inited_xattr (inode) (EROFS_V(inode)->flags & 1) +/* atomic flag definitions */ +#define EROFS_V_EA_INITED_BIT 0 + +/* bitlock definitions (arranged in reverse order) */ +#define EROFS_V_BL_XATTR_BIT (BITS_PER_LONG - 1)struct erofs_vnode {erofs_nid_t nid; -unsigned int flags; + +/* atomic flags (including bitlocks) */ +unsigned long flags;unsigned char data_mapping_mode;/* inline size in bytes */
drivers/staging/erofs/unzip_vle.c +71 -44
205 lines not on this page · raw message
drivers/staging/erofs/unzip_vle.h +1 -2
@@ -218,8 +218,7 @@ extern int z_erofs_vle_plain_copy(struct page **compressed_pages,extern int z_erofs_vle_unzip_fast_percpu (struct page **compressed_pages,unsigned clusterpages,struct page **pages, -unsigned outlen,unsigned short pageofs, -void (*endio)(struct page *)); +unsigned int outlen,unsigned short pageofs); extern int z_erofs_vle_unzip_vmap(struct page **compressed_pages, unsigned clusterpages, void *vaddr, unsigned llen,
drivers/staging/erofs/unzip_vle_lz4.c +8 -11
@@ -105,8 +105,7 @@ int z_erofs_vle_unzip_fast_percpu(struct page **compressed_pages,unsigned int clusterpages, struct page **pages, unsigned int outlen, - unsigned short pageofs, - void (*endio)(struct page *)) + unsigned short pageofs) { void *vin, *vout;unsigned int nr_pages, i, j;
@@ -128,19 +127,16 @@ int z_erofs_vle_unzip_fast_percpu(struct page **compressed_pages, ret =z_erofs_unzip_lz4 (vin, vout + pageofs, clusterpages *PAGE_SIZE , outlen); -if (ret >=0 ) { - outlen = ret; - ret =0 ; - } +if (ret <0 ) + goto out; + ret =0 ;for (i =0 ; i < nr_pages; ++i) { j =min ((unsigned int )PAGE_SIZE - pageofs, outlen);if (pages[i]) { -if (ret <0 ) { -SetPageError (pages[i]); - }else if (clusterpages ==1 && - pages[i] == compressed_pages[0 ]) { +if (clusterpages ==1 && + pages[i] == compressed_pages[0 ]) {memcpy (vin + pageofs, vout + pageofs, j); }else {void *dst =kmap_atomic (pages[i]);
@@ -148,12 +144,13 @@ int z_erofs_vle_unzip_fast_percpu(struct page **compressed_pages,memcpy (dst + pageofs, vout + pageofs, j);kunmap_atomic (dst); } -endio (pages[i]); } vout +=PAGE_SIZE ; outlen -= j; pageofs =0 ; } + +out:preempt_enable ();if (clusterpages ==1 )
drivers/staging/erofs/xattr.c +50 -15
116 lines not on this page · raw message
drivers/staging/wilc1000/linux_wlan.c +2 -2
@@ -1104,8 +1104,8 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, vif->wilc = *wilc; vif->ndev = ndev; wl->vif[i] = vif; - wl->vif_num = i; - vif->idx = wl->vif_num; + wl->vif_num = i +1 ; + vif->idx = i; ndev->netdev_ops = &wilc_netdev_ops;
drivers/usb/host/xhci-pci.c +1 -0
@@ -194,6 +194,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) xhci->quirks |=XHCI_SSIC_PORT_UNUSED ;if (pdev->vendor ==PCI_VENDOR_ID_INTEL && (pdev->device ==PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || + pdev->device ==PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || pdev->device ==PCI_DEVICE_ID_INTEL_APL_XHCI )) xhci->quirks |=XHCI_INTEL_USB_ROLE_SW ; if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
drivers/usb/host/xhci-tegra.c +2 -2
@@ -941,9 +941,9 @@ static void tegra_xusb_powerdomain_remove(struct device *dev,device_link_del (tegra->genpd_dl_ss);if (tegra->genpd_dl_host)device_link_del (tegra->genpd_dl_host); -if (tegra->genpd_dev_ss) +if (!IS_ERR_OR_NULL (tegra->genpd_dev_ss))dev_pm_domain_detach (tegra->genpd_dev_ss, true); -if (tegra->genpd_dev_host) +if (!IS_ERR_OR_NULL (tegra->genpd_dev_host))dev_pm_domain_detach (tegra->genpd_dev_host, true); }
drivers/usb/serial/cp210x.c +12 -0
@@ -61,6 +61,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ { USB_DEVICE(0x0908, 0x01FF) }, /* Siemens RUGGEDCOM USB Serial Console */ + { USB_DEVICE(0x0B00, 0x3070) }, /* Ingenico 3070 */ { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */ { USB_DEVICE(0x0BED, 0x1101) }, /* MEI series 2000 Combo Acceptor */ { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */
@@ -1353,8 +1354,13 @@ static int cp210x_gpio_get(struct gpio_chip *gc, unsigned int gpio)if (priv->partnum ==CP210X_PARTNUM_CP2105 ) req_type =REQTYPE_INTERFACE_TO_HOST ; + result =usb_autopm_get_interface (serial->interface); +if (result) +return result; + result =cp210x_read_vendor_block (serial, req_type,CP210X_READ_LATCH , &buf,sizeof (buf)); +usb_autopm_put_interface (serial->interface);if (result <0 )return result;
@@ -1375,6 +1381,10 @@ static void cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value) buf.mask =BIT (gpio); + result =usb_autopm_get_interface (serial->interface); +if (result) + goto out; +if (priv->partnum ==CP210X_PARTNUM_CP2105 ) { result = cp210x_write_vendor_block(serial, REQTYPE_HOST_TO_INTERFACE,
@@ -1392,6 +1402,8 @@ static void cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value) NULL, 0, USB_CTRL_SET_TIMEOUT); } +usb_autopm_put_interface (serial->interface); +out:if (result <0 ) {dev_err (&serial->interface->dev,"failed to set GPIO value: %d\n" , result);
drivers/usb/serial/ftdi_sio.c +2 -0
@@ -1025,6 +1025,8 @@ static const struct usb_device_id id_table_combined[] = { { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_BT_USB_PID) }, { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_WL_USB_PID) }, { USB_DEVICE(AIRBUS_DS_VID, AIRBUS_DS_P8GR) }, +/* EZPrototypes devices */ + { USB_DEVICE(EZPROTOTYPES_VID, HJELMSLUND_USB485_ISO_PID) }, { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -1308,6 +1308,12 @@#define IONICS_VID 0x1c0c#define IONICS_PLUGCOMPUTER_PID 0x0102 +/* +* EZPrototypes (PID reseller) +*/ +#define EZPROTOTYPES_VID 0x1c40 +#define HJELMSLUND_USB485_ISO_PID 0x0477 +/* * Dresden Elektronik Sensor Terminal Board */
drivers/usb/serial/option.c +2 -0
@@ -1148,6 +1148,8 @@ static const struct usb_device_id option_ids[] = { .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM), .driver_info = NCTRL(0) | RSVD(3) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1102, 0xff), /* Telit ME910 (ECM) */ + .driver_info = NCTRL(0) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
fs/aio.c +9 -3
@@ -1661,6 +1661,7 @@ static int aio_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync, struct poll_iocb *req = container_of(wait, struct poll_iocb, wait); struct aio_kiocb *iocb = container_of(req, struct aio_kiocb, poll);__poll_t mask =key_to_poll (key); +unsigned long flags; req->woken = true;
@@ -1669,10 +1670,15 @@ static int aio_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,if (!(mask & req->events))return 0 ; -/* try to complete the iocb inline if we can: */ -if (spin_trylock (&iocb->ki_ctx->ctx_lock)) { +/* +* Try to complete the iocb inline if we can. Use +* irqsave/irqrestore because not all filesystems (e.g. fuse) +* call this function with IRQs disabled and because IRQs +* have to be disabled before ctx_lock is obtained. +*/ +if (spin_trylock_irqsave (&iocb->ki_ctx->ctx_lock, flags)) {list_del (&iocb->ki_list); -spin_unlock (&iocb->ki_ctx->ctx_lock); +spin_unlock_irqrestore (&iocb->ki_ctx->ctx_lock, flags);list_del_init (&req->wait.entry);aio_poll_complete (iocb, mask);
fs/exec.c +1 -1
@@ -929,7 +929,7 @@ int kernel_read_file(struct file *file, void **buf, loff_t *size, bytes =kernel_read (file, *buf + pos, i_size - pos, &pos);if (bytes <0 ) { ret = bytes; - goto out; + goto out_free; }if (bytes ==0 )
include/linux/cpufreq.h +2 -10
@@ -254,20 +254,12 @@ __ATTR(_name, 0644, show_##_name, store_##_name)static struct freq_attr _name = \ __ATTR(_name, 0200, NULL, store_##_name) -struct global_attr { -struct attribute attr; -ssize_t (*show)(struct kobject *kobj, -struct attribute *attr,char *buf); -ssize_t (*store)(struct kobject *a,struct attribute *b, -const char *c,size_t count); -}; -#define define_one_global_ro (_name) \ -static struct global_attr _name = \ +static struct kobj_attribute _name = \ __ATTR(_name, 0444, show_##_name, NULL)#define define_one_global_rw (_name) \ -static struct global_attr _name = \ +static struct kobj_attribute _name = \ __ATTR(_name, 0644, show_##_name, store_##_name)
include/net/bluetooth/bluetooth.h +1 -1
@@ -276,7 +276,7 @@ int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);int bt_sock_wait_state (struct sock *sk,int state,unsigned long timeo);int bt_sock_wait_ready (struct sock *sk,unsigned long flags); -void bt_accept_enqueue (struct sock *parent,struct sock *sk); +void bt_accept_enqueue (struct sock *parent,struct sock *sk,bool bh);void bt_accept_unlink (struct sock *sk);struct sock *bt_accept_dequeue (struct sock *parent,struct socket *newsock);
include/net/icmp.h +8 -1
@@ -22,6 +22,7 @@#include <net/inet_sock.h> #include <net/snmp.h> +#include <net/ip.h> struct icmp_err {int errno;
@@ -39,7 +40,13 @@ struct net_proto_family;struct sk_buff ;struct net ; -void icmp_send (struct sk_buff *skb_in,int type,int code,__be32 info); +void __icmp_send (struct sk_buff *skb_in,int type,int code,__be32 info, +const struct ip_options *opt); +static inline void icmp_send (struct sk_buff *skb_in,int type,int code,__be32 info) +{ +__icmp_send (skb_in, type, code, info, &IPCB (skb_in)->opt); +} +int icmp_rcv (struct sk_buff *skb);void icmp_err (struct sk_buff *skb,u32 info);int icmp_init (void );
include/net/ip.h +3 -1
@@ -665,6 +665,8 @@ static inline int ip_options_echo(struct net *net, struct ip_options *dopt, }void ip_options_fragment (struct sk_buff *skb); +int __ip_options_compile (struct net *net,struct ip_options *opt, +struct sk_buff *skb,__be32 *info);int ip_options_compile (struct net *net,struct ip_options *opt,struct sk_buff *skb); int ip_options_get(struct net *net, struct ip_options_rcu **optp,
@@ -714,7 +716,7 @@ extern int sysctl_icmp_msgs_burst;int ip_misc_proc_init (void );#endif -int rtm_getroute_parse_ip_proto (struct nlattr *attr,u8 *ip_proto, +int rtm_getroute_parse_ip_proto (struct nlattr *attr,u8 *ip_proto,u8 family,struct netlink_ext_ack *extack);#endif /* _IP_H */
include/net/sch_generic.h +13 -18
@@ -48,7 +48,10 @@ struct qdisc_size_table {struct qdisc_skb_head {struct sk_buff *head;struct sk_buff *tail; -__u32 qlen; +union { +u32 qlen; +atomic_t atomic_qlen; + };spinlock_t lock; };
@@ -405,27 +408,19 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)BUILD_BUG_ON (sizeof (qcb->data) < sz); } -static inline int qdisc_qlen_cpu (const struct Qdisc *q) -{ -return this_cpu_ptr (q->cpu_qstats)->qlen; -} -static inline int qdisc_qlen (const struct Qdisc *q) {return q->q.qlen; } -static inline int qdisc_qlen_sum (const struct Qdisc *q) +static inline u32 qdisc_qlen_sum (const struct Qdisc *q) { -__u32 qlen = q->qstats.qlen; -int i; +u32 qlen = q->qstats.qlen; -if (q->flags &TCQ_F_NOLOCK ) { -for_each_possible_cpu (i) - qlen +=per_cpu_ptr (q->cpu_qstats, i)->qlen; - }else { +if (q->flags &TCQ_F_NOLOCK ) + qlen +=atomic_read (&q->q.atomic_qlen); +else qlen += q->q.qlen; - }return qlen; }
@@ -798,14 +793,14 @@ static inline void qdisc_qstats_cpu_backlog_inc(struct Qdisc *sch,this_cpu_add (sch->cpu_qstats->backlog,qdisc_pkt_len (skb)); } -static inline void qdisc_qstats_cpu_qlen_inc (struct Qdisc *sch) +static inline void qdisc_qstats_atomic_qlen_inc (struct Qdisc *sch) { -this_cpu_inc (sch->cpu_qstats->qlen); +atomic_inc (&sch->q.atomic_qlen); } -static inline void qdisc_qstats_cpu_qlen_dec (struct Qdisc *sch) +static inline void qdisc_qstats_atomic_qlen_dec (struct Qdisc *sch) { -this_cpu_dec (sch->cpu_qstats->qlen); +atomic_dec (&sch->q.atomic_qlen); }static inline void qdisc_qstats_cpu_requeues_inc (struct Qdisc *sch)
include/uapi/linux/android/binder.h +19 -0
@@ -41,6 +41,14 @@ enum {enum {FLAT_BINDER_FLAG_PRIORITY_MASK =0xff ,FLAT_BINDER_FLAG_ACCEPTS_FDS =0x100 , + +/** +* @FLAT_BINDER_FLAG_TXN_SECURITY_CTX: request security contexts +* +* Only when set, causes senders to include their security +* context +*/ +FLAT_BINDER_FLAG_TXN_SECURITY_CTX =0x1000 , };#ifdef BINDER_IPC_32BIT
@@ -218,6 +226,7 @@ struct binder_node_info_for_ref {#define BINDER_VERSION _IOWR('b', 9, struct binder_version)#define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)#define BINDER_GET_NODE_INFO_FOR_REF _IOWR('b', 12, struct binder_node_info_for_ref) +#define BINDER_SET_CONTEXT_MGR_EXT _IOW('b', 13, struct flat_binder_object)/* * NOTE: Two special error codes you should check for when calling
@@ -276,6 +285,11 @@ struct binder_transaction_data { } data; }; +struct binder_transaction_data_secctx { +struct binder_transaction_data transaction_data; +binder_uintptr_t secctx; +}; +struct binder_transaction_data_sg {struct binder_transaction_data transaction_data;binder_size_t buffers_size;
@@ -311,6 +325,11 @@ enum binder_driver_return_protocol {BR_OK =_IO ('r' ,1 ),/* No parameters! */ +BR_TRANSACTION_SEC_CTX =_IOR ('r' ,2 , + struct binder_transaction_data_secctx), +/* +* binder_transaction_data_secctx: the received command. +*/ BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data), BR_REPLY = _IOR('r', 3, struct binder_transaction_data),/*
kernel/bpf/verifier.c +2 -1
@@ -6428,7 +6428,8 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env)u32 off_reg; aux = &env->insn_aux_data[i + delta]; -if (!aux->alu_state) +if (!aux->alu_state || + aux->alu_state ==BPF_ALU_NON_POINTER )continue ; isneg = aux->alu_state &BPF_ALU_NEG_VALUE ;
kernel/trace/trace_events_filter.c +4 -1
@@ -1301,7 +1301,7 @@ static int parse_pred(const char *str, void *data,/* go past the last quote */ i++; - }else if (isdigit (str[i])) { + }else if (isdigit (str[i]) || str[i] =='-' ) {/* Make sure the field is not a string */ if (is_string_field (field)) {
@@ -1314,6 +1314,9 @@ static int parse_pred(const char *str, void *data, goto err_free; } +if (str[i] =='-' ) + i++; +/* We allow 0xDEADBEEF */ while (isalnum (str[i])) i++;
net/bluetooth/af_bluetooth.c +13 -3
@@ -154,15 +154,25 @@ void bt_sock_unlink(struct bt_sock_list *l, struct sock *sk) }EXPORT_SYMBOL (bt_sock_unlink); -void bt_accept_enqueue (struct sock *parent,struct sock *sk) +void bt_accept_enqueue (struct sock *parent,struct sock *sk,bool bh) {BT_DBG ("parent %p, sk %p" , parent, sk);sock_hold (sk); -lock_sock_nested (sk,SINGLE_DEPTH_NESTING ); + +if (bh) +bh_lock_sock_nested (sk); +else +lock_sock_nested (sk,SINGLE_DEPTH_NESTING ); +list_add_tail (&bt_sk (sk)->accept_q, &bt_sk (parent)->accept_q);bt_sk (sk)->parent = parent; -release_sock (sk); + +if (bh) +bh_unlock_sock (sk); +else +release_sock (sk); + parent->sk_ack_backlog++; }EXPORT_SYMBOL (bt_accept_enqueue);
net/bluetooth/l2cap_sock.c +1 -1
@@ -1252,7 +1252,7 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)l2cap_sock_init (sk, parent); -bt_accept_enqueue (parent, sk); +bt_accept_enqueue (parent, sk, false);release_sock (parent);
net/bluetooth/rfcomm/sock.c +1 -1
@@ -988,7 +988,7 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc *rfcomm_pi (sk)->channel = channel; sk->sk_state =BT_CONFIG ; -bt_accept_enqueue (parent, sk); +bt_accept_enqueue (parent, sk, true);/* Accept connection and return socket DLC */ *d =rfcomm_pi (sk)->dlc;
net/bluetooth/sco.c +1 -1
@@ -193,7 +193,7 @@ static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, conn->sk = sk;if (parent) -bt_accept_enqueue (parent, sk); +bt_accept_enqueue (parent, sk, true); } static int sco_chan_add(struct sco_conn *conn, struct sock *sk,
net/core/gen_stats.c +0 -2
@@ -291,7 +291,6 @@ __gnet_stats_copy_queue_cpu(struct gnet_stats_queue *qstats,for_each_possible_cpu (i) {const struct gnet_stats_queue *qcpu =per_cpu_ptr (q, i); - qstats->qlen =0 ; qstats->backlog += qcpu->backlog; qstats->drops += qcpu->drops; qstats->requeues += qcpu->requeues;
@@ -307,7 +306,6 @@ void __gnet_stats_copy_queue(struct gnet_stats_queue *qstats,if (cpu) {__gnet_stats_copy_queue_cpu (qstats, cpu); }else { - qstats->qlen = q->qlen; qstats->backlog = q->backlog; qstats->drops = q->drops; qstats->requeues = q->requeues;
net/core/net-sysfs.c +3 -0
@@ -1547,6 +1547,9 @@ static int register_queue_kobjects(struct net_device *dev) error:netdev_queue_update_kobjects (dev, txq,0 );net_rx_queue_update_kobjects (dev, rxq,0 ); +#ifdef CONFIG_SYSFS +kset_unregister (dev->queues_kset); +#endif return error; }
net/ipv4/cipso_ipv4.c +17 -3
@@ -667,7 +667,8 @@ static int cipso_v4_map_lvl_valid(const struct cipso_v4_doi *doi_def, u8 level)case CIPSO_V4_MAP_PASS :return 0 ;case CIPSO_V4_MAP_TRANS : -if (doi_def->map.std->lvl.cipso[level] <CIPSO_V4_INV_LVL ) +if ((level < doi_def->map.std->lvl.cipso_size) && + (doi_def->map.std->lvl.cipso[level] <CIPSO_V4_INV_LVL ))return 0 ;break ; }
@@ -1735,13 +1736,26 @@ int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option)*/ void cipso_v4_error (struct sk_buff *skb,int error,u32 gateway) { +unsigned char optbuf[sizeof (struct ip_options ) +40 ]; +struct ip_options *opt = (struct ip_options *)optbuf; +if (ip_hdr (skb)->protocol ==IPPROTO_ICMP || error != -EACCES )return ; +/* +* We might be called above the IP layer, +* so we can not use icmp_send and IPCB here. +*/ + +memset (opt,0 ,sizeof (struct ip_options )); + opt->optlen =ip_hdr (skb)->ihl*4 -sizeof (struct iphdr ); +if (__ip_options_compile (dev_net (skb->dev), opt, skb,NULL )) +return ; +if (gateway) -icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_NET_ANO ,0 ); +__icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_NET_ANO ,0 , opt);else -icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_HOST_ANO ,0 ); +__icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_HOST_ANO ,0 , opt); }/**
net/ipv4/fib_frontend.c +4 -0
@@ -710,6 +710,10 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb,case RTA_GATEWAY : cfg->fc_gw =nla_get_be32 (attr);break ; +case RTA_VIA : +NL_SET_ERR_MSG (extack,"IPv4 does not support RTA_VIA attribute" ); + err = -EINVAL ; + goto errout;case RTA_PRIORITY : cfg->fc_priority =nla_get_u32 (attr);break ;
net/ipv4/icmp.c +4 -3
@@ -570,7 +570,8 @@ static struct rtable *icmp_route_lookup(struct net *net,* MUST reply to only the first fragment. */ -void icmp_send (struct sk_buff *skb_in,int type,int code,__be32 info) +void __icmp_send (struct sk_buff *skb_in,int type,int code,__be32 info, +const struct ip_options *opt) {struct iphdr *iph;int room;
@@ -691,7 +692,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) iph->tos; mark =IP4_REPLY_MARK (net, skb_in->mark); -if (ip_options_echo (net, &icmp_param.replyopts.opt.opt, skb_in)) +if (__ip_options_echo (net, &icmp_param.replyopts.opt.opt, skb_in, opt)) goto out_unlock;
@@ -742,7 +743,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)local_bh_enable (); out:; } -EXPORT_SYMBOL (icmp_send); +EXPORT_SYMBOL (__icmp_send);static void icmp_socket_deliver (struct sk_buff *skb,u32 info)
net/ipv4/ip_input.c +5 -4
@@ -308,11 +308,10 @@ static inline bool ip_rcv_options(struct sk_buff *skb) }static int ip_rcv_finish_core (struct net *net,struct sock *sk, -struct sk_buff *skb) +struct sk_buff *skb,struct net_device *dev) {const struct iphdr *iph =ip_hdr (skb);int (*edemux)(struct sk_buff *skb); -struct net_device *dev = skb->dev;struct rtable *rt;int err;
@@ -401,6 +400,7 @@ static int ip_rcv_finish_core(struct net *net, struct sock *sk,static int ip_rcv_finish (struct net *net,struct sock *sk,struct sk_buff *skb) { +struct net_device *dev = skb->dev;int ret;/* if ingress device is enslaved to an L3 master device pass the
@@ -410,7 +410,7 @@ static int ip_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)if (!skb)return NET_RX_SUCCESS ; - ret =ip_rcv_finish_core (net, sk, skb); + ret =ip_rcv_finish_core (net, sk, skb, dev);if (ret !=NET_RX_DROP ) ret =dst_input (skb);return ret;
@@ -546,6 +546,7 @@ static void ip_list_rcv_finish(struct net *net, struct sock *sk,INIT_LIST_HEAD (&sublist);list_for_each_entry_safe (skb, next, head, list) { +struct net_device *dev = skb->dev;struct dst_entry *dst;skb_list_del_init (skb);
@@ -555,7 +556,7 @@ static void ip_list_rcv_finish(struct net *net, struct sock *sk, skb =l3mdev_ip_rcv (skb);if (!skb)continue ; -if (ip_rcv_finish_core (net, sk, skb) ==NET_RX_DROP ) +if (ip_rcv_finish_core (net, sk, skb, dev) ==NET_RX_DROP )continue ; dst =skb_dst (skb);
net/ipv4/ip_options.c +17 -5
@@ -251,8 +251,9 @@ static void spec_dst_fill(__be32 *spec_dst, struct sk_buff *skb)* If opt == NULL, then skb->data should point to IP header. */ -int ip_options_compile (struct net *net, -struct ip_options *opt,struct sk_buff *skb) +int __ip_options_compile (struct net *net, +struct ip_options *opt,struct sk_buff *skb, +__be32 *info) {__be32 spec_dst =htonl (INADDR_ANY );unsigned char *pp_ptr =NULL ;
@@ -468,11 +469,22 @@ int ip_options_compile(struct net *net,return 0 ; error: -if (skb) { -icmp_send (skb,ICMP_PARAMETERPROB ,0 ,htonl ((pp_ptr-iph)<<24 )); - } +if (info) + *info =htonl ((pp_ptr-iph)<<24 );return -EINVAL ; } + +int ip_options_compile (struct net *net, +struct ip_options *opt,struct sk_buff *skb) +{ +int ret; +__be32 info; + + ret =__ip_options_compile (net, opt, skb, &info); +if (ret !=0 && skb) +icmp_send (skb,ICMP_PARAMETERPROB ,0 , info); +return ret; +}EXPORT_SYMBOL (ip_options_compile);/*
net/ipv4/netlink.c +13 -4
@@ -3,9 +3,10 @@#include <linux/types.h> #include <net/net_namespace.h> #include <net/netlink.h> +#include <linux/in6.h> #include <net/ip.h> -int rtm_getroute_parse_ip_proto (struct nlattr *attr,u8 *ip_proto, +int rtm_getroute_parse_ip_proto (struct nlattr *attr,u8 *ip_proto,u8 family,struct netlink_ext_ack *extack) { *ip_proto =nla_get_u8 (attr);
@@ -13,11 +14,19 @@ int rtm_getroute_parse_ip_proto(struct nlattr *attr, u8 *ip_proto,switch (*ip_proto) {case IPPROTO_TCP :case IPPROTO_UDP : +return 0 ;case IPPROTO_ICMP : +if (family !=AF_INET ) +break ; +return 0 ; +#if IS_ENABLED (CONFIG_IPV6 ) +case IPPROTO_ICMPV6 : +if (family !=AF_INET6 ) +break ;return 0 ; -default : -NL_SET_ERR_MSG (extack,"Unsupported ip proto" ); -return -EOPNOTSUPP ; +#endif } +NL_SET_ERR_MSG (extack,"Unsupported ip proto" ); +return -EOPNOTSUPP ; }EXPORT_SYMBOL_GPL (rtm_getroute_parse_ip_proto);
net/ipv4/route.c +1 -1
@@ -2803,7 +2803,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,if (tb[RTA_IP_PROTO ]) { err =rtm_getroute_parse_ip_proto (tb[RTA_IP_PROTO ], - &ip_proto, extack); + &ip_proto,AF_INET , extack);if (err)return err; }
net/ipv6/ip6mr.c +4 -4
@@ -1964,10 +1964,10 @@ int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)static inline int ip6mr_forward2_finish (struct net *net,struct sock *sk,struct sk_buff *skb) { -__IP6_INC_STATS (net,ip6_dst_idev (skb_dst (skb)), -IPSTATS_MIB_OUTFORWDATAGRAMS ); -__IP6_ADD_STATS (net,ip6_dst_idev (skb_dst (skb)), -IPSTATS_MIB_OUTOCTETS , skb->len); +IP6_INC_STATS (net,ip6_dst_idev (skb_dst (skb)), +IPSTATS_MIB_OUTFORWDATAGRAMS ); +IP6_ADD_STATS (net,ip6_dst_idev (skb_dst (skb)), +IPSTATS_MIB_OUTOCTETS , skb->len);return dst_output (net, sk, skb); }
net/ipv6/route.c +6 -1
@@ -4163,6 +4163,10 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh, cfg->fc_gateway =nla_get_in6_addr (tb[RTA_GATEWAY ]); cfg->fc_flags |=RTF_GATEWAY ; } +if (tb[RTA_VIA ]) { +NL_SET_ERR_MSG (extack,"IPv6 does not support RTA_VIA attribute" ); + goto errout; + }if (tb[RTA_DST ]) {int plen = (rtm->rtm_dst_len +7 ) >>3 ;
@@ -4880,7 +4884,8 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,if (tb[RTA_IP_PROTO ]) { err =rtm_getroute_parse_ip_proto (tb[RTA_IP_PROTO ], - &fl6.flowi6_proto, extack); + &fl6.flowi6_proto,AF_INET6 , + extack);if (err) goto errout; }
net/ipv6/sit.c +1 -0
@@ -1873,6 +1873,7 @@ static int __net_init sit_init_net(struct net *net) err_reg_dev:ipip6_dev_free (sitn->fb_tunnel_dev); +free_netdev (sitn->fb_tunnel_dev); err_alloc_dev:return err; }
net/mpls/af_mpls.c +3 -0
@@ -1838,6 +1838,9 @@ static int rtm_to_route_config(struct sk_buff *skb, goto errout;break ; } +case RTA_GATEWAY : +NL_SET_ERR_MSG (extack,"MPLS does not support RTA_GATEWAY attribute" ); + goto errout;case RTA_VIA : { if (nla_get_via(nla, &cfg->rc_via_alen,
net/netlabel/netlabel_kapi.c +2 -1
@@ -903,7 +903,8 @@ int netlbl_bitmap_walk(const unsigned char *bitmap, u32 bitmap_len, (state == 0 && (byte & bitmask) == 0))return bit_spot; - bit_spot++; +if (++bit_spot >= bitmap_len) +return -1 ; bitmask >>=1 ;if (bitmask ==0 ) { byte = bitmap[++byte_offset];
net/nfc/llcp_commands.c +20 -0
@@ -419,6 +419,10 @@ int nfc_llcp_send_connect(struct nfc_llcp_sock *sock) sock->service_name, sock->service_name_len, &service_name_tlv_length); +if (!service_name_tlv) { + err = -ENOMEM ; + goto error_tlv; + } size += service_name_tlv_length; }
@@ -429,9 +433,17 @@ int nfc_llcp_send_connect(struct nfc_llcp_sock *sock) miux_tlv =nfc_llcp_build_tlv (LLCP_TLV_MIUX , (u8 *)&miux,0 , &miux_tlv_length); +if (!miux_tlv) { + err = -ENOMEM ; + goto error_tlv; + } size += miux_tlv_length; rw_tlv =nfc_llcp_build_tlv (LLCP_TLV_RW , &rw,0 , &rw_tlv_length); +if (!rw_tlv) { + err = -ENOMEM ; + goto error_tlv; + } size += rw_tlv_length;pr_debug ("SKB size %d SN length %zu\n" , size, sock->service_name_len);
@@ -484,9 +496,17 @@ int nfc_llcp_send_cc(struct nfc_llcp_sock *sock) miux_tlv =nfc_llcp_build_tlv (LLCP_TLV_MIUX , (u8 *)&miux,0 , &miux_tlv_length); +if (!miux_tlv) { + err = -ENOMEM ; + goto error_tlv; + } size += miux_tlv_length; rw_tlv =nfc_llcp_build_tlv (LLCP_TLV_RW , &rw,0 , &rw_tlv_length); +if (!rw_tlv) { + err = -ENOMEM ; + goto error_tlv; + } size += rw_tlv_length; skb =llcp_allocate_pdu (sock,LLCP_PDU_CC , size);
net/nfc/llcp_core.c +20 -4
@@ -532,10 +532,10 @@ static u8 nfc_llcp_reserve_sdp_ssap(struct nfc_llcp_local *local)static int nfc_llcp_build_gb (struct nfc_llcp_local *local) { -u8 *gb_cur, *version_tlv, version, version_length; -u8 *lto_tlv, lto_length; -u8 *wks_tlv, wks_length; -u8 *miux_tlv, miux_length; +u8 *gb_cur, version, version_length; +u8 lto_length, wks_length, miux_length; +u8 *version_tlv =NULL , *lto_tlv =NULL , + *wks_tlv =NULL , *miux_tlv =NULL ;__be16 wks =cpu_to_be16 (local->local_wks);u8 gb_len =0 ;int ret =0 ;
@@ -543,17 +543,33 @@ static int nfc_llcp_build_gb(struct nfc_llcp_local *local) version =LLCP_VERSION_11 ; version_tlv =nfc_llcp_build_tlv (LLCP_TLV_VERSION , &version,1 , &version_length); +if (!version_tlv) { + ret = -ENOMEM ; + goto out; + } gb_len += version_length; lto_tlv =nfc_llcp_build_tlv (LLCP_TLV_LTO , &local->lto,1 , <o_length); +if (!lto_tlv) { + ret = -ENOMEM ; + goto out; + } gb_len += lto_length;pr_debug ("Local wks 0x%lx\n" , local->local_wks); wks_tlv =nfc_llcp_build_tlv (LLCP_TLV_WKS , (u8 *)&wks,2 , &wks_length); +if (!wks_tlv) { + ret = -ENOMEM ; + goto out; + } gb_len += wks_length; miux_tlv =nfc_llcp_build_tlv (LLCP_TLV_MIUX , (u8 *)&local->miux,0 , &miux_length); +if (!miux_tlv) { + ret = -ENOMEM ; + goto out; + } gb_len += miux_length; gb_len +=ARRAY_SIZE (llcp_magic);
net/sched/act_ipt.c +1 -2
@@ -199,8 +199,7 @@ static int __tcf_ipt_init(struct net *net, unsigned int id, struct nlattr *nla, err2:kfree (tname); err1: -if (ret ==ACT_P_CREATED ) -tcf_idr_release (*a, bind); +tcf_idr_release (*a, bind);return err; }
net/sched/act_skbedit.c +1 -2
@@ -189,8 +189,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla, params_new =kzalloc (sizeof (*params_new),GFP_KERNEL );if (unlikely (!params_new)) { -if (ret ==ACT_P_CREATED ) -tcf_idr_release (*a, bind); +tcf_idr_release (*a, bind);return -ENOMEM ; }
net/sched/act_tunnel_key.c +2 -1
@@ -377,7 +377,8 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,return ret; release_tun_meta: -dst_release (&metadata->dst); +if (metadata) +dst_release (&metadata->dst); err_out:if (exists)
net/sched/sch_generic.c +6 -7
@@ -68,7 +68,7 @@ static inline struct sk_buff *__skb_dequeue_bad_txq(struct Qdisc *q) skb =__skb_dequeue (&q->skb_bad_txq);if (qdisc_is_percpu_stats (q)) {qdisc_qstats_cpu_backlog_dec (q, skb); -qdisc_qstats_cpu_qlen_dec (q); +qdisc_qstats_atomic_qlen_dec (q); }else {qdisc_qstats_backlog_dec (q, skb); q->q.qlen--;
@@ -108,7 +108,7 @@ static inline void qdisc_enqueue_skb_bad_txq(struct Qdisc *q,if (qdisc_is_percpu_stats (q)) {qdisc_qstats_cpu_backlog_inc (q, skb); -qdisc_qstats_cpu_qlen_inc (q); +qdisc_qstats_atomic_qlen_inc (q); }else {qdisc_qstats_backlog_inc (q, skb); q->q.qlen++;
@@ -147,7 +147,7 @@ static inline int dev_requeue_skb_locked(struct sk_buff *skb, struct Qdisc *q)qdisc_qstats_cpu_requeues_inc (q);qdisc_qstats_cpu_backlog_inc (q, skb); -qdisc_qstats_cpu_qlen_inc (q); +qdisc_qstats_atomic_qlen_inc (q); skb = next; }
@@ -252,7 +252,7 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate, skb =__skb_dequeue (&q->gso_skb);if (qdisc_is_percpu_stats (q)) {qdisc_qstats_cpu_backlog_dec (q, skb); -qdisc_qstats_cpu_qlen_dec (q); +qdisc_qstats_atomic_qlen_dec (q); }else {qdisc_qstats_backlog_dec (q, skb); q->q.qlen--;
@@ -645,7 +645,7 @@ static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc,if (unlikely (err))return qdisc_drop_cpu (skb, qdisc, to_free); -qdisc_qstats_cpu_qlen_inc (qdisc); +qdisc_qstats_atomic_qlen_inc (qdisc);/* Note: skb can not be used after skb_array_produce(), * so we better not use qdisc_qstats_cpu_backlog_inc() */
@@ -670,7 +670,7 @@ static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc)if (likely (skb)) {qdisc_qstats_cpu_backlog_dec (qdisc, skb);qdisc_bstats_cpu_update (qdisc, skb); -qdisc_qstats_cpu_qlen_dec (qdisc); +qdisc_qstats_atomic_qlen_dec (qdisc); }return skb;
@@ -714,7 +714,6 @@ static void pfifo_fast_reset(struct Qdisc *qdisc)struct gnet_stats_queue *q =per_cpu_ptr (qdisc->cpu_qstats, i); q->backlog =0 ; - q->qlen =0 ; } }
net/sched/sch_netem.c +7 -3
@@ -430,6 +430,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch,int nb =0 ;int count =1 ;int rc =NET_XMIT_SUCCESS ; +int rc_drop =NET_XMIT_DROP ;/* Do not fool qdisc_drop_all() */ skb->prev =NULL ;
@@ -469,6 +470,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch, q->duplicate =0 ; rootq->enqueue (skb2, rootq, to_free); q->duplicate = dupsave; + rc_drop =NET_XMIT_SUCCESS ; }/*
@@ -481,7 +483,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch,if (skb_is_gso (skb)) { segs =netem_segment (skb, sch, to_free);if (!segs) -return NET_XMIT_DROP ; +return rc_drop; }else { segs = skb; }
@@ -504,8 +506,10 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch,1 <<(prandom_u32 () %8 ); } -if (unlikely (sch->q.qlen >= sch->limit)) -return qdisc_drop_all (skb, sch, to_free); +if (unlikely (sch->q.qlen >= sch->limit)) { +qdisc_drop_all (skb, sch, to_free); +return rc_drop; + }qdisc_qstats_backlog_inc (sch, skb);
net/sctp/socket.c +1 -0
@@ -1866,6 +1866,7 @@ static int sctp_sendmsg_check_sflags(struct sctp_association *asoc,pr_debug ("%s: aborting association:%p\n" , __func__, asoc);sctp_primitive_ABORT (net, asoc, chunk); +iov_iter_revert (&msg->msg_iter, msg_len);return 0 ; }
net/socket.c +1 -0
@@ -577,6 +577,7 @@ static void __sock_release(struct socket *sock, struct inode *inode)if (inode)inode_lock (inode); sock->ops->release (sock); + sock->sk =NULL ;if (inode)inode_unlock (inode); sock->ops =NULL ;
net/tipc/socket.c +6 -2
@@ -376,11 +376,13 @@ static int tipc_sk_sock_err(struct socket *sock, long *timeout)#define tipc_wait_for_cond (sock_, timeo_, condition_) \ ({ \ + DEFINE_WAIT_FUNC(wait_, woken_wake_function); \ struct sock *sk_; \ int rc_; \ \ while ((rc_ = !(condition_))) { \ - DEFINE_WAIT_FUNC(wait_, woken_wake_function); \ +/* coupled with smp_wmb() in tipc_sk_proto_rcv() */ \ +smp_rmb (); \ sk_ = (sock_)->sk; \ rc_ =tipc_sk_sock_err ((sock_), timeo_); \if (rc_) \
@@ -1320,7 +1322,7 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)if (unlikely (!dest)) { dest = &tsk->peer; -if (!syn || dest->family !=AF_TIPC ) +if (!syn && dest->family !=AF_TIPC )return -EDESTADDRREQ ; }
@@ -1968,6 +1970,8 @@ static void tipc_sk_proto_rcv(struct sock *sk,return ;case SOCK_WAKEUP :tipc_dest_del (&tsk->cong_links,msg_orignode (hdr),0 ); +/* coupled with smp_rmb() in tipc_wait_for_cond() */ +smp_wmb (); tsk->cong_link_cnt--; wakeup = true;break ;
tools/testing/selftests/firmware/fw_lib.sh +1 -1
@@ -91,7 +91,7 @@ verify_reqs() if [ "$TEST_REQS_FW_SYSFS_FALLBACK" = "yes" ]; then if [ ! "$HAS_FW_LOADER_USER_HELPER" = "yes" ]; then echo "usermode helper disabled so ignoring test" - exit $ksft_skip + exit 0 fi fi }