Linux 3.10.18
Greg KH
maintainerI'm announcing the release of the 3.10.18 kernel.
All users of the 3.10 kernel series must upgrade.
The updated 3.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.10.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
------------
Documentation/networking/ip-sysctl.txt | 9 ++++ Makefile | 2 - arch/arm/boot/dts/integratorcp.dts | 9 ++-- arch/arm/include/asm/syscall.h | 6 +++ drivers/connector/cn_proc.c | 18 +++++++++ drivers/connector/connector.c | 7 ++- drivers/gpio/gpio-lynxpoint.c | 5 +- drivers/i2c/busses/i2c-ismt.c | 3 + drivers/md/dm-snap-persistent.c | 18 ++++++--- drivers/net/can/dev.c | 10 ++--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 1 drivers/net/ethernet/emulex/benet/be_cmds.c | 3 + drivers/net/ethernet/marvell/mv643xx_eth.c | 6 +-- drivers/net/ethernet/ti/davinci_emac.c | 3 - drivers/net/virtio_net.c | 17 ++++++-- drivers/net/wan/farsync.c | 1 drivers/net/wan/wanxl.c | 1 drivers/net/xen-netback/common.h | 1 drivers/net/xen-netback/interface.c | 12 +++++- drivers/net/xen-netback/xenbus.c | 17 ++++++-- drivers/tty/serial/vt8500_serial.c | 5 +- drivers/usb/serial/option.c | 9 ++++ drivers/usb/serial/ti_usb_3410_5052.c | 1 include/linux/skbuff.h | 5 ++ include/net/cipso_ipv4.h | 6 ++- include/net/dst.h | 12 ++++++ include/net/ip6_route.h | 6 +-- include/net/sock.h | 2 + include/net/tcp.h | 1 mm/huge_memory.c | 10 ++++- mm/page-writeback.c | 10 ++--- net/8021q/vlan_netlink.c | 2 - net/bridge/br_stp_if.c | 2 - net/compat.c | 2 + net/core/secure_seq.c | 2 + net/core/sock.c | 1 net/ipv4/inet_hashtables.c | 2 - net/ipv4/ip_output.c | 2 - net/ipv4/ip_vti.c | 14 +++++-- net/ipv4/route.c | 2 - net/ipv4/sysctl_net_ipv4.c | 10 +++++ net/ipv4/tcp.c | 28 ++++++++++++-- net/ipv4/tcp_input.c | 41 +++++++++++++++++++-- net/ipv4/tcp_output.c | 28 +++++++++----- net/ipv6/inet6_hashtables.c | 2 - net/ipv6/ip6_output.c | 6 +-- net/ipv6/route.c | 46 +++++++++++++++++++----- net/l2tp/l2tp_core.c | 36 +++++++++++++++--- net/l2tp/l2tp_core.h | 3 + net/l2tp/l2tp_ppp.c | 4 ++ net/netfilter/nf_conntrack_h323_main.c | 4 +- net/sctp/output.c | 3 + net/socket.c | 24 ++++++++++-- net/unix/af_unix.c | 10 +++++ net/unix/diag.c | 1 net/wireless/radiotap.c | 7 +++ sound/pci/hda/hda_generic.c | 2 - sound/usb/usx2y/us122l.c | 4 +- 58 files changed, 393 insertions(+), 111 deletions(-)
AKASHI Takahiro (1):
ARM: 7851/1: check for number of arguments in syscall_get/set_arguments()
Christophe Gouault (1):
vti: get rid of nf mark rule in prerouting
Dan Carpenter (1):
net: heap overflow in __audit_sockaddr()
Daniel Borkmann (1):
net: unix: inherit SOCK_PASS{CRED, SEC} flags from socket to fix race
David Henningsson (1):
ALSA: hda - Fix inverted internal mic not indicated on some machines
David S. Miller (1):
l2tp: Fix build warning with ipv6 disabled.
Diego Elio Pettenò (1):
USB: serial: ti_usb_3410_5052: add Abbott strip port ID to combined table as well.
Enrico Mioso (1):
usb: serial: option: blacklist Olivetti Olicard200
Eric Dumazet (7):
tcp: TSO packets automatic sizing
tcp: TSQ can use a dynamic limit
tcp: must unclone packets before mangling them
tcp: do not forget FIN in tcp_shifted_skb()
net: do not call sock_put() on TIMEWAIT sockets
l2tp: must disable bh before calling l2tp_xmit_skb()
bnx2x: record rx queue for LRO packets
Fabio Estevam (1):
net: secure_seq: Fix warning when CONFIG_IPV6 and CONFIG_INET are not selected
Fan Du (1):
sctp: Use software crc32 checksum when xfrm transform will happen.
Fengguang Wu (1):
writeback: fix negative bdi max pause
François CACHEREUL (1):
l2tp: fix kernel panic when using IPv4-mapped IPv6 addresses
Greg Kroah-Hartman (2):
USB: serial: option: add support for Inovia SEW858 device Linux 3.10.18
Hannes Frederic Sowa (2):
inet: fix possible memory corruption with UDP_CORK and UFO
ipv6: probe routes asynchronous in rt6_probe
Hugh Dickins (1):
mm: fix BUG in __split_huge_page_pmd
James Ralston (1):
i2c: ismt: initialize DMA buffer
Jason Wang (3):
virtio-net: don't respond to cpu hotplug notifier if we're not ready
virtio-net: fix the race between channels setting and refill
virtio-net: refill only when device is up during setting queues
Jiri Benc (1):
ipv4: fix ineffective source address selection
Johannes Berg (1):
wireless: radiotap: fix parsing buffer overrun
Julian Anastasov (3):
ipv6: always prefer rt6i_gateway if present
ipv6: fill rt6i_gateway with nexthop address
netfilter: nf_conntrack: fix rt6i_gateway checks for H.323 helper
Linus Walleij (1):
ARM: integrator: deactivate timer0 on the Integrator/CP
Marc Kleine-Budde (2):
can: dev: fix nlmsg size calculation in can_get_size()
net: vlan: fix nlmsg size calculation in vlan_get_size()
Mariusz Ceier (1):
davinci_emac.c: Fix IFF_ALLMULTI setup
Mathias Krause (3):
proc connector: fix info leaks
unix_diag: fix info leak
connector: use nlmsg_len() to check message length
Mika Westerberg (1):
gpio/lynxpoint: check if the interrupt is enabled in IRQ handler
Mikulas Patocka (1):
dm snapshot: fix data corruption
Paul Durrant (1):
xen-netback: Don't destroy the netdev until the vif is shut down
Roel Kluin (1):
serial: vt8500: add missing braces
Salva Peiró (2):
farsync: fix info leak in ioctl
wanxl: fix info leak in ioctl
Sebastian Hesselbarth (2):
net: mv643xx_eth: update statistics timer from timer context only
net: mv643xx_eth: fix orphaned statistics timer crash
Seif Mazareeb (1):
net: fix cipso packet validation when !NETLABEL
Takashi Iwai (1):
ALSA: us122l: Fix pcm_usb_stream mmapping regression
Vasundhara Volam (1):
be2net: pass if_id for v1 and V2 versions of TX_CREATE cmd
Vlad Yasevich (3):
bridge: Correctly clamp MAX forward_delay when enabling STP
net: dst: provide accessor function to dst->xfrm
sctp: Perform software checksum if packet has to be fragmented.
Yuchung Cheng (1):
tcp: fix incorrect ca_state in tail loss probe
Greg KH
maintainerDocumentation/networking/ip-sysctl.txt +9 -0
@@ -478,6 +478,15 @@ tcp_syn_retries - INTEGER tcp_timestamps - BOOLEAN Enable timestamps as defined in RFC1323. +tcp_min_tso_segs - INTEGER + Minimal number of segments per TSO frame. + Since linux-3.12, TCP does an automatic sizing of TSO frames, + depending on flow rate, instead of filling 64Kbytes packets. + For specific usages, it's possible to force TCP to build big + TSO frames. Note that TCP stack might split too big TSO packets + if available window is too small. + Default: 2 + tcp_tso_win_divisor - INTEGER This allows control over what percentage of the congestion window can be consumed by a single TSO frame.
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 17 +SUBLEVEL = 18 EXTRAVERSION = NAME = TOSSUG Baby Fish
arch/arm/boot/dts/integratorcp.dts +4 -5
@@ -9,11 +9,6 @@ model = "ARM Integrator/CP"; compatible = "arm,integrator-cp"; - aliases { - arm,timer-primary = &timer2; - arm,timer-secondary = &timer1; - }; - chosen { bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; };
@@ -24,14 +19,18 @@ }; timer0: timer@13000000 { + /* TIMER0 runs @ 25MHz */ compatible = "arm,integrator-cp-timer"; + status = "disabled"; }; timer1: timer@13000100 { + /* TIMER1 runs @ 1MHz */ compatible = "arm,integrator-cp-timer"; }; timer2: timer@13000200 { + /* TIMER2 runs @ 1MHz */ compatible = "arm,integrator-cp-timer"; };
arch/arm/include/asm/syscall.h +6 -0
@@ -57,6 +57,9 @@ static inline void syscall_get_arguments(struct task_struct *task, unsigned int i, unsigned int n, unsigned long *args) { + if (n == 0) + return; +if (i + n >SYSCALL_MAX_ARGS ) {unsigned long *args_bad = args +SYSCALL_MAX_ARGS - i;unsigned int n_bad = n + i -SYSCALL_MAX_ARGS ;
@@ -81,6 +84,9 @@ static inline void syscall_set_arguments(struct task_struct *task, unsigned int i, unsigned int n, const unsigned long *args) { + if (n == 0) + return; +if (i + n >SYSCALL_MAX_ARGS ) {pr_warning ("%s called with max args %d, handling only %d\n" , __func__, i + n,SYSCALL_MAX_ARGS );
drivers/connector/cn_proc.c +18 -0
@@ -65,6 +65,7 @@ void proc_fork_connector(struct task_struct *task) msg = (struct cn_msg *)buffer; ev = (struct proc_event *)msg->data; +memset (&ev->event_data,0 ,sizeof (ev->event_data));get_seq (&msg->seq, &ev->cpu);ktime_get_ts (&ts);/* get high res monotonic timestamp */ put_unaligned (timespec_to_ns (&ts), (__u64 *)&ev->timestamp_ns);
@@ -80,6 +81,7 @@ void proc_fork_connector(struct task_struct *task)memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack =0 ;/* not used */ msg->len =sizeof (*ev); + msg->flags =0 ;/* not used */ /* If cn_netlink_send() failed, the data is not sent */ cn_netlink_send (msg,CN_IDX_PROC ,GFP_KERNEL ); }
@@ -96,6 +98,7 @@ void proc_exec_connector(struct task_struct *task) msg = (struct cn_msg *)buffer; ev = (struct proc_event *)msg->data; +memset (&ev->event_data,0 ,sizeof (ev->event_data));get_seq (&msg->seq, &ev->cpu);ktime_get_ts (&ts);/* get high res monotonic timestamp */ put_unaligned (timespec_to_ns (&ts), (__u64 *)&ev->timestamp_ns);
@@ -106,6 +109,7 @@ void proc_exec_connector(struct task_struct *task)memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack =0 ;/* not used */ msg->len =sizeof (*ev); + msg->flags =0 ;/* not used */ cn_netlink_send (msg,CN_IDX_PROC ,GFP_KERNEL ); }
@@ -122,6 +126,7 @@ void proc_id_connector(struct task_struct *task, int which_id) msg = (struct cn_msg *)buffer; ev = (struct proc_event *)msg->data; +memset (&ev->event_data,0 ,sizeof (ev->event_data)); ev->what = which_id; ev->event_data.id.process_pid = task->pid; ev->event_data.id.process_tgid = task->tgid;
@@ -145,6 +150,7 @@ void proc_id_connector(struct task_struct *task, int which_id)memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack =0 ;/* not used */ msg->len =sizeof (*ev); + msg->flags =0 ;/* not used */ cn_netlink_send (msg,CN_IDX_PROC ,GFP_KERNEL ); }
@@ -160,6 +166,7 @@ void proc_sid_connector(struct task_struct *task) msg = (struct cn_msg *)buffer; ev = (struct proc_event *)msg->data; +memset (&ev->event_data,0 ,sizeof (ev->event_data));get_seq (&msg->seq, &ev->cpu);ktime_get_ts (&ts);/* get high res monotonic timestamp */ put_unaligned (timespec_to_ns (&ts), (__u64 *)&ev->timestamp_ns);
@@ -170,6 +177,7 @@ void proc_sid_connector(struct task_struct *task)memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack =0 ;/* not used */ msg->len =sizeof (*ev); + msg->flags =0 ;/* not used */ cn_netlink_send (msg,CN_IDX_PROC ,GFP_KERNEL ); }
@@ -185,6 +193,7 @@ void proc_ptrace_connector(struct task_struct *task, int ptrace_id) msg = (struct cn_msg *)buffer; ev = (struct proc_event *)msg->data; +memset (&ev->event_data,0 ,sizeof (ev->event_data));get_seq (&msg->seq, &ev->cpu);ktime_get_ts (&ts);/* get high res monotonic timestamp */ put_unaligned (timespec_to_ns (&ts), (__u64 *)&ev->timestamp_ns);
@@ -203,6 +212,7 @@ void proc_ptrace_connector(struct task_struct *task, int ptrace_id)memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack =0 ;/* not used */ msg->len =sizeof (*ev); + msg->flags =0 ;/* not used */ cn_netlink_send (msg,CN_IDX_PROC ,GFP_KERNEL ); }
@@ -218,6 +228,7 @@ void proc_comm_connector(struct task_struct *task) msg = (struct cn_msg *)buffer; ev = (struct proc_event *)msg->data; +memset (&ev->event_data,0 ,sizeof (ev->event_data));get_seq (&msg->seq, &ev->cpu);ktime_get_ts (&ts);/* get high res monotonic timestamp */ put_unaligned (timespec_to_ns (&ts), (__u64 *)&ev->timestamp_ns);
@@ -229,6 +240,7 @@ void proc_comm_connector(struct task_struct *task)memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack =0 ;/* not used */ msg->len =sizeof (*ev); + msg->flags =0 ;/* not used */ cn_netlink_send (msg,CN_IDX_PROC ,GFP_KERNEL ); }
@@ -244,6 +256,7 @@ void proc_coredump_connector(struct task_struct *task) msg = (struct cn_msg *)buffer; ev = (struct proc_event *)msg->data; +memset (&ev->event_data,0 ,sizeof (ev->event_data));get_seq (&msg->seq, &ev->cpu);ktime_get_ts (&ts);/* get high res monotonic timestamp */ put_unaligned (timespec_to_ns (&ts), (__u64 *)&ev->timestamp_ns);
@@ -254,6 +267,7 @@ void proc_coredump_connector(struct task_struct *task)memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack =0 ;/* not used */ msg->len =sizeof (*ev); + msg->flags =0 ;/* not used */ cn_netlink_send (msg,CN_IDX_PROC ,GFP_KERNEL ); }
@@ -269,6 +283,7 @@ void proc_exit_connector(struct task_struct *task) msg = (struct cn_msg *)buffer; ev = (struct proc_event *)msg->data; +memset (&ev->event_data,0 ,sizeof (ev->event_data));get_seq (&msg->seq, &ev->cpu);ktime_get_ts (&ts);/* get high res monotonic timestamp */ put_unaligned (timespec_to_ns (&ts), (__u64 *)&ev->timestamp_ns);
@@ -281,6 +296,7 @@ void proc_exit_connector(struct task_struct *task)memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack =0 ;/* not used */ msg->len =sizeof (*ev); + msg->flags =0 ;/* not used */ cn_netlink_send (msg,CN_IDX_PROC ,GFP_KERNEL ); }
@@ -304,6 +320,7 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack) msg = (struct cn_msg *)buffer; ev = (struct proc_event *)msg->data; +memset (&ev->event_data,0 ,sizeof (ev->event_data)); msg->seq = rcvd_seq;ktime_get_ts (&ts);/* get high res monotonic timestamp */ put_unaligned (timespec_to_ns (&ts), (__u64 *)&ev->timestamp_ns);
@@ -313,6 +330,7 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack)memcpy (&msg->id, &cn_proc_event_id,sizeof (msg->id)); msg->ack = rcvd_ack +1 ; msg->len =sizeof (*ev); + msg->flags =0 ;/* not used */ cn_netlink_send (msg,CN_IDX_PROC ,GFP_KERNEL ); }
drivers/connector/connector.c +4 -3
@@ -157,17 +157,18 @@ static int cn_call_callback(struct sk_buff *skb)static void cn_rx_skb (struct sk_buff *__skb) {struct nlmsghdr *nlh; -int err;struct sk_buff *skb; +int len, err; skb =skb_get (__skb);if (skb->len >=NLMSG_HDRLEN ) { nlh =nlmsg_hdr (skb); + len =nlmsg_len (nlh); -if (nlh->nlmsg_len <sizeof (struct cn_msg ) || +if (len < (int )sizeof (struct cn_msg ) || skb->len < nlh->nlmsg_len || - nlh->nlmsg_len >CONNECTOR_MAX_MSG_SIZE ) { + len >CONNECTOR_MAX_MSG_SIZE ) {kfree_skb (skb);return ; }
drivers/gpio/gpio-lynxpoint.c +3 -2
@@ -248,14 +248,15 @@ static void lp_gpio_irq_handler(unsigned irq, struct irq_desc *desc)struct lp_gpio *lg =irq_data_get_irq_handler_data (data);struct irq_chip *chip =irq_data_get_irq_chip (data);u32 base, pin, mask; -unsigned long reg, pending; +unsigned long reg, ena, pending;unsigned virq;/* check from GPIO controller which pin triggered the interrupt */ for (base =0 ; base < lg->chip.ngpio; base +=32 ) { reg =lp_gpio_reg (&lg->chip, base,LP_INT_STAT ); + ena =lp_gpio_reg (&lg->chip, base,LP_INT_ENABLE ); -while ((pending =inl (reg))) { +while ((pending = (inl (reg) &inl (ena)))) { pin =__ffs (pending); mask =BIT (pin);/* Clear before handling so we don't lose an edge */
drivers/i2c/busses/i2c-ismt.c +3 -0
@@ -393,6 +393,9 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr, desc = &priv->hw[priv->head]; +/* Initialize the DMA buffer */ +memset (priv->dma_buffer,0 ,sizeof (priv->dma_buffer)); +/* Initialize the descriptor */ memset (desc,0 ,sizeof (struct ismt_desc )); desc->tgtaddr_rw =ISMT_DESC_ADDR_RW (addr, read_write);
drivers/md/dm-snap-persistent.c +12 -6
@@ -269,6 +269,14 @@ static chunk_t area_location(struct pstore *ps, chunk_t area)return NUM_SNAPSHOT_HDR_CHUNKS + ((ps->exceptions_per_area +1 ) * area); } +static void skip_metadata (struct pstore *ps) +{ +uint32_t stride = ps->exceptions_per_area +1 ; +chunk_t next_free = ps->next_free; +if (sector_div (next_free, stride) ==NUM_SNAPSHOT_HDR_CHUNKS ) + ps->next_free++; +} +/* * Read or write a metadata area. Remembering to skip the first * chunk which holds the header.
@@ -502,6 +510,8 @@ static int read_exceptions(struct pstore *ps, ps->current_area--; +skip_metadata (ps); +return 0 ; }
@@ -616,8 +626,6 @@ static int persistent_prepare_exception(struct dm_exception_store *store, struct dm_exception *e) {struct pstore *ps =get_info (store); -uint32_t stride; -chunk_t next_free;sector_t size =get_dev_size (dm_snap_cow (store->snap)->bdev);/* Is there enough room ? */
@@ -630,10 +638,8 @@ static int persistent_prepare_exception(struct dm_exception_store *store,* Move onto the next free pending, making sure to take * into account the location of the metadata chunks. */ - stride = (ps->exceptions_per_area +1 ); - next_free = ++ps->next_free; -if (sector_div (next_free, stride) ==1 ) - ps->next_free++; + ps->next_free++; +skip_metadata (ps);atomic_inc (&ps->pending_count);return 0 ;
drivers/net/can/dev.c +5 -5
@@ -705,14 +705,14 @@ static size_t can_get_size(const struct net_device *dev)size_t size; size =nla_total_size (sizeof (u32));/* IFLA_CAN_STATE */ - size +=sizeof (struct can_ctrlmode );/* IFLA_CAN_CTRLMODE */ + size +=nla_total_size (sizeof (struct can_ctrlmode ));/* IFLA_CAN_CTRLMODE */ size +=nla_total_size (sizeof (u32));/* IFLA_CAN_RESTART_MS */ - size +=sizeof (struct can_bittiming );/* IFLA_CAN_BITTIMING */ - size +=sizeof (struct can_clock );/* IFLA_CAN_CLOCK */ + size +=nla_total_size (sizeof (struct can_bittiming ));/* IFLA_CAN_BITTIMING */ + size +=nla_total_size (sizeof (struct can_clock ));/* IFLA_CAN_CLOCK */ if (priv->do_get_berr_counter)/* IFLA_CAN_BERR_COUNTER */ - size +=sizeof (struct can_berr_counter ); + size +=nla_total_size (sizeof (struct can_berr_counter ));if (priv->bittiming_const)/* IFLA_CAN_BITTIMING_CONST */ - size +=sizeof (struct can_bittiming_const ); + size +=nla_total_size (sizeof (struct can_bittiming_const ));return size; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1 -0
@@ -670,6 +670,7 @@ static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp, } }#endif +skb_record_rx_queue (skb, fp->rx_queue);napi_gro_receive (&fp->napi, skb); }
drivers/net/ethernet/emulex/benet/be_cmds.c +2 -1
@@ -1150,7 +1150,6 @@ int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo)if (lancer_chip (adapter)) { req->hdr.version =1 ; - req->if_id =cpu_to_le16 (adapter->if_handle); }else if (BEx_chip (adapter)) {if (adapter->function_caps &BE_FUNCTION_CAPS_SUPER_NIC ) req->hdr.version =2 ;
@@ -1158,6 +1157,8 @@ int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo) req->hdr.version =2 ; } +if (req->hdr.version >0 ) + req->if_id =cpu_to_le16 (adapter->if_handle); req->num_pages =PAGES_4K_SPANNED (q_mem->va, q_mem->size); req->ulp_num =BE_ULP1_NUM ; req->type =BE_ETH_TX_RING_TYPE_STANDARD ;
drivers/net/ethernet/marvell/mv643xx_eth.c +2 -4
@@ -1125,15 +1125,13 @@ static void mib_counters_update(struct mv643xx_eth_private *mp) p->rx_discard +=rdlp (mp,RX_DISCARD_FRAME_CNT ); p->rx_overrun +=rdlp (mp,RX_OVERRUN_FRAME_CNT );spin_unlock_bh (&mp->mib_counters_lock); - -mod_timer (&mp->mib_counters_timer, jiffies +30 *HZ ); }static void mib_counters_timer_wrapper (unsigned long _mp) {struct mv643xx_eth_private *mp = (void *)_mp; -mib_counters_update (mp); +mod_timer (&mp->mib_counters_timer, jiffies +30 *HZ ); }
@@ -2231,6 +2229,7 @@ static int mv643xx_eth_open(struct net_device *dev) mp->int_mask |=INT_TX_END_0 << i; } +add_timer (&mp->mib_counters_timer);port_start (mp);wrlp (mp,INT_MASK_EXT ,INT_EXT_LINK_PHY |INT_EXT_TX );
@@ -2739,7 +2738,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev) mp->mib_counters_timer.data = (unsigned long )mp; mp->mib_counters_timer.function = mib_counters_timer_wrapper; mp->mib_counters_timer.expires = jiffies +30 *HZ ; -add_timer (&mp->mib_counters_timer);spin_lock_init (&mp->mib_counters_lock);
drivers/net/ethernet/ti/davinci_emac.c +1 -2
@@ -876,8 +876,7 @@ static void emac_dev_mcast_set(struct net_device *ndev) netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) { mbp_enable = (mbp_enable |EMAC_MBP_RXMCAST );emac_add_mcast (priv,EMAC_ALL_MULTI_SET ,NULL ); - } -if (!netdev_mc_empty (ndev)) { + } else if (!netdev_mc_empty(ndev)) {struct netdev_hw_addr *ha; mbp_enable = (mbp_enable |EMAC_MBP_RXMCAST );
drivers/net/virtio_net.c +13 -4
@@ -902,7 +902,6 @@ static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs)struct scatterlist sg;struct virtio_net_ctrl_mq s;struct net_device *dev = vi->dev; -int i;if (!vi->has_cvq || !virtio_has_feature (vi->vdev,VIRTIO_NET_F_MQ ))return 0 ;
@@ -916,10 +915,10 @@ static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs) queue_pairs);return -EINVAL ; }else { -for (i = vi->curr_queue_pairs; i < queue_pairs; i++) -if (!try_fill_recv (&vi->rq[i],GFP_KERNEL )) -schedule_delayed_work (&vi->refill,0 ); vi->curr_queue_pairs = queue_pairs; +/* virtnet_open() will refill when device is going to up. */ +if (dev->flags &IFF_UP ) +schedule_delayed_work (&vi->refill,0 ); }return 0 ;
@@ -1097,6 +1096,11 @@ static int virtnet_cpu_callback(struct notifier_block *nfb, { struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb); +mutex_lock (&vi->config_lock); + +if (!vi->config_enable) + goto done; +switch (action & ~CPU_TASKS_FROZEN ) {case CPU_ONLINE :case CPU_DOWN_FAILED :
@@ -1109,6 +1113,9 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,default :break ; } + +done: +mutex_unlock (&vi->config_lock);return NOTIFY_OK ; }
@@ -1709,7 +1716,9 @@ static int virtnet_restore(struct virtio_device *vdev) vi->config_enable = true;mutex_unlock (&vi->config_lock); +rtnl_lock ();virtnet_set_queues (vi, vi->curr_queue_pairs); +rtnl_unlock ();return 0 ; }
drivers/net/wan/farsync.c +1 -0
@@ -1972,6 +1972,7 @@ fst_get_iface(struct fst_card_info *card, struct fst_port_info *port, } i = port->index; +memset (&sync,0 ,sizeof (sync)); sync.clock_rate =FST_RDL (card, portConfig[i].lineSpeed);/* Lucky card and linux use same encoding here */ sync.clock_type = FST_RDB(card, portConfig[i].internalClock) ==
drivers/net/wan/wanxl.c +1 -0
@@ -355,6 +355,7 @@ static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ifr->ifr_settings.size = size;/* data size wanted */ return -ENOBUFS ; } +memset (&line,0 ,sizeof (line)); line.clock_type =get_status (port)->clocking; line.clock_rate =0 ; line.loopback =0 ;
drivers/net/xen-netback/common.h +1 -0
@@ -115,6 +115,7 @@ struct xenvif *xenvif_alloc(struct device *parent,int xenvif_connect (struct xenvif *vif,unsigned long tx_ring_ref,unsigned long rx_ring_ref,unsigned int evtchn);void xenvif_disconnect (struct xenvif *vif); +void xenvif_free (struct xenvif *vif);void xenvif_get (struct xenvif *vif);void xenvif_put (struct xenvif *vif);
drivers/net/xen-netback/interface.c +10 -2
@@ -304,6 +304,9 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, }netdev_dbg (dev,"Successfully created xenvif\n" ); + +__module_get (THIS_MODULE ); +return vif; }
@@ -369,9 +372,14 @@ void xenvif_disconnect(struct xenvif *vif)if (vif->irq)unbind_from_irqhandler (vif->irq, vif); -unregister_netdev (vif->dev); -xen_netbk_unmap_frontend_rings (vif); +} + +void xenvif_free (struct xenvif *vif) +{ +unregister_netdev (vif->dev);free_netdev (vif->dev); + +module_put (THIS_MODULE ); }
drivers/net/xen-netback/xenbus.c +12 -5
@@ -42,7 +42,7 @@ static int netback_remove(struct xenbus_device *dev)if (be->vif) {kobject_uevent (&dev->dev.kobj,KOBJ_OFFLINE );xenbus_rm (XBT_NIL , dev->nodename,"hotplug-status" ); -xenvif_disconnect (be->vif); +xenvif_free (be->vif); be->vif =NULL ; }kfree (be);
@@ -203,9 +203,18 @@ static void disconnect_backend(struct xenbus_device *dev) {struct backend_info *be =dev_get_drvdata (&dev->dev); +if (be->vif) +xenvif_disconnect (be->vif); +} + +static void destroy_backend (struct xenbus_device *dev) +{ +struct backend_info *be =dev_get_drvdata (&dev->dev); +if (be->vif) { +kobject_uevent (&dev->dev.kobj,KOBJ_OFFLINE );xenbus_rm (XBT_NIL , dev->nodename,"hotplug-status" ); -xenvif_disconnect (be->vif); +xenvif_free (be->vif); be->vif =NULL ; } }
@@ -237,14 +246,11 @@ static void frontend_changed(struct xenbus_device *dev,case XenbusStateConnected:if (dev->state == XenbusStateConnected)break ; -backend_create_xenvif (be);if (be->vif)connect (be);break ;case XenbusStateClosing: -if (be->vif) -kobject_uevent (&dev->dev.kobj,KOBJ_OFFLINE );disconnect_backend (dev);xenbus_switch_state (dev, XenbusStateClosing);break ;
@@ -253,6 +259,7 @@ static void frontend_changed(struct xenbus_device *dev,xenbus_switch_state (dev, XenbusStateClosed);if (xenbus_dev_is_online (dev))break ; +destroy_backend (dev);/* fall through if not online */ case XenbusStateUnknown:device_unregister (&dev->dev);
drivers/tty/serial/vt8500_serial.c +3 -2
@@ -559,12 +559,13 @@ static int vt8500_serial_probe(struct platform_device *pdev)if (!mmres || !irqres)return -ENODEV ; -if (np) +if (np) { port =of_alias_get_id (np,"serial" );if (port >=VT8500_MAX_PORTS ) port =-1 ; -else + }else { port =-1 ; + }if (port <0 ) {/* calculate the port id */
drivers/usb/serial/option.c +8 -1
@@ -451,6 +451,10 @@ static void option_instat_callback(struct urb *urb);#define CHANGHONG_VENDOR_ID 0x2077#define CHANGHONG_PRODUCT_CH690 0x7001 +/* Inovia */ +#define INOVIA_VENDOR_ID 0x20a6 +#define INOVIA_SEW858 0x1105 +/* some devices interfaces need special handling due to a number of reasons */ enum option_blacklist_reason {OPTION_BLACKLIST_NONE =0 ,
@@ -1257,7 +1261,9 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, - { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200) }, + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200), + .driver_info = (kernel_ulong_t)&net_intf6_blacklist + }, { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) },
@@ -1345,6 +1351,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ + { USB_DEVICE(INOVIA_VENDOR_ID, INOVIA_SEW858) }, { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, option_ids);
drivers/usb/serial/ti_usb_3410_5052.c +1 -0
@@ -203,6 +203,7 @@ static struct usb_device_id ti_id_table_combined[19+2*TI_EXTRA_VID_PID_COUNT+1] { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) }, + { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) }, { USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) }, { } };
include/linux/skbuff.h +5 -0
@@ -1308,6 +1308,11 @@ static inline int skb_pagelen(const struct sk_buff *skb)return len +skb_headlen (skb); } +static inline bool skb_has_frags (const struct sk_buff *skb) +{ +return skb_shinfo (skb)->nr_frags; +} +/** * __skb_fill_page_desc - initialise a paged fragment in an skb * @skb: buffer containing fragment to be initialised
include/net/cipso_ipv4.h +4 -2
@@ -290,6 +290,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb,unsigned char err_offset =0 ;u8 opt_len = opt[1 ];u8 opt_iter; +u8 tag_len;if (opt_len <8 ) { err_offset =1 ;
@@ -302,11 +303,12 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, }for (opt_iter =6 ; opt_iter < opt_len;) { -if (opt[opt_iter +1 ] > (opt_len - opt_iter)) { + tag_len = opt[opt_iter +1 ]; +if ((tag_len ==0 ) || (opt[opt_iter +1 ] > (opt_len - opt_iter))) { err_offset = opt_iter +1 ; goto out; } - opt_iter += opt[opt_iter +1 ]; + opt_iter += tag_len; } out:
include/net/dst.h +12 -0
@@ -477,10 +477,22 @@ static inline struct dst_entry *xfrm_lookup(struct net *net, {return dst_orig; } + +static inline struct xfrm_state *dst_xfrm (const struct dst_entry *dst) +{ +return NULL ; +} +#else extern struct dst_entry *xfrm_lookup (struct net *net,struct dst_entry *dst_orig,const struct flowi *fl,struct sock *sk,int flags); + +/* skb attached with this dst needs transformation if dst->xfrm is valid */ +static inline struct xfrm_state *dst_xfrm (const struct dst_entry *dst) +{ +return dst->xfrm; +}#endif #endif /* _NET_DST_H */
include/net/ip6_route.h +2 -4
@@ -194,11 +194,9 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb) skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); } -static inline struct in6_addr *rt6_nexthop (struct rt6_info *rt,struct in6_addr *dest) +static inline struct in6_addr *rt6_nexthop (struct rt6_info *rt) { -if (rt->rt6i_flags &RTF_GATEWAY ) -return &rt->rt6i_gateway; -return dest; +return &rt->rt6i_gateway; }#endif
include/net/sock.h +2 -0
@@ -230,6 +230,7 @@ struct cg_proto;* @sk_wmem_queued: persistent queue size * @sk_forward_alloc: space allocated forward * @sk_allocation: allocation mode +* @sk_pacing_rate: Pacing rate (if supported by transport/packet scheduler) * @sk_sndbuf: size of send buffer in bytes * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings
@@ -355,6 +356,7 @@ struct sock {kmemcheck_bitfield_end (flags);int sk_wmem_queued;gfp_t sk_allocation; +u32 sk_pacing_rate;/* bytes per second */ netdev_features_t sk_route_caps;netdev_features_t sk_route_nocaps;int sk_gso_type;
include/net/tcp.h +1 -0
@@ -287,6 +287,7 @@ extern int sysctl_tcp_thin_dupack;extern int sysctl_tcp_early_retrans;extern int sysctl_tcp_limit_output_bytes;extern int sysctl_tcp_challenge_ack_limit; +extern int sysctl_tcp_min_tso_segs;extern atomic_long_t tcp_memory_allocated;extern struct percpu_counter tcp_sockets_allocated;
mm/huge_memory.c +9 -1
@@ -2699,6 +2699,7 @@ void __split_huge_page_pmd(struct vm_area_struct *vma, unsigned long address, mmun_start = haddr; mmun_end = haddr +HPAGE_PMD_SIZE ; +again:mmu_notifier_invalidate_range_start (mm, mmun_start, mmun_end);spin_lock (&mm->page_table_lock);if (unlikely (!pmd_trans_huge (*pmd))) {
@@ -2721,7 +2722,14 @@ void __split_huge_page_pmd(struct vm_area_struct *vma, unsigned long address,split_huge_page (page);put_page (page); -BUG_ON (pmd_trans_huge (*pmd)); + +/* +* We don't always have down_write of mmap_sem here: a racing +* do_huge_pmd_wp_page() might have copied-on-write to another +* huge page before our split_huge_page() got the anon_vma lock. +*/ +if (unlikely (pmd_trans_huge (*pmd))) + goto again; } void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address,
mm/page-writeback.c +5 -5
@@ -1104,11 +1104,11 @@ static unsigned long dirty_poll_interval(unsigned long dirty,return 1 ; } -static long bdi_max_pause (struct backing_dev_info *bdi, -unsigned long bdi_dirty) +static unsigned long bdi_max_pause (struct backing_dev_info *bdi, +unsigned long bdi_dirty) { -long bw = bdi->avg_write_bandwidth; -long t; +unsigned long bw = bdi->avg_write_bandwidth; +unsigned long t;/* * Limit pause time for small memory systems. If sleeping for too long
@@ -1120,7 +1120,7 @@ static long bdi_max_pause(struct backing_dev_info *bdi, t = bdi_dirty / (1 + bw /roundup_pow_of_two (1 +HZ /8 )); t++; -return min_t (long, t,MAX_PAUSE ); + return min_t(unsigned long, t, MAX_PAUSE); } static long bdi_min_pause(struct backing_dev_info *bdi,
net/8021q/vlan_netlink.c +1 -1
@@ -171,7 +171,7 @@ static size_t vlan_get_size(const struct net_device *dev)return nla_total_size (2 ) +/* IFLA_VLAN_PROTOCOL */ nla_total_size (2 ) +/* IFLA_VLAN_ID */ -sizeof (struct ifla_vlan_flags ) +/* IFLA_VLAN_FLAGS */ +nla_total_size (sizeof (struct ifla_vlan_flags )) +/* IFLA_VLAN_FLAGS */ vlan_qos_map_size (vlan->nr_ingress_mappings) +vlan_qos_map_size (vlan->nr_egress_mappings); }
net/bridge/br_stp_if.c +1 -1
@@ -134,7 +134,7 @@ static void br_stp_start(struct net_bridge *br)if (br->bridge_forward_delay <BR_MIN_FORWARD_DELAY )__br_set_forward_delay (br,BR_MIN_FORWARD_DELAY ); -else if (br->bridge_forward_delay <BR_MAX_FORWARD_DELAY ) +else if (br->bridge_forward_delay >BR_MAX_FORWARD_DELAY )__br_set_forward_delay (br,BR_MAX_FORWARD_DELAY );if (r ==0 ) {
net/compat.c +2 -0
@@ -71,6 +71,8 @@ int get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg)__get_user (kmsg->msg_controllen, &umsg->msg_controllen) || __get_user(kmsg->msg_flags, &umsg->msg_flags)) return -EFAULT; +if (kmsg->msg_namelen >sizeof (struct sockaddr_storage )) +return -EINVAL ; kmsg->msg_name =compat_ptr (tmp1); kmsg->msg_iov =compat_ptr (tmp2); kmsg->msg_control =compat_ptr (tmp3);
net/core/secure_seq.c +2 -0
@@ -10,6 +10,7 @@#include <net/secure_seq.h> +#if IS_ENABLED (CONFIG_IPV6 ) ||IS_ENABLED (CONFIG_INET )#define NET_SECRET_SIZE (MD5_MESSAGE_BYTES / 4)static u32 net_secret[NET_SECRET_SIZE ]____cacheline_aligned ;
@@ -29,6 +30,7 @@ static void net_secret_init(void) cmpxchg(&net_secret[--i], 0, tmp); } } +#endif #ifdef CONFIG_INET static u32 seq_scale (u32 seq)
net/core/sock.c +1 -0
@@ -2271,6 +2271,7 @@ void sock_init_data(struct socket *sock, struct sock *sk) sk->sk_stamp =ktime_set (-1L ,0 ); + sk->sk_pacing_rate = ~0U ;/* * Before updating sk_refcnt, we must commit prior changes to memory * (Documentation/RCU/rculist_nulls.txt for details)
net/ipv4/inet_hashtables.c +1 -1
@@ -287,7 +287,7 @@ begintw:if (unlikely (!INET_TW_MATCH (sk, net, acookie, saddr, daddr, ports, dif))) { -sock_put (sk); +inet_twsk_put (inet_twsk (sk)); goto begintw; } goto out;
net/ipv4/ip_output.c +1 -1
@@ -844,7 +844,7 @@ static int __ip_append_data(struct sock *sk, csummode =CHECKSUM_PARTIAL ; cork->length += length; -if (((length > mtu) || (skb &&skb_is_gso (skb))) && +if (((length > mtu) || (skb &&skb_has_frags (skb))) && (sk->sk_protocol ==IPPROTO_UDP ) && (rt->dst.dev->features &NETIF_F_UFO ) && !rt->dst.header_len) { err = ip_ufo_append_data(sk, queue, getfrag, from, length,
net/ipv4/ip_vti.c +11 -3
@@ -285,8 +285,17 @@ static int vti_rcv(struct sk_buff *skb) tunnel =vti_tunnel_lookup (dev_net (skb->dev), iph->saddr, iph->daddr);if (tunnel !=NULL ) {struct pcpu_tstats *tstats; +u32 oldmark = skb->mark; +int ret; -if (!xfrm4_policy_check (NULL ,XFRM_POLICY_IN , skb)) + +/* temporarily mark the skb with the tunnel o_key, to +* only match policies with this mark. +*/ + skb->mark =be32_to_cpu (tunnel->parms.o_key); + ret =xfrm4_policy_check (NULL ,XFRM_POLICY_IN , skb); + skb->mark = oldmark; +if (!ret)return -1 ; tstats =this_cpu_ptr (tunnel->dev->tstats);
@@ -295,7 +304,6 @@ static int vti_rcv(struct sk_buff *skb) tstats->rx_bytes += skb->len;u64_stats_update_end (&tstats->syncp); - skb->mark =0 ;secpath_reset (skb); skb->dev = tunnel->dev;return 1 ;
@@ -327,7 +335,7 @@ static netdev_tx_t vti_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)memset (&fl4,0 ,sizeof (fl4));flowi4_init_output (&fl4, tunnel->parms.link, -be32_to_cpu (tunnel->parms.i_key),RT_TOS (tos), +be32_to_cpu (tunnel->parms.o_key),RT_TOS (tos),RT_SCOPE_UNIVERSE ,IPPROTO_IPIP ,0 , dst, tiph->saddr,0 ,0 );
net/ipv4/route.c +1 -1
@@ -2020,7 +2020,7 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4) RT_SCOPE_LINK); goto make_route; } -if (fl4->saddr) { +if (!fl4->saddr) {if (ipv4_is_multicast (fl4->daddr)) fl4->saddr =inet_select_addr (dev_out,0 , fl4->flowi4_scope);
net/ipv4/sysctl_net_ipv4.c +10 -0
@@ -29,6 +29,7 @@static int zero;static int one =1 ;static int four =4 ; +static int gso_max_segs =GSO_MAX_SEGS ;static int tcp_retr1_max =255 ;static int ip_local_port_range_min[] = {1 ,1 };static int ip_local_port_range_max[] = {65535 ,65535 };
@@ -753,6 +754,15 @@ static struct ctl_table ipv4_table[] = { .extra2 = &four, }, { + .procname = "tcp_min_tso_segs", + .data = &sysctl_tcp_min_tso_segs, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = &zero, + .extra2 = &gso_max_segs, + }, + { .procname = "udp_mem", .data = &sysctl_udp_mem, .maxlen = sizeof(sysctl_udp_mem),
net/ipv4/tcp.c +23 -5
@@ -282,6 +282,8 @@int sysctl_tcp_fin_timeout__read_mostly =TCP_FIN_TIMEOUT ; +int sysctl_tcp_min_tso_segs__read_mostly =2 ; +struct percpu_counter tcp_orphan_count;EXPORT_SYMBOL_GPL (tcp_orphan_count);
@@ -786,12 +788,28 @@ static unsigned int tcp_xmit_size_goal(struct sock *sk, u32 mss_now, xmit_size_goal = mss_now;if (large_allowed &&sk_can_gso (sk)) { - xmit_size_goal = ((sk->sk_gso_max_size -1 ) - -inet_csk (sk)->icsk_af_ops->net_header_len - -inet_csk (sk)->icsk_ext_hdr_len - - tp->tcp_header_len); +u32 gso_size, hlen; + +/* Maybe we should/could use sk->sk_prot->max_header here ? */ + hlen =inet_csk (sk)->icsk_af_ops->net_header_len + +inet_csk (sk)->icsk_ext_hdr_len + + tp->tcp_header_len; + +/* Goal is to send at least one packet per ms, +* not one big TSO packet every 100 ms. +* This preserves ACK clocking and is consistent +* with tcp_tso_should_defer() heuristic. +*/ + gso_size = sk->sk_pacing_rate / (2 *MSEC_PER_SEC ); + gso_size =max_t (u32, gso_size, + sysctl_tcp_min_tso_segs * mss_now); + + xmit_size_goal =min_t (u32, gso_size, + sk->sk_gso_max_size -1 - hlen); -/* TSQ : try to have two TSO segments in flight */ +/* TSQ : try to have at least two segments in flight +* (one in NIC TX ring, another in Qdisc) +*/ xmit_size_goal =min_t (u32, xmit_size_goal, sysctl_tcp_limit_output_bytes >>1 );
net/ipv4/tcp_input.c +38 -3
77 lines not on this page · raw message
net/ipv4/tcp_output.c +18 -10
@@ -887,8 +887,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,skb_orphan (skb); skb->sk = sk; - skb->destructor = (sysctl_tcp_limit_output_bytes >0 ) ? - tcp_wfree : sock_wfree; + skb->destructor = tcp_wfree;atomic_add (skb->truesize, &sk->sk_wmem_alloc);/* Build TCP header and checksum it. */
@@ -977,6 +976,9 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb)static void tcp_set_skb_tso_segs (const struct sock *sk,struct sk_buff *skb,unsigned int mss_now) { +/* Make sure we own this skb before messing gso_size/gso_segs */ +WARN_ON_ONCE (skb_cloned (skb)); +if (skb->len <= mss_now || !sk_can_gso (sk) || skb->ip_summed ==CHECKSUM_NONE ) {/* Avoid the costly divide in the normal
@@ -1058,9 +1060,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len,if (nsize <0 ) nsize =0 ; -if (skb_cloned (skb) && -skb_is_nonlinear (skb) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC )) +if (skb_unclone (skb,GFP_ATOMIC ))return -ENOMEM ;/* Get a new skb... force flag on. */
@@ -1623,7 +1623,7 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb)/* If a full-sized TSO skb can be sent, do it. */ if (limit >= min_t(unsigned int, sk->sk_gso_max_size, - sk->sk_gso_max_segs * tp->mss_cache)) + tp->xmit_size_goal_segs * tp->mss_cache)) goto send_now;/* Middle in queue won't get any more data, full sendable already? */
@@ -1832,7 +1832,6 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,while ((skb =tcp_send_head (sk))) {unsigned int limit; - tso_segs =tcp_init_tso_segs (sk, skb, mss_now);BUG_ON (!tso_segs);
@@ -1861,13 +1860,20 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,break ; } -/* TSQ : sk_wmem_alloc accounts skb truesize, -* including skb overhead. But thats OK. +/* TCP Small Queues : +* Control number of packets in qdisc/devices to two packets / or ~1 ms. +* This allows for : +* - better RTT estimation and ACK scheduling +* - faster recovery +* - high rates */ -if (atomic_read (&sk->sk_wmem_alloc) >= sysctl_tcp_limit_output_bytes) { + limit =max (skb->truesize, sk->sk_pacing_rate >>10 ); + +if (atomic_read (&sk->sk_wmem_alloc) > limit) {set_bit (TSQ_THROTTLED , &tp->tsq_flags);break ; } + limit = mss_now;if (tso_segs >1 && !tcp_urg_mode (tp)) limit = tcp_mss_split_point(sk, skb, mss_now,
@@ -2329,6 +2335,8 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)int oldpcount =tcp_skb_pcount (skb);if (unlikely (oldpcount >1 )) { +if (skb_unclone (skb,GFP_ATOMIC )) +return -ENOMEM ;tcp_init_tso_segs (sk, skb, cur_mss);tcp_adjust_pcount (sk, skb, oldpcount -tcp_skb_pcount (skb)); }
net/ipv6/inet6_hashtables.c +1 -1
@@ -116,7 +116,7 @@ begintw: }if (unlikely (!INET6_TW_MATCH (sk, net, saddr, daddr, ports, dif))) { -sock_put (sk); +inet_twsk_put (inet_twsk (sk)); goto begintw; } goto out;
net/ipv6/ip6_output.c +3 -3
@@ -130,7 +130,7 @@ static int ip6_finish_output2(struct sk_buff *skb) }rcu_read_lock_bh (); - nexthop =rt6_nexthop ((struct rt6_info *)dst, &ipv6_hdr (skb)->daddr); + nexthop =rt6_nexthop ((struct rt6_info *)dst); neigh =__ipv6_neigh_lookup_noref (dst->dev, nexthop);if (unlikely (!neigh)) neigh =__neigh_create (&nd_tbl, nexthop, dst->dev, false);
@@ -898,7 +898,7 @@ static int ip6_dst_lookup_tail(struct sock *sk,*/ rt = (struct rt6_info *) *dst;rcu_read_lock_bh (); - n =__ipv6_neigh_lookup_noref (rt->dst.dev,rt6_nexthop (rt, &fl6->daddr)); + n =__ipv6_neigh_lookup_noref (rt->dst.dev,rt6_nexthop (rt)); err = n && !(n->nud_state &NUD_VALID ) ? -EINVAL :0 ;rcu_read_unlock_bh ();
@@ -1250,7 +1250,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, skb =skb_peek_tail (&sk->sk_write_queue); cork->length += length;if (((length > mtu) || - (skb &&skb_is_gso (skb))) && + (skb &&skb_has_frags (skb))) && (sk->sk_protocol ==IPPROTO_UDP ) && (rt->dst.dev->features &NETIF_F_UFO )) { err = ip6_ufo_append_data(sk, getfrag, from, length,
net/ipv6/route.c +37 -9
86 lines not on this page · raw message
net/l2tp/l2tp_core.c +29 -7
@@ -115,6 +115,11 @@ struct l2tp_net {static void l2tp_session_set_header_len (struct l2tp_session *session,int version);static void l2tp_tunnel_free (struct l2tp_tunnel *tunnel); +static inline struct l2tp_tunnel *l2tp_tunnel (struct sock *sk) +{ +return sk->sk_user_data; +} +static inline struct l2tp_net *l2tp_pernet (struct net *net) {BUG_ON (!net);
@@ -507,7 +512,7 @@ static inline int l2tp_verify_udp_checksum(struct sock *sk,return 0 ;#if IS_ENABLED (CONFIG_IPV6 ) -if (sk->sk_family ==PF_INET6 ) { +if (sk->sk_family ==PF_INET6 && !l2tp_tunnel (sk)->v4mapped) {if (!uh->check) {LIMIT_NETDEBUG (KERN_INFO "L2TP: IPv6: checksum is 0\n" );return 1 ;
@@ -1071,7 +1076,7 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb,/* Queue the packet to IP for output */ skb->local_df =1 ;#if IS_ENABLED (CONFIG_IPV6 ) -if (skb->sk->sk_family ==PF_INET6 ) +if (skb->sk->sk_family ==PF_INET6 && !tunnel->v4mapped) error =inet6_csk_xmit (skb,NULL ); else#endif
@@ -1198,7 +1203,7 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len/* Calculate UDP checksum if configured to do so */ #if IS_ENABLED (CONFIG_IPV6 ) -if (sk->sk_family ==PF_INET6 ) +if (sk->sk_family ==PF_INET6 && !tunnel->v4mapped)l2tp_xmit_ipv6_csum (sk, skb, udp_len); else#endif
@@ -1247,10 +1252,9 @@ EXPORT_SYMBOL_GPL(l2tp_xmit_skb);*/ static void l2tp_tunnel_destruct (struct sock *sk) { -struct l2tp_tunnel *tunnel; +struct l2tp_tunnel *tunnel =l2tp_tunnel (sk);struct l2tp_net *pn; - tunnel = sk->sk_user_data;if (tunnel ==NULL ) goto end;
@@ -1618,7 +1622,7 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 }/* Check if this socket has already been prepped */ - tunnel = (struct l2tp_tunnel *)sk->sk_user_data; + tunnel =l2tp_tunnel (sk);if (tunnel !=NULL ) {/* This socket has already been prepped */ err = -EBUSY ;
@@ -1647,6 +1651,24 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32if (cfg !=NULL ) tunnel->debug = cfg->debug; +#if IS_ENABLED (CONFIG_IPV6 ) +if (sk->sk_family ==PF_INET6 ) { +struct ipv6_pinfo *np =inet6_sk (sk); + +if (ipv6_addr_v4mapped (&np->saddr) && +ipv6_addr_v4mapped (&np->daddr)) { +struct inet_sock *inet =inet_sk (sk); + + tunnel->v4mapped = true; + inet->inet_saddr = np->saddr.s6_addr32[3 ]; + inet->inet_rcv_saddr = np->rcv_saddr.s6_addr32[3 ]; + inet->inet_daddr = np->daddr.s6_addr32[3 ]; + }else { + tunnel->v4mapped = false; + } + } +#endif +/* Mark socket as an encapsulation socket. See net/ipv4/udp.c */ tunnel->encap = encap;if (encap ==L2TP_ENCAPTYPE_UDP ) {
@@ -1655,7 +1677,7 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32udp_sk (sk)->encap_rcv = l2tp_udp_encap_recv;udp_sk (sk)->encap_destroy = l2tp_udp_encap_destroy;#if IS_ENABLED (CONFIG_IPV6 ) -if (sk->sk_family ==PF_INET6 ) +if (sk->sk_family ==PF_INET6 && !tunnel->v4mapped)udpv6_encap_enable (); else#endif
net/l2tp/l2tp_core.h +3 -0
@@ -189,6 +189,9 @@ struct l2tp_tunnel {struct sock *sock;/* Parent socket */ int fd;/* Parent fd, if tunnel socket * was created by userspace */ +#if IS_ENABLED (CONFIG_IPV6 ) +bool v4mapped; +#endif struct work_struct del_work;
net/l2tp/l2tp_ppp.c +4 -0
@@ -353,7 +353,9 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh goto error_put_sess_tun; } +local_bh_disable ();l2tp_xmit_skb (session, skb, session->hdr_len); +local_bh_enable ();sock_put (ps->tunnel_sock);sock_put (sk);
@@ -422,7 +424,9 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) skb->data[0 ] = ppph[0 ]; skb->data[1 ] = ppph[1 ]; +local_bh_disable ();l2tp_xmit_skb (session, skb, session->hdr_len); +local_bh_enable ();sock_put (sk_tun);sock_put (sk);
net/netfilter/nf_conntrack_h323_main.c +2 -2
@@ -778,8 +778,8 @@ static int callforward_do_filter(const union nf_inet_addr *src, flowi6_to_flowi(&fl1), false)) {if (!afinfo->route (&init_net, (struct dst_entry **)&rt2,flowi6_to_flowi (&fl2), false)) { -if (!memcmp (&rt1->rt6i_gateway, &rt2->rt6i_gateway, -sizeof (rt1->rt6i_gateway)) && +if (ipv6_addr_equal (rt6_nexthop (rt1), +rt6_nexthop (rt2)) && rt1->dst.dev == rt2->dst.dev) ret =1 ;dst_release (&rt2->dst);
net/sctp/output.c +2 -1
@@ -547,7 +547,8 @@ int sctp_packet_transmit(struct sctp_packet *packet)* by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. */ if (!sctp_checksum_disable) { -if (!(dst->dev->features &NETIF_F_SCTP_CSUM )) { +if (!(dst->dev->features &NETIF_F_SCTP_CSUM ) || + (dst_xfrm (dst) !=NULL ) || packet->ipfragok) {__u32 crc32 =sctp_start_cksum ((__u8 *)sh, cksum_buf_len);/* 3) Put the resultant value into the checksum field in the
net/socket.c +20 -4
@@ -1956,6 +1956,16 @@ struct used_address {unsigned int name_len; }; +static int copy_msghdr_from_user (struct msghdr *kmsg, +struct msghdr __user *umsg) +{ +if (copy_from_user (kmsg, umsg,sizeof (struct msghdr ))) +return -EFAULT ; +if (kmsg->msg_namelen >sizeof (struct sockaddr_storage )) +return -EINVAL ; +return 0 ; +} +static int ___sys_sendmsg (struct socket *sock,struct msghdr __user *msg,struct msghdr *msg_sys,unsigned int flags,struct used_address *used_address)
@@ -1974,8 +1984,11 @@ static int ___sys_sendmsg(struct socket *sock, struct msghdr __user *msg,if (MSG_CMSG_COMPAT & flags) {if (get_compat_msghdr (msg_sys, msg_compat))return -EFAULT ; - }else if (copy_from_user (msg_sys, msg,sizeof (struct msghdr ))) -return -EFAULT ; + }else { + err =copy_msghdr_from_user (msg_sys, msg); +if (err) +return err; + }if (msg_sys->msg_iovlen >UIO_FASTIOV ) { err = -EMSGSIZE ;
@@ -2183,8 +2196,11 @@ static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg,if (MSG_CMSG_COMPAT & flags) {if (get_compat_msghdr (msg_sys, msg_compat))return -EFAULT ; - }else if (copy_from_user (msg_sys, msg,sizeof (struct msghdr ))) -return -EFAULT ; + }else { + err =copy_msghdr_from_user (msg_sys, msg); +if (err) +return err; + }if (msg_sys->msg_iovlen >UIO_FASTIOV ) { err = -EMSGSIZE ;
net/unix/af_unix.c +10 -0
@@ -1245,6 +1245,15 @@ static int unix_socketpair(struct socket *socka, struct socket *sockb)return 0 ; } +static void unix_sock_inherit_flags (const struct socket *old, +struct socket *new) +{ +if (test_bit (SOCK_PASSCRED , &old->flags)) +set_bit (SOCK_PASSCRED , &new->flags); +if (test_bit (SOCK_PASSSEC , &old->flags)) +set_bit (SOCK_PASSSEC , &new->flags); +} +static int unix_accept (struct socket *sock,struct socket *newsock,int flags) {struct sock *sk = sock->sk;
@@ -1279,6 +1288,7 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags)/* attach accepted sock to socket */ unix_state_lock (tsk); newsock->state =SS_CONNECTED ; +unix_sock_inherit_flags (sock, newsock);sock_graft (tsk, newsock);unix_state_unlock (tsk);return 0 ;
net/unix/diag.c +1 -0
@@ -124,6 +124,7 @@ static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_r rep->udiag_family =AF_UNIX ; rep->udiag_type = sk->sk_type; rep->udiag_state = sk->sk_state; + rep->pad =0 ; rep->udiag_ino = sk_ino;sock_diag_save_cookie (sk, rep->udiag_cookie);
net/wireless/radiotap.c +6 -1
@@ -97,6 +97,10 @@ int ieee80211_radiotap_iterator_init(struct ieee80211_radiotap_header *radiotap_header, int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns) { + /* check the radiotap header can actually be present */ + if (max_length < sizeof(struct ieee80211_radiotap_header)) + return -EINVAL; +/* Linux only supports version 0 radiotap format */ if (radiotap_header->it_version)return -EINVAL ;
@@ -131,7 +135,8 @@ int ieee80211_radiotap_iterator_init(*/ if ((unsigned long )iterator->_arg - - (unsigned long )iterator->_rtheader > + (unsigned long )iterator->_rtheader + +sizeof (uint32_t ) > (unsigned long )iterator->_max_length)return -EINVAL ; }
sound/pci/hda/hda_generic.c +1 -1
@@ -3474,7 +3474,7 @@ static int create_capture_mixers(struct hda_codec *codec)if (!multi) err =create_single_cap_vol_ctl (codec, n, vol, sw, inv_dmic); -else if (!multi_cap_vol) +else if (!multi_cap_vol && !inv_dmic) err =create_bind_cap_vol_ctl (codec, n, vol, sw);else err =create_multi_cap_vol_ctl (codec);
sound/usb/usx2y/us122l.c +3 -1
@@ -262,7 +262,9 @@ static int usb_stream_hwdep_mmap(struct snd_hwdep *hw, } area->vm_ops = &usb_stream_hwdep_vm_ops; - area->vm_flags |=VM_DONTEXPAND |VM_DONTDUMP ; + area->vm_flags |=VM_DONTDUMP ; +if (!read) + area->vm_flags |=VM_DONTEXPAND ; area->vm_private_data = us122l;atomic_inc (&us122l->mmap_count); out: