Linux 4.19.20
Greg KH
maintainerI'm announcing the release of the 4.19.20 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:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/mach-cns3xxx/pcie.c | 2 arch/arm64/kernel/hibernate.c | 4 arch/arm64/kernel/hyp-stub.S | 2 arch/arm64/kernel/kaslr.c | 1 arch/arm64/mm/flush.c | 6 drivers/gpio/gpio-altera-a10sr.c | 4 drivers/gpio/gpio-eic-sprd.c | 14 + drivers/gpio/gpio-pcf857x.c | 26 +-- drivers/gpio/gpiolib.c | 10 + drivers/gpu/drm/msm/msm_gpu.h | 2 drivers/infiniband/hw/hfi1/file_ops.c | 2 drivers/iommu/intel-iommu.c | 2 drivers/md/raid5-cache.c | 33 ++-- drivers/md/raid5.c | 8 - drivers/mmc/host/bcm2835.c | 2 drivers/mmc/host/mtk-sd.c | 2 drivers/mmc/host/sdhci-iproc.c | 5 drivers/net/ethernet/freescale/ucc_geth.c | 2 drivers/net/ethernet/mellanox/mlx4/fw.c | 75 +++++---- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 22 +- drivers/net/ethernet/renesas/ravb_main.c | 12 - drivers/net/ipvlan/ipvlan_main.c | 6 drivers/net/tun.c | 3 drivers/net/virtio_net.c | 169 +++++++++++++++------- drivers/of/device.c | 5 drivers/of/dynamic.c | 32 +++- drivers/of/kobj.c | 4 drivers/of/of_mdio.c | 12 - drivers/of/of_numa.c | 4 drivers/of/overlay.c | 117 ++++++++++----- drivers/of/platform.c | 8 - drivers/of/unittest.c | 12 - drivers/platform/x86/asus-nb-wmi.c | 3 drivers/vhost/net.c | 3 drivers/vhost/scsi.c | 2 drivers/vhost/vhost.c | 7 drivers/vhost/vhost.h | 4 drivers/vhost/vsock.c | 2 fs/btrfs/ctree.c | 78 ++++++---- fs/btrfs/super.c | 3 fs/cifs/connect.c | 53 ++++++ fs/cifs/smb2pdu.c | 50 ++++-- fs/dcache.c | 6 fs/gfs2/rgrp.c | 2 fs/nfs/write.c | 9 - include/linux/netdevice.h | 8 + include/linux/of.h | 15 + include/linux/sched/coredump.h | 1 include/net/l3mdev.h | 3 kernel/exit.c | 12 + mm/hugetlb.c | 3 mm/memory-failure.c | 3 mm/memory_hotplug.c | 36 ++-- mm/migrate.c | 7 mm/oom_kill.c | 12 + net/core/dev.c | 3 net/ipv4/gre_demux.c | 17 ++ net/ipv4/ip_fragment.c | 2 net/ipv4/ip_gre.c | 16 -- net/ipv6/af_inet6.c | 3 net/ipv6/ip6_gre.c | 11 - net/ipv6/ip6mr.c | 7 net/ipv6/seg6_iptunnel.c | 2 net/l2tp/l2tp_core.c | 9 - net/l2tp/l2tp_core.h | 20 ++ net/l2tp/l2tp_ip.c | 3 net/l2tp/l2tp_ip6.c | 3 net/netrom/nr_timer.c | 20 +- net/rose/rose_route.c | 5 net/sctp/ipv6.c | 3 net/sctp/protocol.c | 3 net/sctp/sm_make_chunk.c | 11 + net/sctp/stream.c | 58 +++---- sound/pci/hda/patch_realtek.c | 78 +++++----- sound/usb/quirks.c | 1 tools/testing/selftests/seccomp/seccomp_bpf.c | 72 +++++++-- 77 files changed, 857 insertions(+), 422 deletions(-)
Alexei Naberezhnov (1):
md/raid5: fix 'out of memory' during raid cache recovery
Andrea Arcangeli (1):
mm/hugetlb.c: teach follow_hugetlb_page() to handle FOLL_NOWAIT
Andreas Gruenbacher (1):
gfs2: Revert "Fix loop in gfs2_rbm_find"
Andrei Vagin (1):
kernel/exit.c: release ptraced tasks before zap_pid_ns_processes
Ard Biesheuvel (1):
arm64: kaslr: ensure randomized quantities are clean also when kaslr is off
Arnd Bergmann (1):
drm/msm/gpu: fix building without debugfs
Axel Lin (1):
gpio: altera-a10sr: Set proper output level for direction_output
Aya Levin (2):
net/mlx4_core: Add masking for a few queries on HCA caps net/mlx5e: Allow MAC invalidation while spoofchk is ON
Bartosz Golaszewski (1):
gpiolib: fix line event timestamps for nested irqs
Bernard Pidoux (1):
net/rose: fix NULL ax25_cb kernel panic
Bodong Wang (1):
Revert "net/mlx5e: E-Switch, Initialize eswitch only if eswitch manager"
Catalin Marinas (1):
arm64: Do not issue IPIs for user executable ptes
Chaotian Jing (1):
mmc: mediatek: fix incorrect register setting of hs400_cmd_int_delay
Cong Wang (1):
netrom: switch to sock timer API
Daniel Borkmann (1):
ipvlan, l3mdev: fix broken l3s mode wrt local routes
David Ahern (1):
ipv6: Consider sk_bound_dev_if when binding a socket to an address
David Hildenbrand (1):
mm: migrate: don't rely on __PageMovable() of newpage after unlocking it
Eric W. Biederman (1):
btrfs: On error always free subvol_name in btrfs_mount
Filipe Manana (1):
Btrfs: fix deadlock when allocating tree block during leaf/node split
Frank Rowand (4):
of: overlay: add tests to validate kfrees from overlay removal
of: overlay: add missing of_node_get() in __of_attach_node_sysfs
of: overlay: use prop add changeset entry for property in new nodes
of: overlay: do not duplicate properties from overlay for new nodes
George Amanakis (1):
tun: move the call to tun_set_real_num_queues
Gerald Schaefer (1):
iommu/vt-d: Fix memory leak in intel_iommu_put_resv_regions()
Greg Kroah-Hartman (2):
Fix "net: ipv4: do not handle duplicate fragments as overlapping" Linux 4.19.20
Jacob Wen (2):
l2tp: copy 4 more bytes to linear part if necessary
l2tp: fix reading optional fields of L2TPv3
James Morse (2):
arm64: hyp-stub: Forbid kprobing of the hyp-stub
arm64: hibernate: Clean the __hyp_text to PoC after resume
Jason Wang (1):
vhost: fix OOB in get_rx_bufs()
Josh Elsasser (1):
net: set default network namespace in init_dummy_netdev()
João Paulo Rechi Vita (2):
platform/x86: asus-nb-wmi: Map 0x35 to KEY_SCREENLOCK
platform/x86: asus-nb-wmi: Drop mapping of 0x33 and 0x34 scan codesKailang Yang (1):
ALSA: hda/realtek - Fixed hp_pin no value
Kees Cook (1):
selftests/seccomp: Enhance per-arch ptrace syscall skip tests
Koen Vandeputte (1):
ARM: cns3xxx: Fix writing to wrong PCI config registers after alignment
Lorenzo Bianconi (3):
net: ip_gre: always reports o_key to userspace
net: ip_gre: use erspan key field for tunnel lookup
net: ip6_gre: always reports o_key to userspace
Lukas Wunner (1):
mmc: bcm2835: Fix DMA channel leak on probe error
Mathias Thore (1):
ucc_geth: Reset BQL queue when stopping device
Michael J. Ruhl (1):
IB/hfi1: Remove overly conservative VM_EXEC flag check
Naoya Horiguchi (1):
mm: hwpoison: use do_send_sig_info() instead of force_sig()
Neo Hou (2):
gpio: sprd: Fix the incorrect data register
gpio: sprd: Fix incorrect irq type setting for the async EIC
Nir Dotan (1):
ip6mr: Fix notifiers call on mroute_clean_tables()
Olek Poplavsky (1):
ALSA: usb-audio: Add Opus #3 to quirks for native DSD support
Oscar Salvador (1):
mm,memory_hotplug: fix scan_movable_pages() for gigantic hugepages
Paulo Alcantara (1):
cifs: Always resolve hostname before reconnecting
Pavel Shilovsky (3):
CIFS: Do not count -ENODATA as failure for query directory
CIFS: Fix trace command logging for SMB2 reads and writes
CIFS: Do not consider -ENODATA as stat failure for reads
Rob Herring (1):
of: Convert to using %pOFn instead of device_node.name
Roger Quadros (1):
gpio: pcf857x: Fix interrupts on multiple instances
Shakeel Butt (1):
mm, oom: fix use-after-free in oom_kill_process
Simon Horman (1):
ravb: expand rx descriptor data to accommodate hw checksum
Stefan Wahren (1):
mmc: sdhci-iproc: handle mmc_of_parse() errors during probe
Tetsuo Handa (1):
oom, oom_reaper: do not enqueue same task twice
Toshiaki Makita (7):
virtio_net: Don't enable NAPI when interface is down
virtio_net: Don't call free_old_xmit_skbs for xdp_frames
virtio_net: Fix not restoring real_num_rx_queues
virtio_net: Fix out of bounds access of sq
virtio_net: Don't process redirected XDP frames when XDP is disabled
virtio_net: Use xdp_return_frame to free xdp_frames on destroying vqs
virtio_net: Differentiate sk_buff and xdp_frame on freeing
Trond Myklebust (1):
NFS: Fix up return value on fatal errors in nfs_page_async_flush()
Waiman Long (1):
fs/dcache: Fix incorrect nr_dentry_unused accounting in shrink_dcache_sb()
Xin Long (4):
sctp: improve the events for sctp stream reset
sctp: improve the events for sctp stream adding
sctp: set chunk transport correctly when it's a new asoc
sctp: set flow sport from saddr only when it's 0
Yohei Kanemaru (1):
ipv6: sr: clear IP6CB(skb) on SRH ip4ip6 encapsulation
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 19 -SUBLEVEL = 19 +SUBLEVEL = 20 EXTRAVERSION = NAME = "People's Front"
arch/arm/mach-cns3xxx/pcie.c +1 -1
@@ -83,7 +83,7 @@ static void __iomem *cns3xxx_pci_map_bus(struct pci_bus *bus, }else /* remote PCI bus */ base = cnspci->cfg1_regs + ((busno &0xf ) <<20 ); -return base + (where &0xffc ) + (devfn <<12 ); +return base + where + (devfn <<12 ); } static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
arch/arm64/kernel/hibernate.c +3 -1
@@ -299,8 +299,10 @@ int swsusp_arch_suspend(void)dcache_clean_range (__idmap_text_start, __idmap_text_end);/* Clean kvm setup code to PoC? */ -if (el2_reset_needed ()) +if (el2_reset_needed ()) {dcache_clean_range (__hyp_idmap_text_start, __hyp_idmap_text_end); +dcache_clean_range (__hyp_text_start, __hyp_text_end); + }/* make the crash dump kernel image protected again */ crash_post_resume ();
arch/arm64/kernel/hyp-stub.S +2 -0
@@ -28,6 +28,8 @@ #include <asm/virt.h> .text + .pushsection .hyp.text, "ax" + .align 11 ENTRY(__hyp_stub_vectors)
arch/arm64/kernel/kaslr.c +1 -0
@@ -88,6 +88,7 @@ u64 __init kaslr_early_init(u64 dt_phys)* we end up running with module randomization disabled. */ module_alloc_base = (u64 )_etext -MODULES_VSIZE ; +__flush_dcache_area (&module_alloc_base,sizeof (module_alloc_base));/* * Try to map the FDT early. If this fails, we simply bail,
arch/arm64/mm/flush.c +5 -1
@@ -33,7 +33,11 @@ void sync_icache_aliases(void *kaddr, unsigned long len)__clean_dcache_area_pou (kaddr, len);__flush_icache_all (); }else { -flush_icache_range (addr, addr + len); +/* +* Don't issue kick_all_cpus_sync() after I-cache invalidation +* for user mappings. +*/ +__flush_icache_range (addr, addr + len); } }
drivers/gpio/gpio-altera-a10sr.c +3 -1
@@ -66,8 +66,10 @@ static int altr_a10sr_gpio_direction_input(struct gpio_chip *gc,static int altr_a10sr_gpio_direction_output (struct gpio_chip *gc,unsigned int nr,int value) { -if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI -ALTR_A10SR_LED_VALID_SHIFT )) +if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI -ALTR_A10SR_LED_VALID_SHIFT )) { +altr_a10sr_gpio_set (gc, nr, value);return 0 ; + }return -EINVAL ; }
drivers/gpio/gpio-eic-sprd.c +13 -1
@@ -180,7 +180,18 @@ static void sprd_eic_free(struct gpio_chip *chip, unsigned int offset)static int sprd_eic_get (struct gpio_chip *chip,unsigned int offset) { -return sprd_eic_read (chip, offset,SPRD_EIC_DBNC_DATA ); +struct sprd_eic *sprd_eic =gpiochip_get_data (chip); + +switch (sprd_eic->type) { +case SPRD_EIC_DEBOUNCE : +return sprd_eic_read (chip, offset,SPRD_EIC_DBNC_DATA ); +case SPRD_EIC_ASYNC : +return sprd_eic_read (chip, offset,SPRD_EIC_ASYNC_DATA ); +case SPRD_EIC_SYNC : +return sprd_eic_read (chip, offset,SPRD_EIC_SYNC_DATA ); +default : +return -ENOTSUPP ; + } }static int sprd_eic_direction_input (struct gpio_chip *chip,unsigned int offset)
@@ -368,6 +379,7 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_EDGE_BOTH : +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;
drivers/gpio/gpio-pcf857x.c +12 -14
@@ -84,6 +84,7 @@ MODULE_DEVICE_TABLE(of, pcf857x_of_table);*/ struct pcf857x {struct gpio_chip chip; +struct irq_chip irqchip;struct i2c_client *client;struct mutex lock;/* protect 'out' */ unsigned out;/* software latch */
@@ -252,18 +253,6 @@ static void pcf857x_irq_bus_sync_unlock(struct irq_data *data)mutex_unlock (&gpio->lock); } -static struct irq_chip pcf857x_irq_chip = { - .name ="pcf857x" , - .irq_enable = pcf857x_irq_enable, - .irq_disable = pcf857x_irq_disable, - .irq_ack = noop, - .irq_mask = noop, - .irq_unmask = noop, - .irq_set_wake = pcf857x_irq_set_wake, - .irq_bus_lock = pcf857x_irq_bus_lock, - .irq_bus_sync_unlock = pcf857x_irq_bus_sync_unlock, -}; -/*-------------------------------------------------------------------------*/ static int pcf857x_probe(struct i2c_client *client,
@@ -376,8 +365,17 @@ static int pcf857x_probe(struct i2c_client *client,/* Enable irqchip if we have an interrupt */ if (client->irq) { + gpio->irqchip.name ="pcf857x" , + gpio->irqchip.irq_enable = pcf857x_irq_enable, + gpio->irqchip.irq_disable = pcf857x_irq_disable, + gpio->irqchip.irq_ack = noop, + gpio->irqchip.irq_mask = noop, + gpio->irqchip.irq_unmask = noop, + gpio->irqchip.irq_set_wake = pcf857x_irq_set_wake, + gpio->irqchip.irq_bus_lock = pcf857x_irq_bus_lock, + gpio->irqchip.irq_bus_sync_unlock = pcf857x_irq_bus_sync_unlock, status =gpiochip_irqchip_add_nested (&gpio->chip, - &pcf857x_irq_chip, + &gpio->irqchip,0 , handle_level_irq,IRQ_TYPE_NONE );if (status) {
@@ -392,7 +390,7 @@ static int pcf857x_probe(struct i2c_client *client,if (status) goto fail; -gpiochip_set_nested_irqchip (&gpio->chip, &pcf857x_irq_chip, +gpiochip_set_nested_irqchip (&gpio->chip, &gpio->irqchip, client->irq); gpio->irq_parent = client->irq; }
drivers/gpio/gpiolib.c +9 -1
@@ -817,7 +817,15 @@ static irqreturn_t lineevent_irq_thread(int irq, void *p)/* Do not leak kernel stack to userspace */ memset (&ge,0 ,sizeof (ge)); - ge.timestamp = le->timestamp; +/* +* We may be running from a nested threaded interrupt in which case +* we didn't get the timestamp from lineevent_irq_handler(). +*/ +if (!le->timestamp) + ge.timestamp =ktime_get_real_ns (); +else + ge.timestamp = le->timestamp; + level =gpiod_get_value_cansleep (le->desc); if (le->eflags & GPIOEVENT_REQUEST_RISING_EDGE
drivers/gpu/drm/msm/msm_gpu.h +1 -1
@@ -63,7 +63,7 @@ struct msm_gpu_funcs {struct msm_ringbuffer *(*active_ring)(struct msm_gpu *gpu);void (*recover)(struct msm_gpu *gpu);void (*destroy)(struct msm_gpu *gpu); -#ifdef CONFIG_DEBUG_FS +#if defined(CONFIG_DEBUG_FS ) || defined(CONFIG_DEV_COREDUMP )/* show GPU status in debugfs: */ void (*show)(struct msm_gpu *gpu,struct msm_gpu_state *state,struct drm_printer *p);
drivers/infiniband/hw/hfi1/file_ops.c +1 -1
@@ -488,7 +488,7 @@ static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma) vmf =1 ;break ;case STATUS : -if (flags & (unsigned long )(VM_WRITE |VM_EXEC )) { +if (flags &VM_WRITE ) { ret = -EPERM ; goto done; }
drivers/iommu/intel-iommu.c +1 -1
@@ -5230,7 +5230,7 @@ static void intel_iommu_put_resv_regions(struct device *dev,struct iommu_resv_region *entry, *next;list_for_each_entry_safe (entry, next, head, list) { -if (entry->type ==IOMMU_RESV_RESERVED ) +if (entry->type ==IOMMU_RESV_MSI )kfree (entry); } }
drivers/md/raid5-cache.c +22 -11
@@ -1935,12 +1935,14 @@ r5l_recovery_replay_one_stripe(struct r5conf *conf, }static struct stripe_head * -r5c_recovery_alloc_stripe (struct r5conf *conf, -sector_t stripe_sect) +r5c_recovery_alloc_stripe ( +struct r5conf *conf, +sector_t stripe_sect, +int noblock) {struct stripe_head *sh; - sh =raid5_get_active_stripe (conf, stripe_sect,0 ,1 ,0 ); + sh =raid5_get_active_stripe (conf, stripe_sect,0 , noblock,0 );if (!sh)return NULL ;/* no more stripe available */
@@ -2150,7 +2152,7 @@ r5c_recovery_analyze_meta_block(struct r5l_log *log, stripe_sect);if (!sh) { - sh =r5c_recovery_alloc_stripe (conf, stripe_sect); + sh =r5c_recovery_alloc_stripe (conf, stripe_sect,1 );/* * cannot get stripe from raid5_get_active_stripe * try replay some stripes
@@ -2159,20 +2161,29 @@ r5c_recovery_analyze_meta_block(struct r5l_log *log,r5c_recovery_replay_stripes ( cached_stripe_list, ctx); sh =r5c_recovery_alloc_stripe ( - conf, stripe_sect); + conf, stripe_sect,1 ); }if (!sh) { +int new_size = conf->min_nr_stripes *2 ;pr_debug ("md/raid:%s: Increasing stripe cache size to %d to recovery data on journal.\n" ,mdname (mddev), - conf->min_nr_stripes *2 ); -raid5_set_cache_size (mddev, - conf->min_nr_stripes *2 ); - sh =r5c_recovery_alloc_stripe (conf, - stripe_sect); + new_size); + ret =raid5_set_cache_size (mddev, new_size); +if (conf->min_nr_stripes <= new_size /2 ) { +pr_err ("md/raid:%s: Cannot increase cache size, ret=%d, new_size=%d, min_nr_stripes=%d, max_nr_stripes=%d\n" , +mdname (mddev), + ret, + new_size, + conf->min_nr_stripes, + conf->max_nr_stripes); +return -ENOMEM ; + } + sh =r5c_recovery_alloc_stripe ( + conf, stripe_sect,0 ); }if (!sh) {pr_err ("md/raid:%s: Cannot get enough stripes due to memory pressure. Recovery failed.\n" , -mdname (mddev)); +mdname (mddev));return -ENOMEM ; }list_add_tail (&sh->lru, cached_stripe_list);
drivers/md/raid5.c +6 -2
@@ -6357,6 +6357,7 @@ raid5_show_stripe_cache_size(struct mddev *mddev, char *page)int raid5_set_cache_size (struct mddev *mddev,int size) { +int result =0 ;struct r5conf *conf = mddev->private;if (size <=16 || size >32768 )
@@ -6373,11 +6374,14 @@ raid5_set_cache_size(struct mddev *mddev, int size)mutex_lock (&conf->cache_size_mutex);while (size > conf->max_nr_stripes) -if (!grow_one_stripe (conf,GFP_KERNEL )) +if (!grow_one_stripe (conf,GFP_KERNEL )) { + conf->min_nr_stripes = conf->max_nr_stripes; + result = -ENOMEM ;break ; + }mutex_unlock (&conf->cache_size_mutex); -return 0 ; +return result; }EXPORT_SYMBOL (raid5_set_cache_size);
drivers/mmc/host/bcm2835.c +2 -0
@@ -1427,6 +1427,8 @@ static int bcm2835_probe(struct platform_device *pdev) err:dev_dbg (dev,"%s -> err %d\n" , __func__, ret); +if (host->dma_chan_rxtx) +dma_release_channel (host->dma_chan_rxtx);mmc_free_host (mmc);return ret;
drivers/mmc/host/mtk-sd.c +1 -1
@@ -784,7 +784,7 @@ static void msdc_set_mclk(struct msdc_host *host, unsigned char timing, u32 hz)if (timing ==MMC_TIMING_MMC_HS400 && host->dev_comp->hs400_tune) -sdr_set_field (host->base +PAD_CMD_TUNE , +sdr_set_field (host->base + tune_reg,MSDC_PAD_TUNE_CMDRRDLY , host->hs400_cmd_int_delay);dev_dbg (host->dev,"sclk: %d, timing: %d\n" , host->sclk, timing);
drivers/mmc/host/sdhci-iproc.c +4 -1
@@ -279,7 +279,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev) iproc_host->data = iproc_data; -mmc_of_parse (host->mmc); + ret =mmc_of_parse (host->mmc); +if (ret) + goto err; +sdhci_get_of_property (pdev); host->mmc->caps |= iproc_host->data->mmc_caps;
drivers/net/ethernet/freescale/ucc_geth.c +2 -0
@@ -1888,6 +1888,8 @@ static void ucc_geth_free_tx(struct ucc_geth_private *ugeth)u16 i, j;u8 __iomem *bd; +netdev_reset_queue (ugeth->ndev); + ug_info = ugeth->ug_info; uf_info = &ug_info->uf_info;
drivers/net/ethernet/mellanox/mlx4/fw.c +46 -29
111 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +8 -14
@@ -1133,13 +1133,6 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw,int err =0 ;u8 *smac_v; -if (vport->info.spoofchk && !is_valid_ether_addr (vport->info.mac)) { -mlx5_core_warn (esw->dev, -"vport[%d] configure ingress rules failed, illegal mac with spoofchk\n" , - vport->vport); -return -EPERM ; - } -esw_vport_cleanup_ingress_rules (esw, vport);if (!vport->info.vlan && !vport->info.qos && !vport->info.spoofchk) {
@@ -1696,7 +1689,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)int vport_num;int err; -if (!MLX5_ESWITCH_MANAGER (dev)) +if (!MLX5_VPORT_MANAGER (dev))return 0 ; esw_info(dev,
@@ -1765,7 +1758,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)void mlx5_eswitch_cleanup (struct mlx5_eswitch *esw) { -if (!esw || !MLX5_ESWITCH_MANAGER (esw->dev)) +if (!esw || !MLX5_VPORT_MANAGER (esw->dev))return ;esw_info (esw->dev,"cleanup\n" );
@@ -1812,13 +1805,10 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,mutex_lock (&esw->state_lock); evport = &esw->vports[vport]; -if (evport->info.spoofchk && !is_valid_ether_addr (mac)) { +if (evport->info.spoofchk && !is_valid_ether_addr (mac))mlx5_core_warn (esw->dev, -"MAC invalidation is not allowed when spoofchk is on, vport(%d)\n" , +"Set invalid MAC while spoofchk is on, vport(%d)\n" , vport); - err = -EPERM ; - goto unlock; - } err =mlx5_modify_nic_vport_mac_address (esw->dev, vport, mac);if (err) {
@@ -1964,6 +1954,10 @@ int mlx5_eswitch_set_vport_spoofchk(struct mlx5_eswitch *esw, evport = &esw->vports[vport]; pschk = evport->info.spoofchk; evport->info.spoofchk = spoofchk; +if (pschk && !is_valid_ether_addr (evport->info.mac)) +mlx5_core_warn (esw->dev, +"Spoofchk in set while MAC is invalid, vport(%d)\n" , + evport->vport);if (evport->enabled && esw->mode ==SRIOV_LEGACY ) err =esw_vport_ingress_config (esw, evport);if (err)
drivers/net/ethernet/renesas/ravb_main.c +7 -5
@@ -344,7 +344,7 @@ static int ravb_ring_init(struct net_device *ndev, int q)int i; priv->rx_buf_sz = (ndev->mtu <=1492 ?PKT_BUF_SZ : ndev->mtu) + -ETH_HLEN +VLAN_HLEN ; +ETH_HLEN +VLAN_HLEN +sizeof (__sum16);/* Allocate RX and TX skb rings */ priv->rx_skb[q] = kcalloc(priv->num_rx_ring[q],
@@ -525,13 +525,15 @@ static void ravb_rx_csum(struct sk_buff *skb) {u8 *hw_csum; -/* The hardware checksum is 2 bytes appended to packet data */ -if (unlikely (skb->len <2 )) +/* The hardware checksum is contained in sizeof(__sum16) (2) bytes +* appended to packet data +*/ +if (unlikely (skb->len <sizeof (__sum16)))return ; - hw_csum =skb_tail_pointer (skb) -2 ; + hw_csum =skb_tail_pointer (skb) -sizeof (__sum16); skb->csum =csum_unfold ((__force __sum16 )get_unaligned_le16 (hw_csum)); skb->ip_summed =CHECKSUM_COMPLETE ; -skb_trim (skb, skb->len -2 ); +skb_trim (skb, skb->len -sizeof (__sum16)); }/* Packet receive function for Ethernet AVB */
drivers/net/ipvlan/ipvlan_main.c +3 -3
@@ -97,12 +97,12 @@ static int ipvlan_set_port_mode(struct ipvl_port *port, u16 nval) err =ipvlan_register_nf_hook (read_pnet (&port->pnet));if (!err) { mdev->l3mdev_ops = &ipvl_l3mdev_ops; - mdev->priv_flags |=IFF_L3MDEV_MASTER ; + mdev->priv_flags |=IFF_L3MDEV_RX_HANDLER ; }else goto fail; }else if (port->mode ==IPVLAN_MODE_L3S ) {/* Old mode was L3S */ - mdev->priv_flags &= ~IFF_L3MDEV_MASTER ; + mdev->priv_flags &= ~IFF_L3MDEV_RX_HANDLER ;ipvlan_unregister_nf_hook (read_pnet (&port->pnet)); mdev->l3mdev_ops =NULL ; }
@@ -162,7 +162,7 @@ static void ipvlan_port_destroy(struct net_device *dev)struct sk_buff *skb;if (port->mode ==IPVLAN_MODE_L3S ) { - dev->priv_flags &= ~IFF_L3MDEV_MASTER ; + dev->priv_flags &= ~IFF_L3MDEV_RX_HANDLER ;ipvlan_unregister_nf_hook (dev_net (dev)); dev->l3mdev_ops =NULL ; }
drivers/net/tun.c +1 -2
@@ -866,8 +866,6 @@ static int tun_attach(struct tun_struct *tun, struct file *file,tun_napi_init (tun, tfile, napi, napi_frags); } -tun_set_real_num_queues (tun); -/* device is allowed to go away first, so no need to hold extra * refcnt. */
@@ -879,6 +877,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file,rcu_assign_pointer (tfile->tun, tun);rcu_assign_pointer (tun->tfiles[tun->numqueues], tfile); tun->numqueues++; +tun_set_real_num_queues (tun); out:return err; }
drivers/net/virtio_net.c +117 -52
301 lines not on this page · raw message
drivers/of/device.c +3 -2
@@ -221,7 +221,8 @@ static ssize_t of_device_get_modalias(struct device *dev, char *str, ssize_t lenreturn -ENODEV ;/* Name & Type */ - csize =snprintf (str, len,"of:N%sT%s" , dev->of_node->name, +/* %p eats all alphanum characters, so %c must be used here */ + csize =snprintf (str, len,"of:N%pOFn%c%s" , dev->of_node,'T' , dev->of_node->type); tsize = csize; len -= csize;
@@ -300,7 +301,7 @@ void of_device_uevent(struct device *dev, struct kobj_uevent_env *env)if ((!dev) || (!dev->of_node))return ; -add_uevent_var (env,"OF_NAME=%s" , dev->of_node->name); +add_uevent_var (env,"OF_NAME=%pOFn" , dev->of_node);add_uevent_var (env,"OF_FULLNAME=%pOF" , dev->of_node);if (dev->of_node->type &&strcmp ("<NULL>" , dev->of_node->type) !=0 )add_uevent_var (env,"OF_TYPE=%s" , dev->of_node->type);
drivers/of/dynamic.c +29 -3
@@ -275,9 +275,6 @@ void __of_detach_node(struct device_node *np)/** * of_detach_node() - "Unplug" a node from the device tree. -* -* The caller must hold a reference to the node. The memory associated with -* the node is not freed until its refcount goes to zero. */ int of_detach_node (struct device_node *np) {
@@ -333,6 +330,25 @@ void of_node_release(struct kobject *kobj)if (!of_node_check_flag (node,OF_DYNAMIC ))return ; +if (of_node_check_flag (node,OF_OVERLAY )) { + +if (!of_node_check_flag (node,OF_OVERLAY_FREE_CSET )) { +/* premature refcount of zero, do not free memory */ +pr_err ("ERROR: memory leak before free overlay changeset, %pOF\n" , + node); +return ; + } + +/* +* If node->properties non-empty then properties were added +* to this node either by different overlay that has not +* yet been removed, or by a non-overlay mechanism. +*/ +if (node->properties) +pr_err ("ERROR: %s(), unexpected properties in %pOF\n" , + __func__, node); + } +property_list_free (node->properties);property_list_free (node->deadprops);
@@ -437,6 +453,16 @@ struct device_node *__of_node_dup(const struct device_node *np,static void __of_changeset_entry_destroy (struct of_changeset_entry *ce) { +if (ce->action ==OF_RECONFIG_ATTACH_NODE && +of_node_check_flag (ce->np,OF_OVERLAY )) { +if (kref_read (&ce->np->kobj.kref) >1 ) { +pr_err ("ERROR: memory leak, expected refcount 1 instead of %d, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node %pOF\n" , +kref_read (&ce->np->kobj.kref), ce->np); + }else { +of_node_set_flag (ce->np,OF_OVERLAY_FREE_CSET ); + } + } +of_node_put (ce->np);list_del (&ce->node);kfree (ce);
drivers/of/kobj.c +3 -1
@@ -133,6 +133,9 @@ int __of_attach_node_sysfs(struct device_node *np) }if (!name)return -ENOMEM ; + +of_node_get (np); + rc =kobject_add (&np->kobj, parent,"%s" , name);kfree (name);if (rc)
@@ -159,6 +162,5 @@ void __of_detach_node_sysfs(struct device_node *np)kobject_del (&np->kobj); } -/* finally remove the kobj_init ref */ of_node_put (np); }
drivers/of/of_mdio.c +6 -6
@@ -97,8 +97,8 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio,return rc; } -dev_dbg (&mdio->dev,"registered phy %s at address %i\n" , - child->name, addr); +dev_dbg (&mdio->dev,"registered phy %pOFn at address %i\n" , + child, addr);return 0 ; }
@@ -127,8 +127,8 @@ static int of_mdiobus_register_device(struct mii_bus *mdio,return rc; } -dev_dbg (&mdio->dev,"registered mdio device %s at address %i\n" , - child->name, addr); +dev_dbg (&mdio->dev,"registered mdio device %pOFn at address %i\n" , + child, addr);return 0 ; }
@@ -263,8 +263,8 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)continue ;/* be noisy to encourage people to set reg property */ -dev_info (&mdio->dev,"scan phy %s at address %i\n" , - child->name, addr); +dev_info (&mdio->dev,"scan phy %pOFn at address %i\n" , + child, addr);if (of_mdiobus_child_is_phy (child)) { rc =of_mdiobus_register_phy (mdio, child, addr);
drivers/of/of_numa.c +2 -2
@@ -168,8 +168,8 @@ int of_node_to_nid(struct device_node *device) np =of_get_next_parent (np); }if (np && r) -pr_warn ("Invalid \"numa-node-id\" property in node %s\n" , - np->name); +pr_warn ("Invalid \"numa-node-id\" property in node %pOFn\n" , + np);of_node_put (np);/*
drivers/of/overlay.c +77 -40
272 lines not on this page · raw message
drivers/of/platform.c +4 -4
@@ -91,8 +91,8 @@ static void of_device_make_bus_id(struct device *dev)*/ reg =of_get_property (node,"reg" ,NULL );if (reg && (addr =of_translate_address (node, reg)) !=OF_BAD_ADDR ) { -dev_set_name (dev,dev_name (dev) ?"%llx.%s:%s" :"%llx.%s" , - (unsigned long long )addr, node->name, +dev_set_name (dev,dev_name (dev) ?"%llx.%pOFn:%s" :"%llx.%pOFn" , + (unsigned long long )addr, node,dev_name (dev));return ; }
@@ -142,8 +142,8 @@ struct platform_device *of_device_alloc(struct device_node *np,WARN_ON (rc); }if (of_irq_to_resource_table (np, res, num_irq) != num_irq) -pr_debug ("not all legacy IRQ resources mapped for %s\n" , - np->name); +pr_debug ("not all legacy IRQ resources mapped for %pOFn\n" , + np); } dev->dev.of_node =of_node_get (np);
drivers/of/unittest.c +6 -6
@@ -212,8 +212,8 @@ static int __init of_unittest_check_node_linkage(struct device_node *np)for_each_child_of_node (np, child) {if (child->parent != np) { -pr_err ("Child node %s links to wrong parent %s\n" , - child->name, np->name); +pr_err ("Child node %pOFn links to wrong parent %pOFn\n" , + child, np); rc = -EINVAL ; goto put_child; }
@@ -1046,16 +1046,16 @@ static void __init of_unittest_platform_populate(void)for_each_child_of_node (np, child) {for_each_child_of_node (child, grandchild)unittest (of_find_device_by_node (grandchild), -"Could not create device for node '%s'\n" , - grandchild->name); +"Could not create device for node '%pOFn'\n" , + grandchild); }of_platform_depopulate (&test_bus->dev);for_each_child_of_node (np, child) {for_each_child_of_node (child, grandchild)unittest (!of_find_device_by_node (grandchild), -"device didn't get destroyed '%s'\n" , - grandchild->name); +"device didn't get destroyed '%pOFn'\n" , + grandchild); }platform_device_unregister (test_bus);
drivers/platform/x86/asus-nb-wmi.c +1 -2
@@ -442,8 +442,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x30, { KEY_VOLUMEUP } }, { KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, { KE_KEY, 0x32, { KEY_MUTE } }, - { KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */ - { KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */ + { KE_KEY, 0x35, { KEY_SCREENLOCK } }, { KE_KEY, 0x40, { KEY_PREVIOUSSONG } }, { KE_KEY, 0x41, { KEY_NEXTSONG } }, { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
drivers/vhost/net.c +2 -1
@@ -1114,7 +1114,8 @@ static int vhost_net_open(struct inode *inode, struct file *f) n->vqs[i].rx_ring =NULL ;vhost_net_buf_init (&n->vqs[i].rxq); } -vhost_dev_init (dev, vqs,VHOST_NET_VQ_MAX ); +vhost_dev_init (dev, vqs,VHOST_NET_VQ_MAX , +UIO_MAXIOV +VHOST_NET_BATCH );vhost_poll_init (n->poll +VHOST_NET_VQ_TX , handle_tx_net,EPOLLOUT , dev);vhost_poll_init (n->poll +VHOST_NET_VQ_RX , handle_rx_net,EPOLLIN , dev);
drivers/vhost/scsi.c +1 -1
@@ -1398,7 +1398,7 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) vqs[i] = &vs->vqs[i].vq; vs->vqs[i].vq.handle_kick = vhost_scsi_handle_kick; } -vhost_dev_init (&vs->dev, vqs,VHOST_SCSI_MAX_VQ ); +vhost_dev_init (&vs->dev, vqs,VHOST_SCSI_MAX_VQ ,UIO_MAXIOV );vhost_scsi_init_inflight (vs,NULL );
drivers/vhost/vhost.c +4 -3
@@ -390,9 +390,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) vq->indirect =kmalloc_array (UIO_MAXIOV ,sizeof (*vq->indirect),GFP_KERNEL ); - vq->log =kmalloc_array (UIO_MAXIOV ,sizeof (*vq->log), + vq->log =kmalloc_array (dev->iov_limit,sizeof (*vq->log),GFP_KERNEL ); - vq->heads =kmalloc_array (UIO_MAXIOV ,sizeof (*vq->heads), + vq->heads =kmalloc_array (dev->iov_limit,sizeof (*vq->heads),GFP_KERNEL );if (!vq->indirect || !vq->log || !vq->heads) goto err_nomem;
@@ -414,7 +414,7 @@ static void vhost_dev_free_iovecs(struct vhost_dev *dev) }void vhost_dev_init (struct vhost_dev *dev, -struct vhost_virtqueue **vqs,int nvqs) +struct vhost_virtqueue **vqs,int nvqs,int iov_limit) {struct vhost_virtqueue *vq;int i;
@@ -427,6 +427,7 @@ void vhost_dev_init(struct vhost_dev *dev, dev->iotlb =NULL ; dev->mm =NULL ; dev->worker =NULL ; + dev->iov_limit = iov_limit;init_llist_head (&dev->work_list);init_waitqueue_head (&dev->wait);INIT_LIST_HEAD (&dev->read_list);
drivers/vhost/vhost.h +3 -1
@@ -170,9 +170,11 @@ struct vhost_dev {struct list_head read_list;struct list_head pending_list;wait_queue_head_t wait; +int iov_limit; }; -void vhost_dev_init (struct vhost_dev *,struct vhost_virtqueue **vqs,int nvqs); +void vhost_dev_init (struct vhost_dev *,struct vhost_virtqueue **vqs, +int nvqs,int iov_limit);long vhost_dev_set_owner (struct vhost_dev *dev);bool vhost_dev_has_owner (struct vhost_dev *dev);long vhost_dev_check_owner (struct vhost_dev *);
drivers/vhost/vsock.c +1 -1
@@ -531,7 +531,7 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file) vsock->vqs[VSOCK_VQ_TX ].handle_kick = vhost_vsock_handle_tx_kick; vsock->vqs[VSOCK_VQ_RX ].handle_kick = vhost_vsock_handle_rx_kick; -vhost_dev_init (&vsock->dev, vqs,ARRAY_SIZE (vsock->vqs)); +vhost_dev_init (&vsock->dev, vqs,ARRAY_SIZE (vsock->vqs),UIO_MAXIOV ); file->private_data = vsock;spin_lock_init (&vsock->send_pkt_list_lock);
fs/btrfs/ctree.c +50 -28
108 lines not on this page · raw message
fs/btrfs/super.c +3 -0
@@ -1677,6 +1677,7 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags, flags | SB_RDONLY, device_name, data);if (IS_ERR (mnt_root)) { root =ERR_CAST (mnt_root); +kfree (subvol_name); goto out; }
@@ -1686,12 +1687,14 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,if (error <0 ) { root =ERR_PTR (error);mntput (mnt_root); +kfree (subvol_name); goto out; } } }if (IS_ERR (mnt_root)) { root =ERR_CAST (mnt_root); +kfree (subvol_name); goto out; }
fs/cifs/connect.c +53 -0
71 lines not on this page · raw message
fs/cifs/smb2pdu.c +32 -18
89 lines not on this page · raw message
fs/dcache.c +1 -5
@@ -1202,15 +1202,11 @@ static enum lru_status dentry_lru_isolate_shrink(struct list_head *item,*/ void shrink_dcache_sb (struct super_block *sb) { -long freed; -do {LIST_HEAD (dispose); - freed =list_lru_walk (&sb->s_dentry_lru, +list_lru_walk (&sb->s_dentry_lru, dentry_lru_isolate_shrink, &dispose,1024 ); - -this_cpu_sub (nr_dentry_unused, freed);shrink_dentry_list (&dispose); }while (list_lru_count (&sb->s_dentry_lru) >0 ); }
fs/gfs2/rgrp.c +1 -1
@@ -1747,9 +1747,9 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext, goto next_iter; }if (ret == -E2BIG ) { - n += rbm->bii - initial_bii; rbm->bii =0 ; rbm->offset =0 ; + n += (rbm->bii - initial_bii); goto res_covered_end_of_rgrp; }return ret;
fs/nfs/write.c +5 -4
@@ -621,11 +621,12 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,nfs_set_page_writeback (page);WARN_ON_ONCE (test_bit (PG_CLEAN , &req->wb_flags)); - ret =0 ; + ret = req->wb_context->error;/* If there is a fatal error that covers this write, just exit */ -if (nfs_error_is_fatal_on_server (req->wb_context->error)) +if (nfs_error_is_fatal_on_server (ret)) goto out_launder; + ret =0 ;if (!nfs_pageio_add_request (pgio, req)) { ret = pgio->pg_error;/*
@@ -635,9 +636,9 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,nfs_context_set_write_error (req->wb_context, ret);if (nfs_error_is_fatal_on_server (ret)) goto out_launder; - } + }else + ret = -EAGAIN ;nfs_redirty_request (req); - ret = -EAGAIN ; }else nfs_add_stats (page_file_mapping (page)->host,NFSIOS_WRITEPAGES ,1 );
include/linux/netdevice.h +8 -0
@@ -1455,6 +1455,7 @@ struct net_device_ops {* @IFF_NO_RX_HANDLER: device doesn't support the rx_handler hook * @IFF_FAILOVER: device is a failover master device * @IFF_FAILOVER_SLAVE: device is lower dev of a failover master device +* @IFF_L3MDEV_RX_HANDLER: only invoke the rx handler of L3 master device */ enum netdev_priv_flags {IFF_802_1Q_VLAN =1 <<0 ,
@@ -1486,6 +1487,7 @@ enum netdev_priv_flags {IFF_NO_RX_HANDLER =1 <<26 ,IFF_FAILOVER =1 <<27 ,IFF_FAILOVER_SLAVE =1 <<28 , + IFF_L3MDEV_RX_HANDLER = 1<<29, };#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -1516,6 +1518,7 @@ enum netdev_priv_flags {#define IFF_NO_RX_HANDLER IFF_NO_RX_HANDLER#define IFF_FAILOVER IFF_FAILOVER#define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE +#define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER/** * struct net_device - The DEVICE structure.
@@ -4464,6 +4467,11 @@ static inline bool netif_supports_nofcs(struct net_device *dev)return dev->priv_flags &IFF_SUPP_NOFCS ; } +static inline bool netif_has_l3_rx_handler (const struct net_device *dev) +{ +return dev->priv_flags &IFF_L3MDEV_RX_HANDLER ; +} +static inline bool netif_is_l3_master (const struct net_device *dev) {return dev->priv_flags &IFF_L3MDEV_MASTER ;
include/linux/of.h +10 -5
@@ -138,11 +138,16 @@ extern struct device_node *of_aliases;extern struct device_node *of_stdout;extern raw_spinlock_t devtree_lock; -/* flag descriptions (need to be visible even when !CONFIG_OF) */ -#define OF_DYNAMIC 1/* node and properties were allocated via kmalloc */ -#define OF_DETACHED 2/* node has been detached from the device tree */ -#define OF_POPULATED 3/* device already created for the node */ -#define OF_POPULATED_BUS 4/* of_platform_populate recursed to children of this node */ +/* +* struct device_node flag descriptions +* (need to be visible even when !CONFIG_OF) +*/ +#define OF_DYNAMIC 1/* (and properties) allocated via kmalloc */ +#define OF_DETACHED 2/* detached from the device tree */ +#define OF_POPULATED 3/* device already created */ +#define OF_POPULATED_BUS 4/* platform bus created for children */ +#define OF_OVERLAY 5/* allocated for an overlay */ +#define OF_OVERLAY_FREE_CSET 6/* in overlay cset being freed */ #define OF_BAD_ADDR ((u64)-1)
include/linux/sched/coredump.h +1 -0
@@ -71,6 +71,7 @@ static inline int get_dumpable(struct mm_struct *mm)#define MMF_HUGE_ZERO_PAGE 23/* mm has ever used the global huge zero page */ #define MMF_DISABLE_THP 24/* disable THP for all VMAs */ #define MMF_OOM_VICTIM 25/* mm is the oom victim */ +#define MMF_OOM_REAP_QUEUED 26/* mm was queued for oom_reaper */ #define MMF_DISABLE_THP_MASK (1 << MMF_DISABLE_THP)#define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\
include/net/l3mdev.h +2 -1
@@ -142,7 +142,8 @@ struct sk_buff *l3mdev_l3_rcv(struct sk_buff *skb, u16 proto)if (netif_is_l3_slave (skb->dev)) master =netdev_master_upper_dev_get_rcu (skb->dev); -else if (netif_is_l3_master (skb->dev)) +else if (netif_is_l3_master (skb->dev) || +netif_has_l3_rx_handler (skb->dev)) master = skb->dev;if (master && master->l3mdev_ops->l3mdev_l3_rcv)
kernel/exit.c +10 -2
@@ -558,12 +558,14 @@ static struct task_struct *find_alive_thread(struct task_struct *p)return NULL ; } -static struct task_struct *find_child_reaper (struct task_struct *father) +static struct task_struct *find_child_reaper (struct task_struct *father, +struct list_head *dead) __releases(&tasklist_lock) __acquires(&tasklist_lock) {struct pid_namespace *pid_ns =task_active_pid_ns (father);struct task_struct *reaper = pid_ns->child_reaper; +struct task_struct *p, *n;if (likely (reaper != father))return reaper;
@@ -579,6 +581,12 @@ static struct task_struct *find_child_reaper(struct task_struct *father)panic ("Attempted to kill init! exitcode=0x%08x\n" , father->signal->group_exit_code ?: father->exit_code); } + +list_for_each_entry_safe (p, n, dead, ptrace_entry) { +list_del_init (&p->ptrace_entry); +release_task (p); + } +zap_pid_ns_processes (pid_ns);write_lock_irq (&tasklist_lock);
@@ -668,7 +676,7 @@ static void forget_original_parent(struct task_struct *father,exit_ptrace (father, dead);/* Can drop and reacquire tasklist_lock */ - reaper =find_child_reaper (father); + reaper =find_child_reaper (father, dead);if (list_empty (&father->children))return ;
mm/hugetlb.c +2 -1
@@ -4269,7 +4269,8 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,break ; }if (ret &VM_FAULT_RETRY ) { -if (nonblocking) +if (nonblocking && + !(fault_flags &FAULT_FLAG_RETRY_NOWAIT )) *nonblocking =0 ; *nr_pages =0 ;/*
mm/memory-failure.c +2 -1
@@ -372,7 +372,8 @@ static void kill_procs(struct list_head *to_kill, int forcekill, bool fail,if (fail || tk->addr_valid ==0 ) {pr_err ("Memory failure: %#lx: forcibly killing %s:%d because of failure to unmap corrupted page\n" , pfn, tk->tsk->comm, tk->tsk->pid); -force_sig (SIGKILL , tk->tsk); +do_send_sig_info (SIGKILL ,SEND_SIG_PRIV , + tk->tsk,PIDTYPE_PID ); }/*
mm/memory_hotplug.c +20 -16
@@ -1326,23 +1326,27 @@ int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn,static unsigned long scan_movable_pages (unsigned long start,unsigned long end) {unsigned long pfn; -struct page *page; +for (pfn = start; pfn < end; pfn++) { -if (pfn_valid (pfn)) { - page =pfn_to_page (pfn); -if (PageLRU (page)) -return pfn; -if (__PageMovable (page)) -return pfn; -if (PageHuge (page)) { -if (hugepage_migration_supported (page_hstate (page)) && -page_huge_active (page)) -return pfn; -else - pfn =round_up (pfn +1 , -1 <<compound_order (page)) -1 ; - } - } +struct page *page, *head; +unsigned long skip; + +if (!pfn_valid (pfn)) +continue ; + page =pfn_to_page (pfn); +if (PageLRU (page)) +return pfn; +if (__PageMovable (page)) +return pfn; + +if (!PageHuge (page)) +continue ; + head =compound_head (page); +if (hugepage_migration_supported (page_hstate (head)) && +page_huge_active (head)) +return pfn; + skip = (1 <<compound_order (head)) - (page - head); + pfn += skip -1 ; }return 0 ; }
mm/migrate.c +5 -2
@@ -1118,10 +1118,13 @@ static int __unmap_and_move(struct page *page, struct page *newpage,* If migration is successful, decrease refcount of the newpage * which will not free the page because new page owner increased * refcounter. As well, if it is LRU page, add the page to LRU -* list in here. +* list in here. Use the old state of the isolated source page to +* determine if we migrated a LRU page. newpage was already unlocked +* and possibly modified by its owner - don't rely on the page +* state. */ if (rc ==MIGRATEPAGE_SUCCESS ) { -if (unlikely (__PageMovable (newpage))) +if (unlikely (!is_lru))put_page (newpage);else putback_lru_page (newpage);
mm/oom_kill.c +10 -2
@@ -634,8 +634,8 @@ static int oom_reaper(void *unused)static void wake_oom_reaper (struct task_struct *tsk) { -/* tsk is already queued? */ -if (tsk == oom_reaper_list || tsk->oom_reaper_list) +/* mm is already queued? */ +if (test_and_set_bit (MMF_OOM_REAP_QUEUED , &tsk->signal->oom_mm->flags))return ;get_task_struct (tsk);
@@ -962,6 +962,13 @@ static void oom_kill_process(struct oom_control *oc, const char *message)* still freeing memory. */ read_lock (&tasklist_lock); + +/* +* The task 'p' might have already exited before reaching here. The +* put_task_struct() will free task_struct 'p' while the loop still try +* to access the field of 'p', so, get an extra reference. +*/ +get_task_struct (p);for_each_thread (p, t) {list_for_each_entry (child, &t->children, sibling) {unsigned int child_points;
@@ -981,6 +988,7 @@ static void oom_kill_process(struct oom_control *oc, const char *message) } } } +put_task_struct (p);read_unlock (&tasklist_lock);/*
net/core/dev.c +3 -0
@@ -8599,6 +8599,9 @@ int init_dummy_netdev(struct net_device *dev)set_bit (__LINK_STATE_PRESENT, &dev->state);set_bit (__LINK_STATE_START, &dev->state); +/* napi_busy_loop stats accounting wants this */ +dev_net_set (dev, &init_net); +/* Note : We dont allocate pcpu_refcnt for dummy devices, * because users of this 'device' dont need to change * its refcount.
net/ipv4/gre_demux.c +17 -0
@@ -25,6 +25,7 @@#include <linux/spinlock.h> #include <net/protocol.h> #include <net/gre.h> +#include <net/erspan.h> #include <net/icmp.h> #include <net/route.h>
@@ -118,6 +119,22 @@ int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi, hdr_len +=4 ; } tpi->hdr_len = hdr_len; + +/* ERSPAN ver 1 and 2 protocol sets GRE key field +* to 0 and sets the configured key in the +* inner erspan header field +*/ +if (greh->protocol ==htons (ETH_P_ERSPAN ) || + greh->protocol ==htons (ETH_P_ERSPAN2 )) { +struct erspan_base_hdr *ershdr; + +if (!pskb_may_pull (skb, nhs + hdr_len +sizeof (*ershdr))) +return -EINVAL ; + + ershdr = (struct erspan_base_hdr *)options; + tpi->key =cpu_to_be32 (get_session_id (ershdr)); + } +return hdr_len; }EXPORT_SYMBOL (gre_parse_header);
net/ipv4/ip_fragment.c +1 -1
@@ -425,6 +425,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)* fragment. */ + err = -EINVAL ;/* Find out where to put this fragment. */ prev_tail = qp->q.fragments_tail;if (!prev_tail)
@@ -501,7 +502,6 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) discard_qp:inet_frag_kill (&qp->q); - err = -EINVAL ;__IP_INC_STATS (net,IPSTATS_MIB_REASM_OVERLAPS ); err:kfree_skb (skb);
net/ipv4/ip_gre.c +6 -10
@@ -269,20 +269,11 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,int len; itn =net_generic (net, erspan_net_id); - len = gre_hdr_len +sizeof (*ershdr); - -/* Check based hdr len */ -if (unlikely (!pskb_may_pull (skb, len))) -return PACKET_REJECT ; iph =ip_hdr (skb); ershdr = (struct erspan_base_hdr *)(skb->data + gre_hdr_len); ver = ershdr->ver; -/* The original GRE header does not have key field, -* Use ERSPAN 10-bit session ID as key. -*/ - tpi->key =cpu_to_be32 (get_session_id (ershdr)); tunnel =ip_tunnel_lookup (itn, skb->dev->ifindex, tpi->flags |TUNNEL_KEY , iph->saddr, iph->daddr, tpi->key);
@@ -1471,12 +1462,17 @@ static int ipgre_fill_info(struct sk_buff *skb, const struct net_device *dev) {struct ip_tunnel *t =netdev_priv (dev);struct ip_tunnel_parm *p = &t->parms; +__be16 o_flags = p->o_flags; + +if ((t->erspan_ver ==1 || t->erspan_ver ==2 ) && + !t->collect_md) + o_flags |=TUNNEL_KEY ; if (nla_put_u32(skb, IFLA_GRE_LINK, p->link) || nla_put_be16(skb, IFLA_GRE_IFLAGS, gre_tnl_flags_to_gre_flags(p->i_flags)) || nla_put_be16(skb, IFLA_GRE_OFLAGS, - gre_tnl_flags_to_gre_flags(p->o_flags)) || + gre_tnl_flags_to_gre_flags(o_flags)) || nla_put_be32(skb, IFLA_GRE_IKEY, p->i_key) || nla_put_be32(skb, IFLA_GRE_OKEY, p->o_key) || nla_put_in_addr(skb, IFLA_GRE_LOCAL, p->iph.saddr) ||
net/ipv6/af_inet6.c +3 -0
@@ -361,6 +361,9 @@ static int __inet6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len, err = -EINVAL ; goto out_unlock; } + } + +if (sk->sk_bound_dev_if) { dev =dev_get_by_index_rcu (net, sk->sk_bound_dev_if);if (!dev) { err = -ENODEV ;
net/ipv6/ip6_gre.c +6 -5
@@ -550,13 +550,9 @@ static int ip6erspan_rcv(struct sk_buff *skb, int gre_hdr_len,struct ip6_tnl *tunnel;u8 ver; -if (unlikely (!pskb_may_pull (skb,sizeof (*ershdr)))) -return PACKET_REJECT ; - ipv6h =ipv6_hdr (skb); ershdr = (struct erspan_base_hdr *)skb->data; ver = ershdr->ver; - tpi->key =cpu_to_be32 (get_session_id (ershdr)); tunnel = ip6gre_tunnel_lookup(skb->dev, &ipv6h->saddr, &ipv6h->daddr, tpi->key,
@@ -2124,12 +2120,17 @@ static int ip6gre_fill_info(struct sk_buff *skb, const struct net_device *dev) {struct ip6_tnl *t =netdev_priv (dev);struct __ip6_tnl_parm *p = &t->parms; +__be16 o_flags = p->o_flags; + +if ((p->erspan_ver ==1 || p->erspan_ver ==2 ) && + !p->collect_md) + o_flags |=TUNNEL_KEY ; if (nla_put_u32(skb, IFLA_GRE_LINK, p->link) || nla_put_be16(skb, IFLA_GRE_IFLAGS, gre_tnl_flags_to_gre_flags(p->i_flags)) || nla_put_be16(skb, IFLA_GRE_OFLAGS, - gre_tnl_flags_to_gre_flags(p->o_flags)) || + gre_tnl_flags_to_gre_flags(o_flags)) || nla_put_be32(skb, IFLA_GRE_IKEY, p->i_key) || nla_put_be32(skb, IFLA_GRE_OKEY, p->o_key) || nla_put_in6_addr(skb, IFLA_GRE_LOCAL, &p->laddr) ||
net/ipv6/ip6mr.c +3 -4
@@ -1506,6 +1506,9 @@ static void mroute_clean_tables(struct mr_table *mrt, bool all)continue ;rhltable_remove (&mrt->mfc_hash, &c->mnode, ip6mr_rht_params);list_del_rcu (&c->list); +call_ip6mr_mfc_entry_notifiers (read_pnet (&mrt->net), +FIB_EVENT_ENTRY_DEL , + (struct mfc6_cache *)c, mrt->id);mr6_netlink_event (mrt, (struct mfc6_cache *)c,RTM_DELROUTE );mr_cache_put (c); }
@@ -1514,10 +1517,6 @@ static void mroute_clean_tables(struct mr_table *mrt, bool all)spin_lock_bh (&mfc_unres_lock);list_for_each_entry_safe (c, tmp, &mrt->mfc_unres_queue, list) {list_del (&c->list); -call_ip6mr_mfc_entry_notifiers (read_pnet (&mrt->net), -FIB_EVENT_ENTRY_DEL , - (struct mfc6_cache *)c, - mrt->id);mr6_netlink_event (mrt, (struct mfc6_cache *)c,RTM_DELROUTE );ip6mr_destroy_unres (mrt, (struct mfc6_cache *)c);
net/ipv6/seg6_iptunnel.c +2 -0
@@ -146,6 +146,8 @@ int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh, int proto) }else {ip6_flow_hdr (hdr,0 , flowlabel); hdr->hop_limit =ip6_dst_hoplimit (skb_dst (skb)); + +memset (IP6CB (skb),0 ,sizeof (*IP6CB (skb))); } hdr->nexthdr =NEXTHDR_ROUTING ;
net/l2tp/l2tp_core.c +6 -3
@@ -83,8 +83,7 @@#define L2TP_SLFLAG_S 0x40000000#define L2TP_SL_SEQ_MASK 0x00ffffff -#define L2TP_HDR_SIZE_SEQ 10 -#define L2TP_HDR_SIZE_NOSEQ 6 +#define L2TP_HDR_SIZE_MAX 14/* Default trace flags */ #define L2TP_DEFAULT_DEBUG_FLAGS 0
@@ -808,7 +807,7 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb)__skb_pull (skb,sizeof (struct udphdr ));/* Short packet? */ -if (!pskb_may_pull (skb,L2TP_HDR_SIZE_SEQ )) { +if (!pskb_may_pull (skb,L2TP_HDR_SIZE_MAX )) {l2tp_info (tunnel,L2TP_MSG_DATA ,"%s: recv short packet (len=%d)\n" , tunnel->name, skb->len);
@@ -884,6 +883,10 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb) goto error; } +if (tunnel->version ==L2TP_HDR_VER_3 && +l2tp_v3_ensure_opt_in_linear (session, skb, &ptr, &optr)) + goto error; +l2tp_recv_common (session, skb, ptr, optr, hdrflags, length);l2tp_session_dec_refcount (session);
net/l2tp/l2tp_core.h +20 -0
@@ -301,6 +301,26 @@ static inline bool l2tp_tunnel_uses_xfrm(const struct l2tp_tunnel *tunnel) }#endif +static inline int l2tp_v3_ensure_opt_in_linear (struct l2tp_session *session,struct sk_buff *skb, +unsigned char **ptr,unsigned char **optr) +{ +int opt_len = session->peer_cookie_len +l2tp_get_l2specific_len (session); + +if (opt_len >0 ) { +int off = *ptr - *optr; + +if (!pskb_may_pull (skb, off + opt_len)) +return -1 ; + +if (skb->data != *optr) { + *optr = skb->data; + *ptr = skb->data + off; + } + } + +return 0 ; +} +#define l2tp_printk (ptr, type, func, fmt, ...) \ do { \ if (((ptr)->debug) & (type)) \
net/l2tp/l2tp_ip.c +3 -0
@@ -165,6 +165,9 @@ static int l2tp_ip_recv(struct sk_buff *skb)print_hex_dump_bytes ("" ,DUMP_PREFIX_OFFSET , ptr, length); } +if (l2tp_v3_ensure_opt_in_linear (session, skb, &ptr, &optr)) + goto discard_sess; +l2tp_recv_common (session, skb, ptr, optr,0 , skb->len);l2tp_session_dec_refcount (session);
net/l2tp/l2tp_ip6.c +3 -0
@@ -178,6 +178,9 @@ static int l2tp_ip6_recv(struct sk_buff *skb)print_hex_dump_bytes ("" ,DUMP_PREFIX_OFFSET , ptr, length); } +if (l2tp_v3_ensure_opt_in_linear (session, skb, &ptr, &optr)) + goto discard_sess; +l2tp_recv_common (session, skb, ptr, optr,0 , skb->len);l2tp_session_dec_refcount (session);
net/netrom/nr_timer.c +10 -10
@@ -52,21 +52,21 @@ void nr_start_t1timer(struct sock *sk) {struct nr_sock *nr =nr_sk (sk); -mod_timer (&nr->t1timer, jiffies + nr->t1); +sk_reset_timer (sk, &nr->t1timer, jiffies + nr->t1); }void nr_start_t2timer (struct sock *sk) {struct nr_sock *nr =nr_sk (sk); -mod_timer (&nr->t2timer, jiffies + nr->t2); +sk_reset_timer (sk, &nr->t2timer, jiffies + nr->t2); }void nr_start_t4timer (struct sock *sk) {struct nr_sock *nr =nr_sk (sk); -mod_timer (&nr->t4timer, jiffies + nr->t4); +sk_reset_timer (sk, &nr->t4timer, jiffies + nr->t4); }void nr_start_idletimer (struct sock *sk)
@@ -74,37 +74,37 @@ void nr_start_idletimer(struct sock *sk)struct nr_sock *nr =nr_sk (sk);if (nr->idle >0 ) -mod_timer (&nr->idletimer, jiffies + nr->idle); +sk_reset_timer (sk, &nr->idletimer, jiffies + nr->idle); }void nr_start_heartbeat (struct sock *sk) { -mod_timer (&sk->sk_timer, jiffies +5 *HZ ); +sk_reset_timer (sk, &sk->sk_timer, jiffies +5 *HZ ); }void nr_stop_t1timer (struct sock *sk) { -del_timer (&nr_sk (sk)->t1timer); +sk_stop_timer (sk, &nr_sk (sk)->t1timer); }void nr_stop_t2timer (struct sock *sk) { -del_timer (&nr_sk (sk)->t2timer); +sk_stop_timer (sk, &nr_sk (sk)->t2timer); }void nr_stop_t4timer (struct sock *sk) { -del_timer (&nr_sk (sk)->t4timer); +sk_stop_timer (sk, &nr_sk (sk)->t4timer); }void nr_stop_idletimer (struct sock *sk) { -del_timer (&nr_sk (sk)->idletimer); +sk_stop_timer (sk, &nr_sk (sk)->idletimer); }void nr_stop_heartbeat (struct sock *sk) { -del_timer (&sk->sk_timer); +sk_stop_timer (sk, &sk->sk_timer); }int nr_t1timer_running (struct sock *sk)
net/rose/rose_route.c +5 -0
@@ -850,6 +850,7 @@ void rose_link_device_down(struct net_device *dev)/* * Route a frame to an appropriate AX.25 connection. +* A NULL ax25_cb indicates an internally generated frame. */ int rose_route_frame (struct sk_buff *skb,ax25_cb *ax25) {
@@ -867,6 +868,10 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)if (skb->len <ROSE_MIN_LEN )return res; + +if (!ax25) +return rose_loopback_queue (skb,NULL ); + frametype = skb->data[2 ]; lci = ((skb->data[0 ] <<8 ) &0xF00 ) + ((skb->data[1 ] <<0 ) &0x0FF ); if (frametype == ROSE_CALL_REQUEST &&
net/sctp/ipv6.c +2 -1
@@ -277,7 +277,8 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,if (saddr) { fl6->saddr = saddr->v6.sin6_addr; - fl6->fl6_sport = saddr->v6.sin6_port; +if (!fl6->fl6_sport) + fl6->fl6_sport = saddr->v6.sin6_port;pr_debug ("src=%pI6 - " , &fl6->saddr); }
net/sctp/protocol.c +2 -1
@@ -440,7 +440,8 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr, }if (saddr) { fl4->saddr = saddr->v4.sin_addr.s_addr; - fl4->fl4_sport = saddr->v4.sin_port; +if (!fl4->fl4_sport) + fl4->fl4_sport = saddr->v4.sin_port; } pr_debug("%s: dst:%pI4, src:%pI4 - ", __func__, &fl4->daddr,
net/sctp/sm_make_chunk.c +8 -3
@@ -495,7 +495,10 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,* * [INIT ACK back to where the INIT came from.] */ - retval->transport = chunk->transport; +if (chunk->transport) + retval->transport = +sctp_assoc_lookup_paddr (asoc, + &chunk->transport->ipaddr); retval->subh.init_hdr =sctp_addto_chunk (retval,sizeof (initack), &initack);
@@ -642,8 +645,10 @@ struct sctp_chunk *sctp_make_cookie_ack(const struct sctp_association *asoc,* * [COOKIE ACK back to where the COOKIE ECHO came from.] */ -if (retval && chunk) - retval->transport = chunk->transport; +if (retval && chunk && chunk->transport) + retval->transport = +sctp_assoc_lookup_paddr (asoc, + &chunk->transport->ipaddr);return retval; }
net/sctp/stream.c +25 -33
126 lines not on this page · raw message
sound/pci/hda/patch_realtek.c +45 -33
108 lines not on this page · raw message
sound/usb/quirks.c +1 -0
@@ -1373,6 +1373,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,return SNDRV_PCM_FMTBIT_DSD_U32_BE ;break ; +case USB_ID (0x10cb ,0x0103 ):/* The Bit Opus #3; with fp->dsd_raw */ case USB_ID (0x152a ,0x85de ):/* SMSL D1 DAC */ case USB_ID (0x16d0 ,0x09dd ):/* Encore mDSD */ case USB_ID (0x0d8c ,0x0316 ):/* Hegel HD12 DSD */
tools/testing/selftests/seccomp/seccomp_bpf.c +57 -15
139 lines not on this page · raw message