Linux 4.19.314
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.19.314 kernel.
All users of the 4.19 kernel series must upgrade.
The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/s390/mm/gmap.c | 2 arch/s390/mm/hugetlbpage.c | 2 drivers/ata/sata_gemini.c | 5 - drivers/firewire/nosy.c | 6 - drivers/firewire/ohci.c | 6 + drivers/gpio/gpio-crystalcove.c | 2 drivers/gpio/gpio-wcove.c | 2 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 100 +++++++++++++---------- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 2 drivers/net/dsa/mv88e6xxx/chip.c | 29 ++++++ drivers/net/dsa/mv88e6xxx/chip.h | 6 + drivers/net/ethernet/broadcom/genet/bcmgenet.c | 16 ++- drivers/net/ethernet/brocade/bna/bnad_debugfs.c | 4 drivers/net/usb/qmi_wwan.c | 1 drivers/pinctrl/core.c | 8 - drivers/pinctrl/devicetree.c | 10 +- drivers/power/supply/rt9455_charger.c | 2 drivers/scsi/bnx2fc/bnx2fc_tgt.c | 2 drivers/scsi/lpfc/lpfc.h | 1 drivers/scsi/lpfc/lpfc_scsi.c | 13 -- drivers/target/target_core_configfs.c | 12 ++ drivers/usb/gadget/composite.c | 6 - drivers/usb/gadget/function/f_fs.c | 2 fs/9p/vfs_file.c | 2 fs/9p/vfs_inode.c | 5 - fs/9p/vfs_super.c | 1 fs/btrfs/inode.c | 2 fs/btrfs/transaction.c | 2 fs/gfs2/bmap.c | 5 - include/linux/etherdevice.h | 46 ++++++++++ include/net/af_unix.h | 5 - lib/dynamic_debug.c | 6 + net/bluetooth/l2cap_core.c | 3 net/bluetooth/sco.c | 4 net/bridge/br_forward.c | 9 +- net/core/net_namespace.c | 13 ++ net/core/rtnetlink.c | 2 net/core/sock.c | 4 net/ethernet/eth.c | 10 -- net/ipv4/tcp.c | 4 net/ipv4/tcp_input.c | 2 net/ipv4/tcp_ipv4.c | 8 + net/ipv4/tcp_output.c | 11 +- net/ipv6/fib6_rules.c | 6 + net/l2tp/l2tp_eth.c | 3 net/mac80211/ieee80211_i.h | 4 net/nsh/nsh.c | 14 +-- net/phonet/pn_netlink.c | 2 net/tipc/msg.c | 8 + net/unix/af_unix.c | 4 net/unix/garbage.c | 35 +++++--- net/unix/scm.c | 8 + net/wireless/nl80211.c | 2 sound/usb/line6/driver.c | 6 - tools/power/x86/turbostat/turbostat.8 | 2 tools/power/x86/turbostat/turbostat.c | 7 - tools/testing/selftests/timers/valid-adjtimex.c | 73 ++++++++-------- 58 files changed, 369 insertions(+), 190 deletions(-)
Adam Goldman (1):
firewire: ohci: mask bus reset interrupts between ISR and bottom half
Andrew Lunn (1):
net: dsa: mv88e6xxx: Add number of MACs in the ATU
Andrew Price (1):
gfs2: Fix invalid metadata access in punch_hole
Andy Shevchenko (2):
gpio: wcove: Use -ENOTSUPP consistently
gpio: crystalcove: Use -ENOTSUPP consistently
Arnd Bergmann (1):
power: rt9455: hide unused rt9455_boost_voltage_values
Boris Burkov (2):
btrfs: make btrfs_clear_delalloc_extent() free delalloc reserve
btrfs: always clear PERTRANS metadata during commit
Bui Quang Minh (1):
bna: ensure the copied buf is NUL terminated
Bumyong Lee (1):
dmaengine: pl330: issue_pending waits until WFP state
Chen Ni (1):
ata: sata_gemini: Check clk_enable() result
Chris Wulff (1):
usb: gadget: f_fs: Fix a race condition when processing setup packets.
Claudio Imbrenda (2):
s390/mm: Fix storage key clearing for guest huge pages s390/mm: Fix clearing storage keys for huge pages
Colin Ian King (1):
tcp: remove redundant check on tskb
Dan Carpenter (1):
pinctrl: core: delete incorrect free in pinctrl_enable()
David Bauer (1):
net l2tp: drop flow hash on forward
Doug Smythies (1):
tools/power turbostat: Fix added raw MSR output
Duoming Zhou (2):
Bluetooth: Fix use-after-free bugs caused by sco_sock_timeout
Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout
Eric Dumazet (3):
tcp: defer shutdown(SEND_SHUTDOWN) for TCP_SYN_RECV sockets
phonet: fix rtm_phonet_notify() skb allocation
ipv6: fib6_rules: avoid possible NULL dereference in fib6_rule_action()
Eric Huang (1):
drm/amdkfd: change system memory overcommit limit
Felix Fietkau (2):
net: bridge: fix multicast-to-unicast with fraglist GSO
net: bridge: fix corrupted ethernet header on multicast-to-unicast
Greg Kroah-Hartman (1):
Linux 4.19.314
Jakub Kicinski (1):
ethernet: add a helper for assigning port addresses
Jeff Johnson (1):
wifi: mac80211: fix ieee80211_bss_*_flags kernel-doc
Jeff Layton (1):
9p: explicitly deny setlease attempts
Jim Cromie (1):
dyndbg: fix old BUG_ON in >control parser
Joakim Sindholt (3):
fs/9p: only translate RWX permissions for plain 9P2000 fs/9p: translate O_TRUNC into OTRUNC
fs/9p: drop inodes immediately on non-.L too
Johannes Berg (1):
wifi: nl80211: don't free NULL coalescing rule
John Stultz (1):
selftests: timers: Fix valid-adjtimex signed left-shift undefined behavior
Justin Tee (1):
scsi: lpfc: Update lpfc_ramp_down_queue_handler() logic
Kuniyuki Iwashima (4):
nsh: Restore skb->{protocol,data,mac_header} for outer header in nsh_gso_segment().
tcp: Use refcount_inc_not_zero() in tcp_twsk_unique().
af_unix: Do not use atomic ops for unix_sk(sk)->inflight.
af_unix: Suppress false-positive lockdep splat for spin_lock() in __unix_gc().
Li RongQing (1):
net: slightly optimize eth_type_trans
Marek Behún (1):
net: dsa: mv88e6xxx: Fix number of databases for 88E6141 / 88E6341
Maurizio Lombardi (1):
scsi: target: Fix SELinux error when systemd-modules loads the target module
Michal Luczaj (1):
af_unix: Fix garbage collector racing against connect()
Mukul Joshi (1):
drm/amdgpu: Fix leak when GPU memory allocation fails
Paolo Abeni (1):
tipc: fix UAF in error path
Peng Liu (1):
tools/power turbostat: Fix Bzy_MHz documentation typo
Peter Korsgaard (1):
usb: gadget: composite: fix OS descriptors w_value logic
Phil Elwell (1):
net: bcmgenet: Reset RBUF on first open
Rahul Rameshbabu (1):
ethernet: Add helper for assigning packet type when dest address does not match device address
Roded Zats (1):
rtnetlink: Correct nested IFLA_VF_VLAN_LIST attribute validation
Saurav Kashyap (1):
scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload
Takashi Iwai (1):
ALSA: line6: Zero-initialize message buffers
Thadeu Lima de Souza Cascardo (1):
net: fix out-of-bounds access in ops_init
Thanassis Avgerinos (1):
firewire: nosy: ensure user_length is taken into account when fetching packet contents
Vanillan Wang (1):
net:usb:qmi_wwan: support Rolling modules
Vinod Koul (1):
dmaengine: Revert "dmaengine: pl330: issue_pending waits until WFP state"
Xin Long (1):
tipc: fix a possible memleak in tipc_buf_append
Zack Rusin (1):
drm/vmwgfx: Fix invalid reads in fence signaled events
Zeng Heng (1):
pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map()
linke li (1):
net: mark racy access on sk->sk_rcvbuf
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 19 -SUBLEVEL = 313 +SUBLEVEL = 314 EXTRAVERSION = NAME = "People's Front"
arch/s390/mm/gmap.c +1 -1
@@ -2583,7 +2583,7 @@ static int __s390_enable_skey_hugetlb(pte_t *pte, unsigned long addr,return 0 ; start =pmd_val (*pmd) &HPAGE_MASK ; - end = start +HPAGE_SIZE -1 ; + end = start +HPAGE_SIZE ;__storage_key_init_range (start, end);set_bit (PG_arch_1, &page->flags);return 0 ;
arch/s390/mm/hugetlbpage.c +1 -1
@@ -146,7 +146,7 @@ static void clear_huge_pte_skeys(struct mm_struct *mm, unsigned long rste) }if (!test_and_set_bit (PG_arch_1, &page->flags)) -__storage_key_init_range (paddr, paddr + size -1 ); +__storage_key_init_range (paddr, paddr + size); } void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
drivers/ata/sata_gemini.c +4 -1
@@ -200,7 +200,10 @@ int gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge) pclk = sg->sata0_pclk; else pclk = sg->sata1_pclk; -clk_enable (pclk); + ret =clk_enable (pclk); +if (ret) +return ret; +msleep (10 );/* Do not keep clocking a bridge that is not online */
drivers/firewire/nosy.c +4 -2
@@ -161,10 +161,12 @@ packet_buffer_get(struct client *client, char __user *data, size_t user_length)if (atomic_read (&buffer->size) ==0 )return -ENODEV ; -/* FIXME: Check length <= user_length. */ + length = buffer->head->length; + +if (length > user_length) +return 0 ; end = buffer->data + buffer->capacity; - length = buffer->head->length;if (&buffer->head->data[length] < end) {if (copy_to_user (data, buffer->head->data, length))
drivers/firewire/ohci.c +5 -1
@@ -2066,6 +2066,8 @@ static void bus_reset_work(struct work_struct *work) ohci->generation = generation;reg_write (ohci, OHCI1394_IntEventClear, OHCI1394_busReset); +if (param_debug &OHCI_PARAM_DEBUG_BUSRESETS ) +reg_write (ohci, OHCI1394_IntMaskSet, OHCI1394_busReset);if (ohci->quirks &QUIRK_RESET_PACKET ) ohci->request_generation = generation;
@@ -2132,12 +2134,14 @@ static irqreturn_t irq_handler(int irq, void *data)return IRQ_NONE ;/* -* busReset and postedWriteErr must not be cleared yet +* busReset and postedWriteErr events must not be cleared yet * (OHCI 1.1 clauses 7.2.3.2 and 13.2.8.1) */ reg_write (ohci, OHCI1394_IntEventClear, event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));log_irqs (ohci, event); +if (event & OHCI1394_busReset) +reg_write (ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);if (event & OHCI1394_selfIDComplete)queue_work (selfid_workqueue, &ohci->bus_reset_work);
drivers/gpio/gpio-crystalcove.c +1 -1
@@ -99,7 +99,7 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)case 0x5e :return GPIOPANELCTL ;default : -return -EOPNOTSUPP ; +return -ENOTSUPP ; } }
drivers/gpio/gpio-wcove.c +1 -1
@@ -110,7 +110,7 @@ static inline unsigned int to_reg(int gpio, enum ctrl_register reg_type)unsigned int reg;if (gpio >=WCOVE_GPIO_NUM ) -return -EOPNOTSUPP ; +return -ENOTSUPP ;if (reg_type ==CTRL_IN ) reg =GPIO_IN_CTRL_BASE + gpio;
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +59 -41
174 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +1 -1
@@ -1064,7 +1064,7 @@ static int vmw_event_fence_action_create(struct drm_file *file_priv, } event->event.base.type =DRM_VMW_EVENT_FENCE_SIGNALED ; - event->event.base.length =sizeof (*event); + event->event.base.length =sizeof (event->event); event->event.user_data = user_data; ret =drm_event_reserve_init (dev, file_priv, &event->base, &event->event.base);
drivers/net/dsa/mv88e6xxx/chip.c +27 -2
@@ -3933,6 +3933,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6097, .name = "Marvell 88E6085", .num_databases = 4096, + .num_macs = 8192, .num_ports = 10, .num_internal_phys = 5, .max_vid = 4095,
@@ -3955,6 +3956,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6095, .name = "Marvell 88E6095/88E6095F", .num_databases = 256, + .num_macs = 8192, .num_ports = 11, .num_internal_phys = 0, .max_vid = 4095,
@@ -3975,6 +3977,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6097, .name = "Marvell 88E6097/88E6097F", .num_databases = 4096, + .num_macs = 8192, .num_ports = 11, .num_internal_phys = 8, .max_vid = 4095,
@@ -3997,6 +4000,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6165, .name = "Marvell 88E6123", .num_databases = 4096, + .num_macs = 1024, .num_ports = 3, .num_internal_phys = 5, .max_vid = 4095,
@@ -4019,6 +4023,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6185, .name = "Marvell 88E6131", .num_databases = 256, + .num_macs = 8192, .num_ports = 8, .num_internal_phys = 0, .max_vid = 4095,
@@ -4038,7 +4043,8 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6141, .family = MV88E6XXX_FAMILY_6341, .name = "Marvell 88E6141", - .num_databases = 4096, + .num_databases = 256, + .num_macs = 2048, .num_ports = 6, .num_internal_phys = 5, .num_gpio = 11,
@@ -4062,6 +4068,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6165, .name = "Marvell 88E6161", .num_databases = 4096, + .num_macs = 1024, .num_ports = 6, .num_internal_phys = 5, .max_vid = 4095,
@@ -4085,6 +4092,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6165, .name = "Marvell 88E6165", .num_databases = 4096, + .num_macs = 8192, .num_ports = 6, .num_internal_phys = 0, .max_vid = 4095,
@@ -4108,6 +4116,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6351, .name = "Marvell 88E6171", .num_databases = 4096, + .num_macs = 8192, .num_ports = 7, .num_internal_phys = 5, .max_vid = 4095,
@@ -4130,6 +4139,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6352, .name = "Marvell 88E6172", .num_databases = 4096, + .num_macs = 8192, .num_ports = 7, .num_internal_phys = 5, .num_gpio = 15,
@@ -4153,6 +4163,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6351, .name = "Marvell 88E6175", .num_databases = 4096, + .num_macs = 8192, .num_ports = 7, .num_internal_phys = 5, .max_vid = 4095,
@@ -4175,6 +4186,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6352, .name = "Marvell 88E6176", .num_databases = 4096, + .num_macs = 8192, .num_ports = 7, .num_internal_phys = 5, .num_gpio = 15,
@@ -4198,6 +4210,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6185, .name = "Marvell 88E6185", .num_databases = 256, + .num_macs = 8192, .num_ports = 10, .num_internal_phys = 0, .max_vid = 4095,
@@ -4218,6 +4231,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6390, .name = "Marvell 88E6190", .num_databases = 4096, + .num_macs = 16384, .num_ports = 11, /* 10 + Z80 */ .num_internal_phys = 9, .num_gpio = 16,
@@ -4241,6 +4255,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6390, .name = "Marvell 88E6190X", .num_databases = 4096, + .num_macs = 16384, .num_ports = 11, /* 10 + Z80 */ .num_internal_phys = 9, .num_gpio = 16,
@@ -4264,6 +4279,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6390, .name = "Marvell 88E6191", .num_databases = 4096, + .num_macs = 16384, .num_ports = 11, /* 10 + Z80 */ .num_internal_phys = 9, .max_vid = 8191,
@@ -4287,6 +4303,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6352, .name = "Marvell 88E6240", .num_databases = 4096, + .num_macs = 8192, .num_ports = 7, .num_internal_phys = 5, .num_gpio = 15,
@@ -4335,6 +4352,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6320, .name = "Marvell 88E6320", .num_databases = 4096, + .num_macs = 8192, .num_ports = 7, .num_internal_phys = 5, .num_gpio = 15,
@@ -4359,6 +4377,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6320, .name = "Marvell 88E6321", .num_databases = 4096, + .num_macs = 8192, .num_ports = 7, .num_internal_phys = 5, .num_gpio = 15,
@@ -4381,7 +4400,8 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6341, .family = MV88E6XXX_FAMILY_6341, .name = "Marvell 88E6341", - .num_databases = 4096, + .num_databases = 256, + .num_macs = 2048, .num_internal_phys = 5, .num_ports = 6, .num_gpio = 11,
@@ -4406,6 +4426,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6351, .name = "Marvell 88E6350", .num_databases = 4096, + .num_macs = 8192, .num_ports = 7, .num_internal_phys = 5, .max_vid = 4095,
@@ -4428,6 +4449,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6351, .name = "Marvell 88E6351", .num_databases = 4096, + .num_macs = 8192, .num_ports = 7, .num_internal_phys = 5, .max_vid = 4095,
@@ -4450,6 +4472,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6352, .name = "Marvell 88E6352", .num_databases = 4096, + .num_macs = 8192, .num_ports = 7, .num_internal_phys = 5, .num_gpio = 15,
@@ -4473,6 +4496,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6390, .name = "Marvell 88E6390", .num_databases = 4096, + .num_macs = 16384, .num_ports = 11, /* 10 + Z80 */ .num_internal_phys = 9, .num_gpio = 16,
@@ -4496,6 +4520,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .family = MV88E6XXX_FAMILY_6390, .name = "Marvell 88E6390X", .num_databases = 4096, + .num_macs = 16384, .num_ports = 11, /* 10 + Z80 */ .num_internal_phys = 9, .num_gpio = 16,
drivers/net/dsa/mv88e6xxx/chip.h +6 -0
@@ -105,6 +105,7 @@ struct mv88e6xxx_info {u16 prod_num;const char *name;unsigned int num_databases; +unsigned int num_macs;unsigned int num_ports;unsigned int num_internal_phys;unsigned int num_gpio;
@@ -559,6 +560,11 @@ static inline unsigned int mv88e6xxx_num_databases(struct mv88e6xxx_chip *chip)return chip->info->num_databases; } +static inline unsigned int mv88e6xxx_num_macs (struct mv88e6xxx_chip *chip) +{ +return chip->info->num_macs; +} +static inline unsigned int mv88e6xxx_num_ports (struct mv88e6xxx_chip *chip) {return chip->info->num_ports;
drivers/net/ethernet/broadcom/genet/bcmgenet.c +12 -4
@@ -2806,7 +2806,7 @@ static void bcmgenet_set_hw_addr(struct bcmgenet_priv *priv, }/* Returns a reusable dma control register value */ -static u32 bcmgenet_dma_disable (struct bcmgenet_priv *priv) +static u32 bcmgenet_dma_disable (struct bcmgenet_priv *priv,bool flush_rx) {unsigned int i;u32 reg;
@@ -2831,6 +2831,14 @@ static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv)udelay (10 );bcmgenet_umac_writel (priv,0 ,UMAC_TX_FLUSH ); +if (flush_rx) { + reg =bcmgenet_rbuf_ctrl_get (priv); +bcmgenet_rbuf_ctrl_set (priv, reg |BIT (0 )); +udelay (10 ); +bcmgenet_rbuf_ctrl_set (priv, reg); +udelay (10 ); + } +return dma_ctrl; }
@@ -2926,8 +2934,8 @@ static int bcmgenet_open(struct net_device *dev)bcmgenet_set_hw_addr (priv, dev->dev_addr); -/* Disable RX/TX DMA and flush TX queues */ - dma_ctrl =bcmgenet_dma_disable (priv); +/* Disable RX/TX DMA and flush TX and RX queues */ + dma_ctrl =bcmgenet_dma_disable (priv, true);/* Reinitialize TDMA and RDMA and SW housekeeping */ ret =bcmgenet_init_dma (priv);
@@ -3682,7 +3690,7 @@ static int bcmgenet_resume(struct device *d)bcmgenet_power_up (priv,GENET_POWER_WOL_MAGIC );/* Disable RX/TX DMA and flush TX queues */ - dma_ctrl =bcmgenet_dma_disable (priv); + dma_ctrl =bcmgenet_dma_disable (priv, false);/* Reinitialize TDMA and RDMA and SW housekeeping */ ret =bcmgenet_init_dma (priv);
drivers/net/ethernet/brocade/bna/bnad_debugfs.c +2 -2
@@ -320,7 +320,7 @@ bnad_debugfs_write_regrd(struct file *file, const char __user *buf,void *kern_buf;/* Copy the user space buf */ - kern_buf =memdup_user (buf, nbytes); + kern_buf =memdup_user_nul (buf, nbytes);if (IS_ERR (kern_buf))return PTR_ERR (kern_buf);
@@ -380,7 +380,7 @@ bnad_debugfs_write_regwr(struct file *file, const char __user *buf,void *kern_buf;/* Copy the user space buf */ - kern_buf =memdup_user (buf, nbytes); + kern_buf =memdup_user_nul (buf, nbytes);if (IS_ERR (kern_buf))return PTR_ERR (kern_buf);
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1383,6 +1383,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/ {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */ {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */ + {QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET *//* 4. Gobi 1000 devices */ {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
drivers/pinctrl/core.c +1 -7
@@ -2036,13 +2036,7 @@ int pinctrl_enable(struct pinctrl_dev *pctldev) error =pinctrl_claim_hogs (pctldev);if (error) { -dev_err (pctldev->dev,"could not claim hogs: %i\n" , - error); -pinctrl_free_pindescs (pctldev, pctldev->desc->pins, - pctldev->desc->npins); -mutex_destroy (&pctldev->mutex); -kfree (pctldev); - +dev_err (pctldev->dev,"could not claim hogs: %i\n" , error);return error; }
drivers/pinctrl/devicetree.c +6 -4
@@ -235,14 +235,16 @@ int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev)for (state =0 ; ; state++) {/* Retrieve the pinctrl-* property */ propname =kasprintf (GFP_KERNEL ,"pinctrl-%d" , state); -if (!propname) -return -ENOMEM ; +if (!propname) { + ret = -ENOMEM ; + goto err; + } prop =of_find_property (np, propname, &size);kfree (propname);if (!prop) {if (state ==0 ) { -of_node_put (np); -return -ENODEV ; + ret = -ENODEV ; + goto err; }break ; }
drivers/power/supply/rt9455_charger.c +2 -0
@@ -202,6 +202,7 @@ static const int rt9455_voreg_values[] = { 4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000 }; +#if IS_ENABLED (CONFIG_USB_PHY )/* * When the charger is in boost mode, REG02[7:2] represent boost output * voltage.
@@ -217,6 +218,7 @@ static const int rt9455_boost_voltage_values[] = {5600000 ,5600000 ,5600000 ,5600000 ,5600000 ,5600000 ,5600000 ,5600000 , 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, }; +#endif /* REG07[3:0] (VMREG) in uV */ static const int rt9455_vmreg_values[] = {
drivers/scsi/bnx2fc/bnx2fc_tgt.c +0 -2
@@ -834,7 +834,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,BNX2FC_TGT_DBG (tgt,"Freeing up session resources\n" ); -spin_lock_bh (&tgt->cq_lock); ctx_base_ptr = tgt->ctx_base; tgt->ctx_base =NULL ;
@@ -890,7 +889,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba, tgt->sq, tgt->sq_dma); tgt->sq =NULL ; } -spin_unlock_bh (&tgt->cq_lock);if (ctx_base_ptr)iounmap (ctx_base_ptr);
drivers/scsi/lpfc/lpfc.h +0 -1
@@ -989,7 +989,6 @@ struct lpfc_hba {unsigned long bit_flags;#define FABRIC_COMANDS_BLOCKED 0atomic_t num_rsrc_err; -atomic_t num_cmd_success;unsigned long last_rsrc_error_time;unsigned long last_ramp_down_time;#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
drivers/scsi/lpfc/lpfc_scsi.c +4 -9
@@ -303,11 +303,10 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)struct Scsi_Host *shost;struct scsi_device *sdev;unsigned long new_queue_depth; -unsigned long num_rsrc_err, num_cmd_success; +unsigned long num_rsrc_err;int i; num_rsrc_err =atomic_read (&phba->num_rsrc_err); - num_cmd_success =atomic_read (&phba->num_cmd_success);/* * The error and success command counters are global per
@@ -322,20 +321,16 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)for (i =0 ; i <= phba->max_vports && vports[i] !=NULL ; i++) { shost =lpfc_shost_from_vport (vports[i]);shost_for_each_device (sdev, shost) { - new_queue_depth = - sdev->queue_depth * num_rsrc_err / - (num_rsrc_err + num_cmd_success); -if (!new_queue_depth) - new_queue_depth = sdev->queue_depth -1 ; +if (num_rsrc_err >= sdev->queue_depth) + new_queue_depth =1 ;else new_queue_depth = sdev->queue_depth - - new_queue_depth; + num_rsrc_err;scsi_change_queue_depth (sdev, new_queue_depth); } }lpfc_destroy_vport_work_array (phba, vports);atomic_set (&phba->num_rsrc_err,0 ); -atomic_set (&phba->num_cmd_success,0 ); }/**
drivers/target/target_core_configfs.c +12 -0
@@ -3240,6 +3240,8 @@ static int __init target_core_init_configfs(void) {struct configfs_subsystem *subsys = &target_core_fabrics;struct t10_alua_lu_gp *lu_gp; +struct cred *kern_cred; +const struct cred *old_cred;int ret; pr_debug("TARGET_CORE[0]: Loading Generic Kernel Storage"
@@ -3316,11 +3318,21 @@ static int __init target_core_init_configfs(void)if (ret <0 ) goto out; +/* We use the kernel credentials to access the target directory */ + kern_cred =prepare_kernel_cred (&init_task); +if (!kern_cred) { + ret = -ENOMEM ; + goto out; + } + old_cred =override_creds (kern_cred);target_init_dbroot (); +revert_creds (old_cred); +put_cred (kern_cred);return 0 ; out: +target_xcopy_release_pt ();configfs_unregister_subsystem (subsys);core_dev_release_virtual_lun0 ();rd_module_exit ();
drivers/usb/gadget/composite.c +3 -3
@@ -1911,7 +1911,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) buf[5 ] =0x01 ;switch (ctrl->bRequestType &USB_RECIP_MASK ) {case USB_RECIP_DEVICE : -if (w_index !=0x4 || (w_value >>8 )) +if (w_index !=0x4 || (w_value &0xff ))break ; buf[6 ] = w_index;/* Number of ext compat interfaces */
@@ -1927,9 +1927,9 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) }break ;case USB_RECIP_INTERFACE : -if (w_index !=0x5 || (w_value >>8 )) +if (w_index !=0x5 || (w_value &0xff ))break ; - interface = w_value &0xFF ; + interface = w_value >>8 ;if (interface >=MAX_CONFIG_INTERFACES || !os_desc_cfg->interface[interface])break ;
drivers/usb/gadget/function/f_fs.c +1 -1
@@ -3304,7 +3304,7 @@ static int ffs_func_setup(struct usb_function *f,__ffs_event_add (ffs,FUNCTIONFS_SETUP );spin_unlock_irqrestore (&ffs->ev.waitq.lock, flags); -return creq->wLength ==0 ?USB_GADGET_DELAYED_STATUS :0 ; +return ffs->ev.setup.wLength ==0 ?USB_GADGET_DELAYED_STATUS :0 ; } static bool ffs_func_req_match(struct usb_function *f,
fs/9p/vfs_file.c +2 -0
@@ -691,6 +691,7 @@ const struct file_operations v9fs_file_operations = { .lock = v9fs_file_lock, .mmap = generic_file_readonly_mmap, .fsync = v9fs_file_fsync, + .setlease = simple_nosetlease, };const struct file_operations v9fs_file_operations_dotl = {
@@ -726,4 +727,5 @@ const struct file_operations v9fs_mmap_file_operations_dotl = { .flock = v9fs_file_flock_dotl, .mmap = v9fs_mmap_file_mmap, .fsync = v9fs_file_fsync_dotl, + .setlease = simple_nosetlease, };
fs/9p/vfs_inode.c +4 -1
@@ -101,7 +101,7 @@ static int p9mode2perm(struct v9fs_session_info *v9ses,int res;int mode = stat->mode; - res = mode &S_IALLUGO ; + res = mode &0777 ;/* S_IRWXUGO */ if (v9fs_proto_dotu (v9ses)) {if ((mode &P9_DMSETUID ) ==P9_DMSETUID ) res |=S_ISUID ;
@@ -192,6 +192,9 @@ int v9fs_uflags2omode(int uflags, int extended)break ; } +if (uflags &O_TRUNC ) + ret |=P9_OTRUNC ; +if (extended) {if (uflags &O_EXCL ) ret |=P9_OEXCL ;
fs/9p/vfs_super.c +1 -0
@@ -346,6 +346,7 @@ static const struct super_operations v9fs_super_ops = { .alloc_inode = v9fs_alloc_inode, .destroy_inode = v9fs_destroy_inode, .statfs = simple_statfs, + .drop_inode = v9fs_drop_inode, .evict_inode = v9fs_evict_inode, .show_options = v9fs_show_options, .umount_begin = v9fs_umount_begin,
fs/btrfs/inode.c +1 -1
@@ -1906,7 +1906,7 @@ static void btrfs_clear_bit_hook(void *private_data,*/ if (*bits &EXTENT_CLEAR_META_RESV && root != fs_info->tree_root) -btrfs_delalloc_release_metadata (inode, len, false); +btrfs_delalloc_release_metadata (inode, len, true);/* For sanity tests. */ if (btrfs_is_testing (fs_info))
fs/btrfs/transaction.c +1 -1
@@ -1271,6 +1271,7 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans)radix_tree_tag_clear (&fs_info->fs_roots_radix, (unsigned long )root->root_key.objectid,BTRFS_ROOT_TRANS_TAG ); +btrfs_qgroup_free_meta_all_pertrans (root);spin_unlock (&fs_info->fs_roots_radix_lock);btrfs_free_log (trans, root);
@@ -1295,7 +1296,6 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans)if (ret2)return ret2;spin_lock (&fs_info->fs_roots_radix_lock); -btrfs_qgroup_free_meta_all_pertrans (root); } }spin_unlock (&fs_info->fs_roots_radix_lock);
fs/gfs2/bmap.c +3 -2
@@ -1751,7 +1751,8 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length)struct buffer_head *dibh, *bh;struct gfs2_holder rd_gh;unsigned int bsize_shift = sdp->sd_sb.sb_bsize_shift; -u64 lblock = (offset + (1 << bsize_shift) -1 ) >> bsize_shift; +unsigned int bsize =1 << bsize_shift; +u64 lblock = (offset + bsize -1 ) >> bsize_shift;__u16 start_list[GFS2_MAX_META_HEIGHT ];__u16 __end_list[GFS2_MAX_META_HEIGHT ], *end_list =NULL ;unsigned int start_aligned, end_aligned;
@@ -1762,7 +1763,7 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length)u64 prev_bnr =0 ;__be64 *start, *end; -if (offset >= maxsize) { +if (offset + bsize -1 >= maxsize) {/* * The starting point lies beyond the allocated meta-data; * there are no blocks do deallocate.
include/linux/etherdevice.h +46 -0
52 lines not on this page · raw message
include/net/af_unix.h +4 -1
@@ -52,7 +52,7 @@ struct unix_sock {struct mutex iolock, bindlock;struct sock *peer;struct list_head link; -atomic_long_t inflight; +unsigned long inflight;spinlock_t lock;unsigned long gc_flags;#define UNIX_GC_CANDIDATE 0
@@ -72,6 +72,9 @@ enum unix_socket_lock_class {U_LOCK_NORMAL ,U_LOCK_SECOND ,/* for double locking, see unix_state_double_lock(). */ U_LOCK_DIAG ,/* used while dumping icons, see sk_diag_dump_icons(). */ + U_LOCK_GC_LISTENER, /* used for listening socket while determining gc + * candidates to close a small race window. + */ }; static inline void unix_state_lock_nested(struct sock *sk,
lib/dynamic_debug.c +5 -1
@@ -242,7 +242,11 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords) }else {for (end = buf; *end && !isspace (*end); end++) ; -BUG_ON (end == buf); +if (end == buf) { +pr_err ("parse err after word:%d=%s\n" , nwords, + nwords ? words[nwords -1 ] :"<none>" ); +return -EINVAL ; + } }/* `buf' is start of word, `end' is one past its end */
net/bluetooth/l2cap_core.c +3 -0
@@ -429,6 +429,9 @@ static void l2cap_chan_timeout(struct work_struct *work)BT_DBG ("chan %p state %s" , chan,state_to_string (chan->state)); +if (!conn) +return ; +mutex_lock (&conn->chan_lock);/* __set_chan_timer() calls l2cap_chan_hold(chan) while scheduling * this work. No need to call l2cap_chan_hold(chan) here again.
net/bluetooth/sco.c +4 -0
@@ -82,6 +82,10 @@ static void sco_sock_timeout(struct work_struct *work)struct sock *sk;sco_conn_lock (conn); +if (!conn->hcon) { +sco_conn_unlock (conn); +return ; + } sk = conn->sk;if (sk)sock_hold (sk);
net/bridge/br_forward.c +7 -2
@@ -251,6 +251,7 @@ static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb, {struct net_device *dev =BR_INPUT_SKB_CB (skb)->brdev;const unsigned char *src =eth_hdr (skb)->h_source; +struct sk_buff *nskb;if (!should_deliver (p, skb))return ;
@@ -259,12 +260,16 @@ static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb,if (skb->dev == p->dev &ðer_addr_equal (src, addr))return ; - skb =skb_copy (skb,GFP_ATOMIC ); -if (!skb) { +__skb_push (skb,ETH_HLEN ); + nskb =pskb_copy (skb,GFP_ATOMIC ); +__skb_pull (skb,ETH_HLEN ); +if (!nskb) {DEV_STATS_INC (dev, tx_dropped);return ; } + skb = nskb; +__skb_pull (skb,ETH_HLEN );if (!is_broadcast_ether_addr (addr))memcpy (eth_hdr (skb)->h_dest, addr,ETH_ALEN );
net/core/net_namespace.c +10 -3
@@ -63,12 +63,15 @@ static unsigned int max_gen_ptrs = INITIAL_NET_GEN_PTRS;static struct net_generic *net_alloc_generic (void ) { +unsigned int gen_ptrs =READ_ONCE (max_gen_ptrs); +unsigned int generic_size;struct net_generic *ng; - unsigned int generic_size = offsetof(struct net_generic, ptr[max_gen_ptrs]); + + generic_size = offsetof(struct net_generic, ptr[gen_ptrs]); ng =kzalloc (generic_size,GFP_KERNEL );if (ng) - ng->s.len = max_gen_ptrs; + ng->s.len = gen_ptrs;return ng; }
@@ -1032,7 +1035,11 @@ static int register_pernet_operations(struct list_head *list,if (error <0 )return error; *ops->id = error; - max_gen_ptrs =max (max_gen_ptrs, *ops->id +1 ); +/* This does not require READ_ONCE as writers already hold +* pernet_ops_rwsem. But WRITE_ONCE is needed to protect +* net_alloc_generic. +*/ +WRITE_ONCE (max_gen_ptrs,max (max_gen_ptrs, *ops->id +1 )); } error =__register_pernet_operations (list, ops);if (error) {
net/core/rtnetlink.c +1 -1
@@ -2167,7 +2167,7 @@ static int do_setvfinfo(struct net_device *dev, struct nlattr **tb)nla_for_each_nested (attr, tb[IFLA_VF_VLAN_LIST ], rem) {if (nla_type (attr) !=IFLA_VF_VLAN_INFO || -nla_len (attr) <NLA_HDRLEN ) { +nla_len (attr) <sizeof (struct ifla_vf_vlan_info )) {return -EINVAL ; }if (len >=MAX_VLAN_LIST_LEN )
net/core/sock.c +2 -2
@@ -404,7 +404,7 @@ int __sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)unsigned long flags;struct sk_buff_head *list = &sk->sk_receive_queue; -if (atomic_read (&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) { +if (atomic_read (&sk->sk_rmem_alloc) >=READ_ONCE (sk->sk_rcvbuf)) {atomic_inc (&sk->sk_drops);trace_sock_rcvqueue_full (sk, skb);return -ENOMEM ;
@@ -456,7 +456,7 @@ int __sk_receive_skb(struct sock *sk, struct sk_buff *skb, skb->dev =NULL ; -if (sk_rcvqueues_full (sk, sk->sk_rcvbuf)) { +if (sk_rcvqueues_full (sk,READ_ONCE (sk->sk_rcvbuf))) {atomic_inc (&sk->sk_drops); goto discard_and_relse; }
net/ethernet/eth.c +1 -9
@@ -165,15 +165,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) eth = (struct ethhdr *)skb->data;skb_pull_inline (skb,ETH_HLEN ); -if (unlikely (is_multicast_ether_addr_64bits (eth->h_dest))) { -if (ether_addr_equal_64bits (eth->h_dest, dev->broadcast)) - skb->pkt_type =PACKET_BROADCAST ; -else - skb->pkt_type =PACKET_MULTICAST ; - } -else if (unlikely (!ether_addr_equal_64bits (eth->h_dest, - dev->dev_addr))) - skb->pkt_type =PACKET_OTHERHOST ; +eth_skb_pkt_type (skb, dev);/* * Some variants of DSA tagging don't have an ethertype field
net/ipv4/tcp.c +2 -2
@@ -2319,7 +2319,7 @@ void tcp_shutdown(struct sock *sk, int how)/* If we've already sent a FIN, or it's a closed state, skip this. */ if ((1 << sk->sk_state) & (TCPF_ESTABLISHED |TCPF_SYN_SENT | -TCPF_SYN_RECV |TCPF_CLOSE_WAIT )) { +TCPF_CLOSE_WAIT )) {/* Clear out any half completed packets. FIN if needed. */ if (tcp_close_state (sk))tcp_send_fin (sk);
@@ -2404,7 +2404,7 @@ void __tcp_close(struct sock *sk, long timeout)* machine. State transitions: * * TCP_ESTABLISHED -> TCP_FIN_WAIT1 -* TCP_SYN_RECV -> TCP_FIN_WAIT1 (forget it, it's impossible) +* TCP_SYN_RECV -> TCP_FIN_WAIT1 (it is difficult) * TCP_CLOSE_WAIT -> TCP_LAST_ACK * * are legal only when FIN has been sent (i.e. in window),
net/ipv4/tcp_input.c +2 -0
@@ -6212,6 +6212,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)tcp_initialize_rcv_mss (sk);tcp_fast_path_on (tp); +if (sk->sk_shutdown &SEND_SHUTDOWN ) +tcp_shutdown (sk,SEND_SHUTDOWN );break ;case TCP_FIN_WAIT1 : {
net/ipv4/tcp_ipv4.c +7 -1
@@ -157,6 +157,12 @@ int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp)if (tcptw->tw_ts_recent_stamp && (!twp || (reuse &&time_after32 (ktime_get_seconds (), tcptw->tw_ts_recent_stamp)))) { +/* inet_twsk_hashdance() sets sk_refcnt after putting twsk +* and releasing the bucket lock. +*/ +if (unlikely (!refcount_inc_not_zero (&sktw->sk_refcnt))) +return 0 ; +/* In case of repair and re-using TIME-WAIT sockets we still * want to be sure that it is safe as above but honor the * sequence numbers and time stamps set as part of the repair
@@ -177,7 +183,7 @@ int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp) tp->rx_opt.ts_recent = tcptw->tw_ts_recent; tp->rx_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp; } -sock_hold (sktw); +return 1 ; }
net/ipv4/tcp_output.c +5 -6
@@ -3132,7 +3132,6 @@ void tcp_send_fin(struct sock *sk) tskb =skb_rb_last (&sk->tcp_rtx_queue);if (tskb) { -coalesce:TCP_SKB_CB (tskb)->tcp_flags |=TCPHDR_FIN ;TCP_SKB_CB (tskb)->end_seq++; tp->write_seq++;
@@ -3147,12 +3146,12 @@ void tcp_send_fin(struct sock *sk)return ; } }else { - skb =alloc_skb_fclone (MAX_TCP_HEADER , sk->sk_allocation); -if (unlikely (!skb)) { -if (tskb) - goto coalesce; + skb =alloc_skb_fclone (MAX_TCP_HEADER , +sk_gfp_mask (sk,GFP_ATOMIC | + __GFP_NOWARN)); +if (unlikely (!skb))return ; - } +INIT_LIST_HEAD (&skb->tcp_tsorted_anchor);skb_reserve (skb,MAX_TCP_HEADER );sk_forced_mem_schedule (sk, skb->truesize);
net/ipv6/fib6_rules.c +5 -1
@@ -232,8 +232,12 @@ static int __fib6_rule_action(struct fib_rule *rule, struct flowi *flp, rt =lookup (net, table, flp6, arg->lookup_data, flags);if (rt != net->ipv6.ip6_null_entry) { +struct inet6_dev *idev =ip6_dst_idev (&rt->dst); + +if (!idev) + goto again; err =fib6_rule_saddr (net, rule, flags, flp6, -ip6_dst_idev (&rt->dst)->dev); + idev->dev);if (err == -EAGAIN ) goto again;
net/l2tp/l2tp_eth.c +3 -0
@@ -154,6 +154,9 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,/* checksums verified by L2TP */ skb->ip_summed =CHECKSUM_NONE ; +/* drop outer flow-hash */ +skb_clear_hash (skb); +skb_dst_drop (skb);nf_reset (skb);
net/mac80211/ieee80211_i.h +2 -2
@@ -113,7 +113,7 @@ struct ieee80211_bss { };/** -* enum ieee80211_corrupt_data_flags - BSS data corruption flags +* enum ieee80211_bss_corrupt_data_flags - BSS data corruption flags * @IEEE80211_BSS_CORRUPT_BEACON: last beacon frame received was corrupted * @IEEE80211_BSS_CORRUPT_PROBE_RESP: last probe response received was corrupted *
@@ -126,7 +126,7 @@ enum ieee80211_bss_corrupt_data_flags { };/** -* enum ieee80211_valid_data_flags - BSS valid data flags +* enum ieee80211_bss_valid_data_flags - BSS valid data flags * @IEEE80211_BSS_VALID_WMM: WMM/UAPSD data was gathered from non-corrupt IE * @IEEE80211_BSS_VALID_RATES: Supported rates were gathered from non-corrupt IE * @IEEE80211_BSS_VALID_ERP: ERP flag was gathered from non-corrupt IE
net/nsh/nsh.c +8 -6
@@ -79,13 +79,15 @@ EXPORT_SYMBOL_GPL(nsh_pop);static struct sk_buff *nsh_gso_segment (struct sk_buff *skb,netdev_features_t features) { +unsigned int outer_hlen, mac_len, nsh_len;struct sk_buff *segs =ERR_PTR (-EINVAL );u16 mac_offset = skb->mac_header; -unsigned int nsh_len, mac_len; -__be16 proto; +__be16 outer_proto, proto;skb_reset_network_header (skb); + outer_proto = skb->protocol; + outer_hlen =skb_mac_header_len (skb); mac_len = skb->mac_len;if (unlikely (!pskb_may_pull (skb,NSH_BASE_HDR_LEN )))
@@ -115,10 +117,10 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb, }for (skb = segs; skb; skb = skb->next) { - skb->protocol =htons (ETH_P_NSH ); -__skb_push (skb, nsh_len); - skb->mac_header = mac_offset; - skb->network_header = skb->mac_header + mac_len; + skb->protocol = outer_proto; +__skb_push (skb, nsh_len + outer_hlen); +skb_reset_mac_header (skb); +skb_set_network_header (skb, outer_hlen); skb->mac_len = mac_len; }
net/phonet/pn_netlink.c +1 -1
@@ -206,7 +206,7 @@ void rtm_phonet_notify(int event, struct net_device *dev, u8 dst)struct sk_buff *skb;int err = -ENOBUFS ; - skb =nlmsg_new (NLMSG_ALIGN (sizeof (struct ifaddrmsg )) + + skb =nlmsg_new (NLMSG_ALIGN (sizeof (struct rtmsg )) +nla_total_size (1 ) +nla_total_size (4 ),GFP_KERNEL );if (skb ==NULL ) goto errout;
net/tipc/msg.c +6 -2
@@ -140,9 +140,9 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)if (fragid ==FIRST_FRAGMENT ) {if (unlikely (head)) goto err; - *buf =NULL ;if (skb_has_frag_list (frag) &&__skb_linearize (frag)) goto err; + *buf =NULL ; frag =skb_unshare (frag,GFP_ATOMIC );if (unlikely (!frag)) goto err;
@@ -154,6 +154,11 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)if (!head) goto err; +/* Either the input skb ownership is transferred to headskb +* or the input skb is freed, clear the reference to avoid +* bad access on error path. +*/ + *buf =NULL ;if (skb_try_coalesce (head, frag, &headstolen, &delta)) {kfree_skb_partial (frag, headstolen); }else {
@@ -177,7 +182,6 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf) *headbuf =NULL ;return 1 ; } - *buf =NULL ;return 0 ; err:kfree_skb (*buf);
net/unix/af_unix.c +2 -2
@@ -814,11 +814,11 @@ static struct sock *unix_create1(struct net *net, struct socket *sock, int kern) sk->sk_write_space = unix_write_space; sk->sk_max_ack_backlog = net->unx.sysctl_max_dgram_qlen; sk->sk_destruct = unix_sock_destructor; - u =unix_sk (sk); + u =unix_sk (sk); + u->inflight =0 ; u->path.dentry =NULL ; u->path.mnt =NULL ;spin_lock_init (&u->lock); -atomic_long_set (&u->inflight,0 );INIT_LIST_HEAD (&u->link);mutex_init (&u->iolock);/* single task reading lock */ mutex_init (&u->bindlock);/* single task binding lock */
net/unix/garbage.c +25 -10
@@ -171,17 +171,18 @@ static void scan_children(struct sock *x, void (*func)(struct unix_sock *),static void dec_inflight (struct unix_sock *usk) { -atomic_long_dec (&usk->inflight); + usk->inflight--; }static void inc_inflight (struct unix_sock *usk) { -atomic_long_inc (&usk->inflight); + usk->inflight++; }static void inc_inflight_move_tail (struct unix_sock *u) { -atomic_long_inc (&u->inflight); + u->inflight++; +/* If this still might be part of a cycle, move it to the end * of the list, so that it's checked even if it was already * passed over
@@ -238,20 +239,34 @@ void unix_gc(void)* receive queues. Other, non candidate sockets _can_ be * added to queue, so we must make sure only to touch * candidates. +* +* Embryos, though never candidates themselves, affect which +* candidates are reachable by the garbage collector. Before +* being added to a listener's queue, an embryo may already +* receive data carrying SCM_RIGHTS, potentially making the +* passed socket a candidate that is not yet reachable by the +* collector. It becomes reachable once the embryo is +* enqueued. Therefore, we must ensure that no SCM-laden +* embryo appears in a (candidate) listener's queue between +* consecutive scan_children() calls. */ list_for_each_entry_safe (u, next, &gc_inflight_list, link) { +struct sock *sk = &u->sk;long total_refs; -long inflight_refs; - total_refs =file_count (u->sk.sk_socket->file); - inflight_refs =atomic_long_read (&u->inflight); + total_refs =file_count (sk->sk_socket->file); -BUG_ON (inflight_refs <1 ); -BUG_ON (total_refs < inflight_refs); -if (total_refs == inflight_refs) { +BUG_ON (!u->inflight); +BUG_ON (total_refs < u->inflight); +if (total_refs == u->inflight) {list_move_tail (&u->link, &gc_candidates);__set_bit (UNIX_GC_CANDIDATE , &u->gc_flags);__set_bit (UNIX_GC_MAYBE_CYCLE , &u->gc_flags); + +if (sk->sk_state ==TCP_LISTEN ) { +unix_state_lock_nested (sk,U_LOCK_GC_LISTENER ); +unix_state_unlock (sk); + } } }
@@ -275,7 +290,7 @@ void unix_gc(void)/* Move cursor to after the current position. */ list_move (&cursor, &u->link); -if (atomic_long_read (&u->inflight) >0 ) { +if (u->inflight) {list_move_tail (&u->link, ¬_cycle_list);__clear_bit (UNIX_GC_MAYBE_CYCLE , &u->gc_flags);scan_children (&u->sk, inc_inflight_move_tail,NULL );
net/unix/scm.c +5 -3
@@ -50,12 +50,13 @@ void unix_inflight(struct user_struct *user, struct file *fp)if (s) {struct unix_sock *u =unix_sk (s); -if (atomic_long_inc_return (&u->inflight) ==1 ) { +if (!u->inflight) {BUG_ON (!list_empty (&u->link));list_add_tail (&u->link, &gc_inflight_list); }else {BUG_ON (list_empty (&u->link)); } + u->inflight++;/* Paired with READ_ONCE() in wait_for_unix_gc() */ WRITE_ONCE (unix_tot_inflight, unix_tot_inflight +1 ); }
@@ -72,10 +73,11 @@ void unix_notinflight(struct user_struct *user, struct file *fp)if (s) {struct unix_sock *u =unix_sk (s); -BUG_ON (!atomic_long_read (&u->inflight)); +BUG_ON (!u->inflight);BUG_ON (list_empty (&u->link)); -if (atomic_long_dec_and_test (&u->inflight)) + u->inflight--; +if (!u->inflight)list_del_init (&u->link);/* Paired with READ_ONCE() in wait_for_unix_gc() */ WRITE_ONCE (unix_tot_inflight, unix_tot_inflight -1 );
net/wireless/nl80211.c +2 -0
@@ -11492,6 +11492,8 @@ static int nl80211_set_coalesce(struct sk_buff *skb, struct genl_info *info) error:for (i =0 ; i < new_coalesce.n_rules; i++) { tmp_rule = &new_coalesce.rules[i]; +if (!tmp_rule) +continue ;for (j =0 ; j < tmp_rule->n_patterns; j++)kfree (tmp_rule->patterns[j].mask);kfree (tmp_rule->patterns);
sound/usb/line6/driver.c +3 -3
@@ -216,7 +216,7 @@ int line6_send_raw_message_async(struct usb_line6 *line6, const char *buffer,struct urb *urb;/* create message: */ - msg =kmalloc (sizeof (struct message ),GFP_ATOMIC ); + msg =kzalloc (sizeof (struct message ),GFP_ATOMIC );if (msg ==NULL )return -ENOMEM ;
@@ -694,7 +694,7 @@ static int line6_init_cap_control(struct usb_line6 *line6)int ret;/* initialize USB buffers: */ - line6->buffer_listen =kmalloc (LINE6_BUFSIZE_LISTEN ,GFP_KERNEL ); + line6->buffer_listen =kzalloc (LINE6_BUFSIZE_LISTEN ,GFP_KERNEL );if (!line6->buffer_listen)return -ENOMEM ;
@@ -703,7 +703,7 @@ static int line6_init_cap_control(struct usb_line6 *line6)return -ENOMEM ;if (line6->properties->capabilities &LINE6_CAP_CONTROL_MIDI ) { - line6->buffer_message =kmalloc (LINE6_MIDI_MESSAGE_MAXLEN ,GFP_KERNEL ); + line6->buffer_message =kzalloc (LINE6_MIDI_MESSAGE_MAXLEN ,GFP_KERNEL );if (!line6->buffer_message)return -ENOMEM ;
tools/power/x86/turbostat/turbostat.8 +1 -1
@@ -318,7 +318,7 @@ below the processor's base frequency. Busy% = MPERF_delta/TSC_delta -Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval +Bzy_MHz = TSC_delta*APERF_delta/MPERF_delta/measurement_interval Note that these calculations depend on TSC_delta, so they are not reliable during intervals when TSC_MHz is not running at the base frequency.
tools/power/x86/turbostat/turbostat.c +4 -3
@@ -1524,9 +1524,10 @@ int sum_counters(struct thread_data *t, struct core_data *c, average.packages.rapl_dram_perf_status += p->rapl_dram_perf_status;for (i =0 , mp = sys.pp; mp; i++, mp = mp->next) { -if (mp->format ==FORMAT_RAW ) -continue ; - average.packages.counter[i] += p->counter[i]; +if ((mp->format ==FORMAT_RAW ) && (topo.num_packages ==0 )) + average.packages.counter[i] = p->counter[i]; +else + average.packages.counter[i] += p->counter[i]; }return 0 ; }
tools/testing/selftests/timers/valid-adjtimex.c +36 -37
90 lines not on this page · raw message