Linux 4.20.17
Greg KH
maintainerI'm announcing the release of the 4.20.17 kernel.
Note, this is the LAST release of the 4.20.y kernel. It is now end-of-life, please move to the 5.0.y kernel tree at this point in time.
All users of the 4.20 kernel series must upgrade.
The updated 4.20.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.20.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/x86/events/intel/core.c | 4 arch/x86/events/perf_event.h | 4 drivers/connector/cn_proc.c | 22 ++++ drivers/gpu/drm/drm_atomic_helper.c | 9 ++ drivers/md/raid10.c | 1 drivers/net/bonding/bond_main.c | 35 +++---- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 3 drivers/net/ethernet/mellanox/mlx4/cmd.c | 9 ++ drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 6 - drivers/net/ethernet/microchip/lan743x_main.c | 55 +++++++----- drivers/net/ethernet/renesas/ravb_main.c | 2 drivers/net/ipvlan/ipvlan_main.c | 4 drivers/net/phy/mdio_bus.c | 1 drivers/net/ppp/pptp.c | 1 drivers/net/team/team.c | 4 drivers/net/vxlan.c | 14 ++- drivers/vhost/vsock.c | 2 fs/f2fs/file.c | 12 +- net/core/gro_cells.c | 22 ++++ net/hsr/hsr_device.c | 18 ++-- net/hsr/hsr_framereg.c | 12 ++ net/hsr/hsr_framereg.h | 1 net/ipv4/route.c | 13 ++ net/ipv4/syncookies.c | 7 + net/ipv4/tcp.c | 5 + net/ipv4/tcp_input.c | 8 + net/ipv4/tcp_ipv4.c | 9 -- net/ipv4/tcp_output.c | 1 net/ipv6/route.c | 32 +++++-- net/ipv6/sit.c | 5 - net/l2tp/l2tp_ip6.c | 4 net/rxrpc/conn_client.c | 4 net/sched/cls_flower.c | 43 ++++----- net/sctp/stream.c | 2 net/smc/smc.h | 6 - net/unix/af_unix.c | 57 +++++++----- net/unix/diag.c | 3 net/x25/af_x25.c | 20 +++- security/lsm_audit.c | 10 +- sound/firewire/bebob/bebob.c | 14 ++- sound/firewire/motu/amdtp-motu.c | 4 sound/hda/hdac_i915.c | 4 sound/pci/hda/patch_conexant.c | 3 sound/pci/hda/patch_realtek.c | 80 ++++++++++++------ 45 files changed, 377 insertions(+), 200 deletions(-)
Al Viro (1):
missing barriers in some of unix_sock ->addr and ->path accesses
Bryan Whitehead (2):
lan743x: Fix RX Kernel Panic
lan743x: Fix TX Stall Issue
Christoph Paasch (1):
tcp: Don't access TCP_SKB_CB before initializing it
Daniel Borkmann (1):
ipvlan: disallow userns cap_net_admin to change global mode/flags
David Howells (1):
rxrpc: Fix client call queueing, waiting for channel
Eric Dumazet (8):
gro_cells: make sure device is up in gro_cells_receive()
l2tp: fix infoleak in l2tp_ip6_recvmsg()
net/hsr: fix possible crash in add_timer()
net/x25: fix use-after-free in x25_device_event() net/x25: reset state in x25_connect()
vxlan: test dev->flags & IFF_UP before calling gro_cells_receive()
tcp: repaired skbs must init their tso_segs
net/x25: fix a race in x25_bind()
George Wilkie (1):
team: use operstate consistently for linkup
Greg Kroah-Hartman (1):
Linux 4.20.17
Guillaume Nault (1):
tcp: handle inet_csk_reqsk_queue_add() failures
Jack Morgenstein (3):
net/mlx4_core: Fix reset flow when in command polling mode net/mlx4_core: Fix locking in SRIOV mode when switching between events and polling net/mlx4_core: Fix qp mtt size calculation
Jaegeuk Kim (1):
f2fs: wait on atomic writes to count F2FS_CP_WB_DATA
Jaroslav Kysela (1):
ALSA: hda - add more quirks for HP Z2 G4 and HP Z240
Jian Shen (1):
net: hns3: add dma_rmb() for rx description
Jian-Hong Pan (2):
ALSA: hda/realtek: Enable audio jacks of ASUS UX362FA with ALC294
ALSA: hda/realtek: Enable headset MIC of Acer TravelMate X514-51T with ALC255
Kalash Nainwal (1):
net: Set rtm_table to RT_TABLE_COMPAT for ipv6 for tables > 255
Li RongQing (1):
connector: fix unsafe usage of ->real_parent
Mao Wenan (1):
net: hsr: fix memory leak in hsr_dev_finalize()
Masaru Nagai (1):
ravb: Decrease TxFIFO depth of Q3 and Q2 to one
Miaohe Lin (1):
net: sit: fix UBSAN Undefined behaviour in check_6rd
Michal Soltys (1):
bonding: fix PACKET_ORIGDEV regression
Nicholas Kazlauskas (1):
drm: Block fb changes for async plane updates
Paolo Abeni (4):
ipv4/route: fail early when inet dev is missing
ipv6: route: purge exception on removal
ipv6: route: enforce RCU protection in rt6_update_exception_stamp_rt()
ipv6: route: enforce RCU protection in ip6_route_check_nh_onlink()
Peter Zijlstra (2):
perf/x86: Fixup typo in stub functions
perf/x86/intel: Fix memory corruption
Soheil Hassas Yeganeh (1):
tcp: do not report TCP_CM_INQ of 0 for closed connections
Stefano Brivio (1):
vxlan: Fix GRO cells race condition between receive and link delete
Takashi Iwai (2):
ALSA: hda: Extend i915 component bind timeout
ALSA: hda/realtek - Reduce click noise on Dell Precision 5820 headphone
Takashi Sakamoto (2):
ALSA: bebob: use more identical mod_alias for Saffire Pro 10 I/O against Liquid Saffire 56
ALSA: firewire-motu: fix construction of PCM frame for capture direction
Ursula Braun (1):
net/smc: fix smc_poll in SMC_INIT state
Vlad Buslov (1):
net: sched: flower: insert new filter to idr after setting its mask
Xiao Ni (1):
It's wrong to add len to sector_nr in raid10 reshape twice
Xin Long (3):
pptp: dst_release sk_dst_cache in pptp_sock_destruct
route: set the deleted fnhe fnhe_daddr to 0 in ip_del_fnhe to fix a race
sctp: remove sched init from sctp_stream_init
YueHaibing (1):
mdio_bus: Fix use-after-free on device_register fails
Zha Bin (1):
vhost/vsock: fix vhost vsock cid hashing inconsistent
kbuild test robot (1):
perf/x86/intel: Make dev_attr_allow_tsx_force_abort static
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 20 -SUBLEVEL = 16 +SUBLEVEL = 17 EXTRAVERSION = NAME = Shy Crocodile
arch/x86/events/intel/core.c +2 -2
@@ -3398,7 +3398,7 @@ tfa_get_event_constraints(struct cpu_hw_events *cpuc, int idx,/* * Without TFA we must not use PMC3. */ -if (!allow_tsx_force_abort &&test_bit (3 , c->idxmsk)) { +if (!allow_tsx_force_abort &&test_bit (3 , c->idxmsk) && idx >=0 ) { c =dyn_constraint (cpuc, c, idx); c->idxmsk64 &= ~(1ULL <<3 ); c->weight--;
@@ -4142,7 +4142,7 @@ static struct attribute *intel_pmu_caps_attrs[] = {NULL }; -DEVICE_BOOL_ATTR (allow_tsx_force_abort,0644 , allow_tsx_force_abort); +static DEVICE_BOOL_ATTR(allow_tsx_force_abort, 0644, allow_tsx_force_abort);static struct attribute *intel_pmu_attrs[] = { &dev_attr_freeze_on_smi.attr,
arch/x86/events/perf_event.h +2 -2
@@ -1032,12 +1032,12 @@ static inline int intel_pmu_init(void)return 0 ; } -static inline int intel_cpuc_prepare (struct cpu_hw_event *cpuc,int cpu) +static inline int intel_cpuc_prepare (struct cpu_hw_events *cpuc,int cpu) {return 0 ; } -static inline void intel_cpuc_finish (struct cpu_hw_event *cpuc) +static inline void intel_cpuc_finish (struct cpu_hw_events *cpuc) { }
drivers/connector/cn_proc.c +18 -4
@@ -250,6 +250,7 @@ void proc_coredump_connector(struct task_struct *task) {struct cn_msg *msg;struct proc_event *ev; +struct task_struct *parent;__u8 buffer[CN_PROC_MSG_SIZE ]__aligned(8) ;if (atomic_read (&proc_event_num_listeners) <1 )
@@ -262,8 +263,14 @@ void proc_coredump_connector(struct task_struct *task) ev->what =PROC_EVENT_COREDUMP ; ev->event_data.coredump.process_pid = task->pid; ev->event_data.coredump.process_tgid = task->tgid; - ev->event_data.coredump.parent_pid = task->real_parent->pid; - ev->event_data.coredump.parent_tgid = task->real_parent->tgid; + +rcu_read_lock (); +if (pid_alive (task)) { + parent =rcu_dereference (task->real_parent); + ev->event_data.coredump.parent_pid = parent->pid; + ev->event_data.coredump.parent_tgid = parent->tgid; + } +rcu_read_unlock ();memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack =0 ;/* not used */
@@ -276,6 +283,7 @@ void proc_exit_connector(struct task_struct *task) {struct cn_msg *msg;struct proc_event *ev; +struct task_struct *parent;__u8 buffer[CN_PROC_MSG_SIZE ]__aligned(8) ;if (atomic_read (&proc_event_num_listeners) <1 )
@@ -290,8 +298,14 @@ void proc_exit_connector(struct task_struct *task) ev->event_data.exit.process_tgid = task->tgid; ev->event_data.exit.exit_code = task->exit_code; ev->event_data.exit.exit_signal = task->exit_signal; - ev->event_data.exit.parent_pid = task->real_parent->pid; - ev->event_data.exit.parent_tgid = task->real_parent->tgid; + +rcu_read_lock (); +if (pid_alive (task)) { + parent =rcu_dereference (task->real_parent); + ev->event_data.exit.parent_pid = parent->pid; + ev->event_data.exit.parent_tgid = parent->tgid; + } +rcu_read_unlock ();memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack =0 ;/* not used */
drivers/gpu/drm/drm_atomic_helper.c +9 -0
@@ -1593,6 +1593,15 @@ int drm_atomic_helper_async_check(struct drm_device *dev,if (old_plane_state->fb != new_plane_state->fb)return -EINVAL ; +/* +* FIXME: Since prepare_fb and cleanup_fb are always called on +* the new_plane_state for async updates we need to block framebuffer +* changes. This prevents use of a fb that's been cleaned up and +* double cleanups from occuring. +*/ +if (old_plane_state->fb != new_plane_state->fb) +return -EINVAL ; + funcs = plane->helper_private;if (!funcs->atomic_async_update)return -EINVAL ;
drivers/md/raid10.c +0 -1
@@ -4692,7 +4692,6 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,atomic_inc (&r10_bio->remaining); read_bio->bi_next =NULL ;generic_make_request (read_bio); - sector_nr += nr_sectors; sectors_done += nr_sectors;if (sector_nr <= last) goto read_more;
drivers/net/bonding/bond_main.c +14 -21
@@ -1172,29 +1172,22 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) } } -/* Link-local multicast packets should be passed to the -* stack on the link they arrive as well as pass them to the -* bond-master device. These packets are mostly usable when -* stack receives it with the link on which they arrive -* (e.g. LLDP) they also must be available on master. Some of -* the use cases include (but are not limited to): LLDP agents -* that must be able to operate both on enslaved interfaces as -* well as on bonds themselves; linux bridges that must be able -* to process/pass BPDUs from attached bonds when any kind of -* STP version is enabled on the network. +/* +* For packets determined by bond_should_deliver_exact_match() call to +* be suppressed we want to make an exception for link-local packets. +* This is necessary for e.g. LLDP daemons to be able to monitor +* inactive slave links without being forced to bind to them +* explicitly. +* +* At the same time, packets that are passed to the bonding master +* (including link-local ones) can have their originating interface +* determined via PACKET_ORIGDEV socket option. */ -if (is_link_local_ether_addr (eth_hdr (skb)->h_dest)) { -struct sk_buff *nskb =skb_clone (skb,GFP_ATOMIC ); - -if (nskb) { - nskb->dev = bond->dev; - nskb->queue_mapping =0 ; -netif_rx (nskb); - } -return RX_HANDLER_PASS ; - } -if (bond_should_deliver_exact_match (skb, slave, bond)) +if (bond_should_deliver_exact_match (skb, slave, bond)) { +if (is_link_local_ether_addr (eth_hdr (skb)->h_dest)) +return RX_HANDLER_PASS ;return RX_HANDLER_EXACT ; + } skb->dev = bond->dev;
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +3 -0
@@ -2373,6 +2373,9 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring, length =le16_to_cpu (desc->rx.size); bd_base_info =le32_to_cpu (desc->rx.bd_base_info); +/* make sure HW write desc complete */ +dma_rmb (); +/* Check valid BD */ if (unlikely (!hnae3_get_bit (bd_base_info,HNS3_RXD_VLD_B )))return -EFAULT ;
drivers/net/ethernet/mellanox/mlx4/cmd.c +9 -0
@@ -2645,6 +2645,8 @@ int mlx4_cmd_use_events(struct mlx4_dev *dev)if (!priv->cmd.context)return -ENOMEM ; +if (mlx4_is_mfunc (dev)) +mutex_lock (&priv->cmd.slave_cmd_mutex);down_write (&priv->cmd.switch_sem);for (i =0 ; i < priv->cmd.max_cmds; ++i) { priv->cmd.context[i].token = i;
@@ -2670,6 +2672,8 @@ int mlx4_cmd_use_events(struct mlx4_dev *dev)down (&priv->cmd.poll_sem); priv->cmd.use_events =1 ;up_write (&priv->cmd.switch_sem); +if (mlx4_is_mfunc (dev)) +mutex_unlock (&priv->cmd.slave_cmd_mutex);return err; }
@@ -2682,6 +2686,8 @@ void mlx4_cmd_use_polling(struct mlx4_dev *dev)struct mlx4_priv *priv =mlx4_priv (dev);int i; +if (mlx4_is_mfunc (dev)) +mutex_lock (&priv->cmd.slave_cmd_mutex);down_write (&priv->cmd.switch_sem); priv->cmd.use_events =0 ;
@@ -2689,9 +2695,12 @@ void mlx4_cmd_use_polling(struct mlx4_dev *dev)down (&priv->cmd.event_sem);kfree (priv->cmd.context); + priv->cmd.context =NULL ;up (&priv->cmd.poll_sem);up_write (&priv->cmd.switch_sem); +if (mlx4_is_mfunc (dev)) +mutex_unlock (&priv->cmd.slave_cmd_mutex); }struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox (struct mlx4_dev *dev)
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +3 -3
@@ -2719,13 +2719,13 @@ static int qp_get_mtt_size(struct mlx4_qp_context *qpc)int total_pages;int total_mem;int page_offset = (be32_to_cpu (qpc->params2) >>6 ) &0x3f ; +int tot; sq_size =1 << (log_sq_size + log_sq_sride +4 ); rq_size = (srq|rss|xrc) ?0 : (1 << (log_rq_size + log_rq_stride +4 )); total_mem = sq_size + rq_size; - total_pages = -roundup_pow_of_two ((total_mem + (page_offset <<6 )) >> - page_shift); + tot = (total_mem + (page_offset <<6 )) >> page_shift; + total_pages = !tot ?1 :roundup_pow_of_two (tot);return total_pages; }
drivers/net/ethernet/microchip/lan743x_main.c +33 -22
117 lines not on this page · raw message
drivers/net/ethernet/renesas/ravb_main.c +1 -1
@@ -467,7 +467,7 @@ static int ravb_dmac_init(struct net_device *ndev) RCR_EFFS | RCR_ENCF | RCR_ETS0 | RCR_ESF | 0x18000000, RCR);/* Set FIFO size */ -ravb_write (ndev,TGC_TQP_AVBMODE1 |0x00222200 ,TGC ); +ravb_write (ndev,TGC_TQP_AVBMODE1 |0x00112200 ,TGC );/* Timestamp enable */ ravb_write (ndev,TCCR_TFEN ,TCCR );
drivers/net/ipvlan/ipvlan_main.c +4 -0
@@ -494,6 +494,8 @@ static int ipvlan_nl_changelink(struct net_device *dev,if (!data)return 0 ; +if (!ns_capable (dev_net (ipvlan->phy_dev)->user_ns,CAP_NET_ADMIN )) +return -EPERM ;if (data[IFLA_IPVLAN_MODE ]) {u16 nmode =nla_get_u16 (data[IFLA_IPVLAN_MODE ]);
@@ -596,6 +598,8 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev,struct ipvl_dev *tmp =netdev_priv (phy_dev); phy_dev = tmp->phy_dev; +if (!ns_capable (dev_net (phy_dev)->user_ns,CAP_NET_ADMIN )) +return -EPERM ; }else if (!netif_is_ipvlan_port (phy_dev)) {/* Exit early if the underlying link is invalid or busy */ if (phy_dev->type != ARPHRD_ETHER ||
drivers/net/phy/mdio_bus.c +0 -1
@@ -379,7 +379,6 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) err =device_register (&bus->dev);if (err) {pr_err ("mii_bus %s failed to register\n" , bus->id); -put_device (&bus->dev);return -EINVAL ; }
drivers/net/ppp/pptp.c +1 -0
@@ -537,6 +537,7 @@ static void pptp_sock_destruct(struct sock *sk)pppox_unbind_sock (sk); }skb_queue_purge (&sk->sk_receive_queue); +dst_release (rcu_dereference_protected (sk->sk_dst_cache,1 )); }static int pptp_create (struct net *net,struct socket *sock,int kern)
drivers/net/team/team.c +2 -2
@@ -1256,7 +1256,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev,list_add_tail_rcu (&port->list, &team->port_list);team_port_enable (team, port);__team_compute_features (team); -__team_port_change_port_added (port, !!netif_carrier_ok (port_dev)); +__team_port_change_port_added (port, !!netif_oper_up (port_dev));__team_options_change_check (team);netdev_info (dev,"Port device %s added\n" , portname);
@@ -2915,7 +2915,7 @@ static int team_device_event(struct notifier_block *unused,switch (event) {case NETDEV_UP : -if (netif_carrier_ok (dev)) +if (netif_oper_up (dev))team_port_change_check (port, true);break ;case NETDEV_DOWN :
drivers/net/vxlan.c +13 -1
@@ -1538,6 +1538,14 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb) goto drop; } +rcu_read_lock (); + +if (unlikely (!(vxlan->dev->flags &IFF_UP ))) { +rcu_read_unlock (); +atomic_long_inc (&vxlan->dev->rx_dropped); + goto drop; + } + stats =this_cpu_ptr (vxlan->dev->tstats);u64_stats_update_begin (&stats->syncp); stats->rx_packets++;
@@ -1545,6 +1553,9 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)u64_stats_update_end (&stats->syncp);gro_cells_receive (&vxlan->gro_cells, skb); + +rcu_read_unlock (); +return 0 ; drop:
@@ -2529,6 +2540,8 @@ static void vxlan_uninit(struct net_device *dev) {struct vxlan_dev *vxlan =netdev_priv (dev); +gro_cells_destroy (&vxlan->gro_cells); +vxlan_fdb_delete_default (vxlan, vxlan->cfg.vni);free_percpu (dev->tstats);
@@ -3601,7 +3614,6 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head)vxlan_flush (vxlan, true); -gro_cells_destroy (&vxlan->gro_cells);list_del (&vxlan->next);unregister_netdevice_queue (dev, head); }
drivers/vhost/vsock.c +1 -1
@@ -642,7 +642,7 @@ static int vhost_vsock_set_cid(struct vhost_vsock *vsock, u64 guest_cid)hash_del_rcu (&vsock->hash); vsock->guest_cid = guest_cid; -hash_add_rcu (vhost_vsock_hash, &vsock->hash, guest_cid); +hash_add_rcu (vhost_vsock_hash, &vsock->hash, vsock->guest_cid);spin_unlock_bh (&vhost_vsock_lock);return 0 ;
fs/f2fs/file.c +7 -5
@@ -1749,10 +1749,12 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)down_write (&F2FS_I (inode)->i_gc_rwsem[WRITE ]); -if (!get_dirty_pages (inode)) - goto skip_flush; - -f2fs_msg (F2FS_I_SB (inode)->sb,KERN_WARNING , +/* +* Should wait end_io to count F2FS_WB_CP_DATA correctly by +* f2fs_is_atomic_file. +*/ +if (get_dirty_pages (inode)) +f2fs_msg (F2FS_I_SB (inode)->sb,KERN_WARNING ,"Unexpected flush for atomic writes: ino=%lu, npages=%u" , inode->i_ino,get_dirty_pages (inode)); ret =filemap_write_and_wait_range (inode->i_mapping,0 ,LLONG_MAX );
@@ -1760,7 +1762,7 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)up_write (&F2FS_I (inode)->i_gc_rwsem[WRITE ]); goto out; } -skip_flush: +set_inode_flag (inode,FI_ATOMIC_FILE );clear_inode_flag (inode,FI_ATOMIC_REVOKE_REQUEST );up_write (&F2FS_I (inode)->i_gc_rwsem[WRITE ]);
net/core/gro_cells.c +18 -4
@@ -13,22 +13,36 @@ int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) {struct net_device *dev = skb->dev;struct gro_cell *cell; +int res; -if (!gcells->cells ||skb_cloned (skb) ||netif_elide_gro (dev)) -return netif_rx (skb); +rcu_read_lock (); +if (unlikely (!(dev->flags &IFF_UP ))) + goto drop; + +if (!gcells->cells ||skb_cloned (skb) ||netif_elide_gro (dev)) { + res =netif_rx (skb); + goto unlock; + } cell =this_cpu_ptr (gcells->cells);if (skb_queue_len (&cell->napi_skbs) > netdev_max_backlog) { +drop:atomic_long_inc (&dev->rx_dropped);kfree_skb (skb); -return NET_RX_DROP ; + res =NET_RX_DROP ; + goto unlock; }__skb_queue_tail (&cell->napi_skbs, skb);if (skb_queue_len (&cell->napi_skbs) ==1 )napi_schedule (&cell->napi); -return NET_RX_SUCCESS ; + + res =NET_RX_SUCCESS ; + +unlock: +rcu_read_unlock (); +return res; }EXPORT_SYMBOL (gro_cells_receive);
net/hsr/hsr_device.c +9 -9
@@ -94,9 +94,8 @@ static void hsr_check_announce(struct net_device *hsr_dev, && (old_operstate != IF_OPER_UP)) {/* Went up */ hsr->announce_count =0 ; - hsr->announce_timer.expires = jiffies + -msecs_to_jiffies (HSR_ANNOUNCE_INTERVAL ); -add_timer (&hsr->announce_timer); +mod_timer (&hsr->announce_timer, + jiffies +msecs_to_jiffies (HSR_ANNOUNCE_INTERVAL )); }if ((hsr_dev->operstate !=IF_OPER_UP ) && (old_operstate ==IF_OPER_UP ))
@@ -332,6 +331,7 @@ static void hsr_announce(struct timer_list *t) {struct hsr_priv *hsr;struct hsr_port *master; +unsigned long interval; hsr =from_timer (hsr, t, announce_timer);
@@ -343,18 +343,16 @@ static void hsr_announce(struct timer_list *t) hsr->protVersion); hsr->announce_count++; - hsr->announce_timer.expires = jiffies + -msecs_to_jiffies (HSR_ANNOUNCE_INTERVAL ); + interval =msecs_to_jiffies (HSR_ANNOUNCE_INTERVAL ); }else {send_hsr_supervision_frame (master,HSR_TLV_LIFE_CHECK , hsr->protVersion); - hsr->announce_timer.expires = jiffies + -msecs_to_jiffies (HSR_LIFE_CHECK_INTERVAL ); + interval =msecs_to_jiffies (HSR_LIFE_CHECK_INTERVAL ); }if (is_admin_up (master->dev)) -add_timer (&hsr->announce_timer); +mod_timer (&hsr->announce_timer, jiffies + interval);rcu_read_unlock (); }
@@ -486,7 +484,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], res =hsr_add_port (hsr, hsr_dev,HSR_PT_MASTER );if (res) -return res; + goto err_add_port; res =register_netdevice (hsr_dev);if (res)
@@ -506,6 +504,8 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], fail:hsr_for_each_port (hsr, port)hsr_del_port (port); +err_add_port: +hsr_del_node (&hsr->self_node_db);return res; }
net/hsr/hsr_framereg.c +12 -0
@@ -124,6 +124,18 @@ int hsr_create_self_node(struct list_head *self_node_db,return 0 ; } +void hsr_del_node (struct list_head *self_node_db) +{ +struct hsr_node *node; + +rcu_read_lock (); + node = list_first_or_null_rcu(self_node_db, struct hsr_node, mac_list); +rcu_read_unlock (); +if (node) { +list_del_rcu (&node->mac_list); +kfree (node); + } +}/* Allocate an hsr_node and add it to node_db. 'addr' is the node's AddressA; * seq_out is used to initialize filtering of outgoing duplicate frames
net/hsr/hsr_framereg.h +1 -0
@@ -16,6 +16,7 @@struct hsr_node ; +void hsr_del_node (struct list_head *self_node_db);struct hsr_node *hsr_add_node (struct list_head *node_db,unsigned char addr[],u16 seq_out); struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb,
net/ipv4/route.c +9 -4
@@ -1303,6 +1303,10 @@ static void ip_del_fnhe(struct fib_nh *nh, __be32 daddr)if (fnhe->fnhe_daddr == daddr) {rcu_assign_pointer (*fnhe_p,rcu_dereference_protected ( fnhe->fnhe_next,lockdep_is_held (&fnhe_lock))); +/* set fnhe_daddr to 0 to ensure it won't bind with +* new dsts in rt_bind_exception(). +*/ + fnhe->fnhe_daddr =0 ;fnhe_flush_routes (fnhe);kfree_rcu (fnhe, rcu);break ;
@@ -2144,12 +2148,13 @@ int ip_route_input_rcu(struct sk_buff *skb, __be32 daddr, __be32 saddr,int our =0 ;int err = -EINVAL ; -if (in_dev) - our =ip_check_mc_rcu (in_dev, daddr, saddr, -ip_hdr (skb)->protocol); +if (!in_dev) +return err; + our =ip_check_mc_rcu (in_dev, daddr, saddr, +ip_hdr (skb)->protocol);/* check l3 master if no match yet */ -if ((!in_dev || !our) &&netif_is_l3_slave (dev)) { +if (!our &&netif_is_l3_slave (dev)) {struct in_device *l3_in_dev; l3_in_dev =__in_dev_get_rcu (skb->dev);
net/ipv4/syncookies.c +6 -1
@@ -216,7 +216,12 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb,refcount_set (&req->rsk_refcnt,1 );tcp_sk (child)->tsoffset = tsoff;sock_rps_save_rxhash (child, skb); -inet_csk_reqsk_queue_add (sk, req, child); +if (!inet_csk_reqsk_queue_add (sk, req, child)) { +bh_unlock_sock (child); +sock_put (child); + child =NULL ; +reqsk_put (req); + } }else {reqsk_free (req); }
net/ipv4/tcp.c +5 -0
@@ -1914,6 +1914,11 @@ static int tcp_inq_hint(struct sock *sk) inq = tp->rcv_nxt - tp->copied_seq;release_sock (sk); } +/* After receiving a FIN, tell the user-space to continue reading +* by returning a non-zero inq. +*/ +if (inq ==0 &&sock_flag (sk,SOCK_DONE )) + inq =1 ;return inq; }
net/ipv4/tcp_input.c +7 -1
@@ -6511,7 +6511,13 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, af_ops->send_synack (fastopen_sk, dst, &fl, req, &foc,TCP_SYNACK_FASTOPEN );/* Add the child socket directly into the accept queue */ -inet_csk_reqsk_queue_add (sk, req, fastopen_sk); +if (!inet_csk_reqsk_queue_add (sk, req, fastopen_sk)) { +reqsk_fastopen_remove (fastopen_sk, req, false); +bh_unlock_sock (fastopen_sk); +sock_put (fastopen_sk); +reqsk_put (req); + goto drop; + } sk->sk_data_ready (sk);bh_unlock_sock (fastopen_sk);sock_put (fastopen_sk);
net/ipv4/tcp_ipv4.c +1 -8
@@ -1646,15 +1646,8 @@ EXPORT_SYMBOL(tcp_add_backlog);int tcp_filter (struct sock *sk,struct sk_buff *skb) {struct tcphdr *th = (struct tcphdr *)skb->data; -unsigned int eaten = skb->len; -int err; - err =sk_filter_trim_cap (sk, skb, th->doff *4 ); -if (!err) { - eaten -= skb->len; -TCP_SKB_CB (skb)->end_seq -= eaten; - } -return err; +return sk_filter_trim_cap (sk, skb, th->doff *4 ); }EXPORT_SYMBOL (tcp_filter);
net/ipv4/tcp_output.c +1 -0
@@ -2341,6 +2341,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,/* "skb_mstamp_ns" is used as a start point for the retransmit timer */ skb->skb_mstamp_ns = tp->tcp_wstamp_ns = tp->tcp_clock_cache;list_move_tail (&skb->tcp_tsorted_anchor, &tp->tsorted_sent_queue); +tcp_init_tso_segs (skb, mss_now); goto repair;/* Skip network transmission */ }
net/ipv6/route.c +24 -8
@@ -1272,18 +1272,29 @@ static DEFINE_SPINLOCK(rt6_exception_lock);static void rt6_remove_exception (struct rt6_exception_bucket *bucket,struct rt6_exception *rt6_ex) { +struct fib6_info *from;struct net *net;if (!bucket || !rt6_ex)return ; net =dev_net (rt6_ex->rt6i->dst.dev); + net->ipv6.rt6_stats->fib_rt_cache--; + +/* purge completely the exception to allow releasing the held resources: +* some [sk] cache may keep the dst around for unlimited time +*/ + from =rcu_dereference_protected (rt6_ex->rt6i->from, +lockdep_is_held (&rt6_exception_lock)); +rcu_assign_pointer (rt6_ex->rt6i->from,NULL ); +fib6_info_release (from); +dst_dev_put (&rt6_ex->rt6i->dst); +hlist_del_rcu (&rt6_ex->hlist);dst_release (&rt6_ex->rt6i->dst);kfree_rcu (rt6_ex, rcu);WARN_ON_ONCE (!bucket->depth); bucket->depth--; - net->ipv6.rt6_stats->fib_rt_cache--; }/* Remove oldest rt6_ex in bucket and free the memory
@@ -1597,15 +1608,15 @@ static int rt6_remove_exception_rt(struct rt6_info *rt)static void rt6_update_exception_stamp_rt (struct rt6_info *rt) {struct rt6_exception_bucket *bucket; -struct fib6_info *from = rt->from;struct in6_addr *src_key =NULL ;struct rt6_exception *rt6_ex; - -if (!from || - !(rt->rt6i_flags &RTF_CACHE )) -return ; +struct fib6_info *from;rcu_read_lock (); + from =rcu_dereference (rt->from); +if (!from || !(rt->rt6i_flags &RTF_CACHE )) + goto unlock; + bucket =rcu_dereference (from->rt6i_exception_bucket);#ifdef CONFIG_IPV6_SUBTREES
@@ -1624,6 +1635,7 @@ static void rt6_update_exception_stamp_rt(struct rt6_info *rt)if (rt6_ex) rt6_ex->stamp = jiffies; +unlock:rcu_read_unlock (); }
@@ -2740,20 +2752,24 @@ static int ip6_route_check_nh_onlink(struct net *net,u32 tbid =l3mdev_fib_table (dev) ? :RT_TABLE_MAIN ;const struct in6_addr *gw_addr = &cfg->fc_gateway;u32 flags =RTF_LOCAL |RTF_ANYCAST |RTF_REJECT ; +struct fib6_info *from;struct rt6_info *grt;int err; err =0 ; grt =ip6_nh_lookup_table (net, cfg, gw_addr, tbid,0 );if (grt) { +rcu_read_lock (); + from =rcu_dereference (grt->from);if (!grt->dst.error &&/* ignore match if it is the default route */ - grt->from && !ipv6_addr_any (&grt->from->fib6_dst.addr) && + from && !ipv6_addr_any (&from->fib6_dst.addr) && (grt->rt6i_flags & flags || dev != grt->dst.dev)) {NL_SET_ERR_MSG (extack,"Nexthop has invalid gateway or device mismatch" ); err = -EINVAL ; } +rcu_read_unlock ();ip6_rt_put (grt); }
@@ -4660,7 +4676,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb, table = rt->fib6_table->tb6_id; else table =RT6_TABLE_UNSPEC ; - rtm->rtm_table = table; + rtm->rtm_table = table <256 ? table :RT_TABLE_COMPAT ;if (nla_put_u32 (skb,RTA_TABLE , table)) goto nla_put_failure;
net/ipv6/sit.c +3 -2
@@ -778,8 +778,9 @@ static bool check_6rd(struct ip_tunnel *tunnel, const struct in6_addr *v6dst, pbw0 = tunnel->ip6rd.prefixlen >>5 ; pbi0 = tunnel->ip6rd.prefixlen &0x1f ; - d = (ntohl (v6dst->s6_addr32[pbw0]) << pbi0) >> - tunnel->ip6rd.relay_prefixlen; + d = tunnel->ip6rd.relay_prefixlen <32 ? + (ntohl (v6dst->s6_addr32[pbw0]) << pbi0) >> + tunnel->ip6rd.relay_prefixlen :0 ; pbi1 = pbi0 - tunnel->ip6rd.relay_prefixlen;if (pbi1 >0 )
net/l2tp/l2tp_ip6.c +1 -3
@@ -674,9 +674,6 @@ static int l2tp_ip6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,if (flags &MSG_OOB ) goto out; -if (addr_len) - *addr_len =sizeof (*lsa); -if (flags &MSG_ERRQUEUE )return ipv6_recv_error (sk, msg, len, addr_len);
@@ -706,6 +703,7 @@ static int l2tp_ip6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, lsa->l2tp_conn_id =0 ;if (ipv6_addr_type (&lsa->l2tp_addr) &IPV6_ADDR_LINKLOCAL ) lsa->l2tp_scope_id =inet6_iif (skb); + *addr_len =sizeof (*lsa); }if (np->rxopt.all)
net/rxrpc/conn_client.c +2 -2
@@ -353,7 +353,7 @@ static int rxrpc_get_client_conn(struct rxrpc_sock *rx,* normally have to take channel_lock but we do this before anyone else * can see the connection. */ -list_add_tail (&call->chan_wait_link, &candidate->waiting_calls); +list_add (&call->chan_wait_link, &candidate->waiting_calls);if (cp->exclusive) { call->conn = candidate;
@@ -432,7 +432,7 @@ static int rxrpc_get_client_conn(struct rxrpc_sock *rx, call->conn = conn; call->security_ix = conn->security_ix; call->service_id = conn->service_id; -list_add (&call->chan_wait_link, &conn->waiting_calls); +list_add_tail (&call->chan_wait_link, &conn->waiting_calls);spin_unlock (&conn->channel_lock);_leave (" = 0 [extant %d]" , conn->debug_id);return 0 ;
net/sched/cls_flower.c +22 -21
80 lines not on this page · raw message
net/sctp/stream.c +0 -2
@@ -230,8 +230,6 @@ int sctp_stream_init(struct sctp_stream *stream, __u16 outcnt, __u16 incnt,for (i =0 ; i < stream->outcnt; i++)SCTP_SO (stream, i)->state =SCTP_STREAM_OPEN ; - sched->init (stream); - in:sctp_stream_interleave_init (stream);if (!incnt)
net/smc/smc.h +3 -3
@@ -113,9 +113,9 @@ struct smc_host_cdc_msg { /* Connection Data Control message */ }__aligned(8) ;enum smc_urg_state { -SMC_URG_VALID ,/* data present */ -SMC_URG_NOTYET ,/* data pending */ -SMC_URG_READ /* data was already read */ +SMC_URG_VALID =1 ,/* data present */ +SMC_URG_NOTYET =2 ,/* data pending */ +SMC_URG_READ =3 ,/* data was already read */ };struct smc_connection {
net/unix/af_unix.c +33 -24
121 lines not on this page · raw message
net/unix/diag.c +2 -1
@@ -10,7 +10,8 @@static int sk_diag_dump_name (struct sock *sk,struct sk_buff *nlskb) { -struct unix_address *addr =unix_sk (sk)->addr; +/* might or might not have unix_table_lock */ +struct unix_address *addr =smp_load_acquire (&unix_sk (sk)->addr);if (!addr)return 0 ;
net/x25/af_x25.c +14 -6
@@ -679,8 +679,7 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)struct sockaddr_x25 *addr = (struct sockaddr_x25 *)uaddr;int len, i, rc =0 ; -if (!sock_flag (sk,SOCK_ZAPPED ) || - addr_len !=sizeof (struct sockaddr_x25 ) || +if (addr_len !=sizeof (struct sockaddr_x25 ) || addr->sx25_family !=AF_X25 ) { rc = -EINVAL ; goto out;
@@ -699,9 +698,13 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) }lock_sock (sk); -x25_sk (sk)->source_addr = addr->sx25_addr; -x25_insert_socket (sk); -sock_reset_flag (sk,SOCK_ZAPPED ); +if (sock_flag (sk,SOCK_ZAPPED )) { +x25_sk (sk)->source_addr = addr->sx25_addr; +x25_insert_socket (sk); +sock_reset_flag (sk,SOCK_ZAPPED ); + }else { + rc = -EINVAL ; + }release_sock (sk);SOCK_DEBUG (sk,"x25_bind: socket is bound\n" ); out:
@@ -817,8 +820,13 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr, sock->state =SS_CONNECTED ; rc =0 ; out_put_neigh: -if (rc) +if (rc) { +read_lock_bh (&x25_list_lock);x25_neigh_put (x25->neighbour); + x25->neighbour =NULL ; +read_unlock_bh (&x25_list_lock); + x25->state =X25_STATE_0 ; + } out_put_route:x25_route_put (rt); out:
security/lsm_audit.c +6 -4
@@ -321,6 +321,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,if (a->u.net->sk) {struct sock *sk = a->u.net->sk;struct unix_sock *u; +struct unix_address *addr;int len =0 ;char *p =NULL ;
@@ -351,14 +352,15 @@ static void dump_common_audit_data(struct audit_buffer *ab,#endif case AF_UNIX : u =unix_sk (sk); + addr =smp_load_acquire (&u->addr); +if (!addr) +break ;if (u->path.dentry) {audit_log_d_path (ab," path=" , &u->path);break ; } -if (!u->addr) -break ; - len = u->addr->len-sizeof (short ); - p = &u->addr->name->sun_path[0 ]; + len = addr->len-sizeof (short ); + p = &addr->name->sun_path[0 ];audit_log_format (ab," path=" );if (*p)audit_log_untrustedstring (ab, p);
sound/firewire/bebob/bebob.c +13 -1
@@ -448,7 +448,19 @@ static const struct ieee1394_device_id bebob_id_table[] = {/* Focusrite, SaffirePro 26 I/O */ SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000003, &saffirepro_26_spec), /* Focusrite, SaffirePro 10 I/O */ -SND_BEBOB_DEV_ENTRY (VEN_FOCUSRITE ,0x00000006 , &saffirepro_10_spec), + { +// The combination of vendor_id and model_id is the same as the +// same as the one of Liquid Saffire 56. + .match_flags =IEEE1394_MATCH_VENDOR_ID | +IEEE1394_MATCH_MODEL_ID | +IEEE1394_MATCH_SPECIFIER_ID | + IEEE1394_MATCH_VERSION, + .vendor_id = VEN_FOCUSRITE, + .model_id = 0x000006, + .specifier_id = 0x00a02d, + .version = 0x010001, + .driver_data = (kernel_ulong_t)&saffirepro_10_spec, + },/* Focusrite, Saffire(no label and LE) */ SND_BEBOB_DEV_ENTRY (VEN_FOCUSRITE ,MODEL_FOCUSRITE_SAFFIRE_BOTH , &saffire_spec),
sound/firewire/motu/amdtp-motu.c +3 -1
@@ -136,7 +136,9 @@ static void read_pcm_s32(struct amdtp_stream *s, byte = (u8 *)buffer + p->pcm_byte_offset;for (c =0 ; c < channels; ++c) { - *dst = (byte[0 ] <<24 ) | (byte[1 ] <<16 ) | byte[2 ]; + *dst = (byte[0 ] <<24 ) | + (byte[1 ] <<16 ) | + (byte[2 ] <<8 ); byte +=3 ; dst++; }
sound/hda/hdac_i915.c +2 -2
@@ -144,9 +144,9 @@ int snd_hdac_i915_init(struct hdac_bus *bus)return -ENODEV ;if (!acomp->ops) {request_module ("i915" ); -/* 10s timeout */ +/* 60s timeout */ wait_for_completion_timeout (&bind_complete, -msecs_to_jiffies (10 *1000 )); +msecs_to_jiffies (60 *1000 )); }if (!acomp->ops) {dev_info (bus->dev,"couldn't bind with audio component\n" );
sound/pci/hda/patch_conexant.c +3 -0
@@ -936,6 +936,9 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {SND_PCI_QUIRK (0x103c ,0x8299 ,"HP 800 G3 SFF" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x103c ,0x829a ,"HP 800 G3 DM" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x103c ,0x8455 ,"HP Z2 G4" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x103c ,0x8456 ,"HP Z2 G4 SFF" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x103c ,0x8457 ,"HP Z2 G4 mini" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x103c ,0x8458 ,"HP Z2 G4 mini premium" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1043 ,0x138d ,"Asus" ,CXT_FIXUP_HEADPHONE_MIC_PIN ),SND_PCI_QUIRK (0x152d ,0x0833 ,"OLPC XO-1.5" ,CXT_FIXUP_OLPC_XO ), SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
sound/pci/hda/patch_realtek.c +54 -26
223 lines not on this page · raw message