Linux 4.2.3
Greg KH
maintainerI'm announcing the release of the 4.2.3 kernel.
All users of the 4.2 kernel series must upgrade.
The updated 4.2.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.2.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/devicetree/bindings/net/ethernet.txt | 4 Makefile | 2 drivers/block/zram/zcomp.c | 12 - drivers/net/dsa/bcm_sf2.c | 30 --- drivers/net/dsa/bcm_sf2.h | 4 drivers/net/dsa/mv88e6xxx.c | 1 drivers/net/ethernet/altera/altera_tse_main.c | 3 drivers/net/ethernet/freescale/fec_main.c | 1 drivers/net/ethernet/marvell/mvneta.c | 13 - drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 drivers/net/ethernet/mellanox/mlx4/main.c | 10 - drivers/net/macvtap.c | 4 drivers/net/phy/fixed_phy.c | 8 drivers/net/phy/mdio_bus.c | 2 drivers/net/ppp/ppp_generic.c | 4 drivers/of/of_mdio.c | 19 + drivers/platform/x86/hp-wmi.c | 31 ++- net/bridge/br_multicast.c | 4 net/core/fib_rules.c | 14 - net/core/rtnetlink.c | 26 +- net/core/sock_diag.c | 3 net/ipv4/tcp_output.c | 1 net/ipv6/exthdrs_offload.c | 2 net/ipv6/ip6mr.c | 2 net/ipv6/route.c | 201 ++++++++++++++++++--- net/netlink/af_netlink.c | 63 +++++- net/netlink/af_netlink.h | 10 + net/openvswitch/datapath.c | 4 net/openvswitch/flow_table.c | 23 +- net/openvswitch/flow_table.h | 2 net/packet/af_packet.c | 32 +-- net/sched/cls_fw.c | 30 +-- net/sctp/protocol.c | 64 ++++-- 33 files changed, 446 insertions(+), 185 deletions(-)
Atsushi Nemoto (1):
net: eth: altera: fix napi poll_list corruption
Carol L Soto (1):
net/mlx4_core: Capping number of requested MSIXs to MAX_MSIX
Daniel Borkmann (3):
sock, diag: fix panic in sock_diag_put_filterinfo
ipv6: fix exthdrs offload registration in out_rt path netlink, mmap: transform mmap skb into full skb on taps
David Woodhouse (1):
Fix AF_PACKET ABI breakage in 4.2
Eric Dumazet (2):
net/mlx4_en: really allow to change RSS key
tcp: add proper TS val into RST packets
Florian Fainelli (3):
net: dsa: bcm_sf2: Fix ageing conditions and operation
net: dsa: bcm_sf2: Fix 64-bits register writes
net: dsa: bcm_sf2: Do not override speed settings
Greg Kroah-Hartman (1):
Linux 4.2.3
Guillaume Nault (1):
ppp: fix lockdep splat in ppp_dev_uninit()
Herbert Xu (2):
netlink: Fix autobind race condition that leads to zero port ID
netlink: Replace rhash_portid with bound
Jesse Gross (1):
openvswitch: Zero flows on allocation.
Kyle Evans (1):
hp-wmi: limit hotkey enable
Linus Lüssing (1):
bridge: fix igmpv3 / mldv2 report parsing
Luis Henriques (1):
zram: fix possible use after free in zcomp_create()
Marcelo Ricardo Leitner (1):
sctp: fix race on protocol/netns initialization
Mark Salter (1):
phylib: fix device deletion order in mdiobus_unregister()
Michael S. Tsirkin (1):
macvtap: fix TUNSETSNDBUF values > 64k
Richard Laing (1):
net/ipv6: Correct PIM6 mrt_lock handling
Roopa Prabhu (2):
ipv6: fix multipath route replace error recovery
rtnetlink: catch -EOPNOTSUPP errors from ndo_bridge_getlink
Russell King (2):
net: fec: clear receive interrupts before processing a packet
net: dsa: actually force the speed on the CPU port
Simon Guinot (1):
net: mvneta: fix DMA buffer unmapping in mvneta_rx()
Stas Sergeev (3):
net: phy: fixed_phy: handle link-down case
of_mdio: add new DT property 'managed' to specify the PHY management type
mvneta: use inband status only when explicitly enabled
WANG Cong (1):
net: revert "net_sched: move tp->root allocation into fw_init()"
Wilson Kok (1):
fib_rules: fix fib rule dumps across multiple skbs
Greg KH
maintainerDocumentation/devicetree/bindings/net/ethernet.txt +4 -0
@@ -25,7 +25,11 @@ The following properties are common to the Ethernet controllers: flow control thresholds. - tx-fifo-depth: the size of the controller's transmit fifo in bytes. This is used for components that can have configurable fifo sizes. +- managed: string, specifies the PHY management type. Supported values are: + "auto", "in-band-status". "auto" is the default, it usess MDIO for + management if fixed-link is not specified. Child nodes of the Ethernet controller are typically the individual PHY devices connected via the MDIO bus (sometimes the MDIO bus controller is separate). They are described in the phy.txt file in this same directory. +For non-MDIO PHY management see fixed-link.txt.
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 2 -SUBLEVEL = 2 +SUBLEVEL = 3 EXTRAVERSION = NAME = Hurr durr I'ma sheep
drivers/block/zram/zcomp.c +7 -5
@@ -330,12 +330,14 @@ void zcomp_destroy(struct zcomp *comp)* allocate new zcomp and initialize it. return compressing * backend pointer or ERR_PTR if things went bad. ERR_PTR(-EINVAL) * if requested algorithm is not supported, ERR_PTR(-ENOMEM) in -* case of allocation error. +* case of allocation error, or any other error potentially +* returned by functions zcomp_strm_{multi,single}_create. */ struct zcomp *zcomp_create (const char *compress,int max_strm) {struct zcomp *comp;struct zcomp_backend *backend; +int error; backend =find_backend (compress);if (!backend)
@@ -347,12 +349,12 @@ struct zcomp *zcomp_create(const char *compress, int max_strm) comp->backend = backend;if (max_strm >1 ) -zcomp_strm_multi_create (comp, max_strm); + error =zcomp_strm_multi_create (comp, max_strm);else -zcomp_strm_single_create (comp); -if (!comp->stream) { + error =zcomp_strm_single_create (comp); +if (error) {kfree (comp); -return ERR_PTR (-ENOMEM ); +return ERR_PTR (error); }return comp; }
drivers/net/dsa/bcm_sf2.c +9 -21
@@ -418,7 +418,7 @@ static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port)core_writel (priv, port,CORE_FAST_AGE_PORT ); reg =core_readl (priv,CORE_FAST_AGE_CTRL ); - reg |=EN_AGE_PORT |FAST_AGE_STR_DONE ; + reg |=EN_AGE_PORT |EN_AGE_DYNAMIC |FAST_AGE_STR_DONE ;core_writel (priv, reg,CORE_FAST_AGE_CTRL ); do {
@@ -432,6 +432,8 @@ static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port)if (!timeout)return -ETIMEDOUT ; +core_writel (priv,0 ,CORE_FAST_AGE_CTRL ); +return 0 ; }
@@ -507,7 +509,7 @@ static int bcm_sf2_sw_br_set_stp_state(struct dsa_switch *ds, int port,u32 reg; reg =core_readl (priv,CORE_G_PCTL_PORT (port)); - cur_hw_state = reg >>G_MISTP_STATE_SHIFT ; + cur_hw_state = reg & (G_MISTP_STATE_MASK <<G_MISTP_STATE_SHIFT );switch (state) {case BR_STATE_DISABLED :
@@ -531,10 +533,12 @@ static int bcm_sf2_sw_br_set_stp_state(struct dsa_switch *ds, int port, }/* Fast-age ARL entries if we are moving a port from Learning or -* Forwarding state to Disabled, Blocking or Listening state +* Forwarding (cur_hw_state) state to Disabled, Blocking or Listening +* state (hw_state) */ if (cur_hw_state != hw_state) { -if (cur_hw_state &4 && !(hw_state &4 )) { +if (cur_hw_state >=G_MISTP_LEARN_STATE && + hw_state <=G_MISTP_LISTEN_STATE ) { ret =bcm_sf2_sw_fast_age_port (ds, port);if (ret) {pr_err ("%s: fast-ageing failed\n" , __func__);
@@ -901,15 +905,11 @@ static void bcm_sf2_sw_fixed_link_update(struct dsa_switch *ds, int port, struct fixed_phy_status *status) {struct bcm_sf2_priv *priv =ds_to_priv (ds); -u32 duplex, pause, speed; +u32 duplex, pause;u32 reg; duplex =core_readl (priv,CORE_DUPSTS ); pause =core_readl (priv,CORE_PAUSESTS ); - speed =core_readl (priv,CORE_SPDSTS ); - - speed >>= (port *SPDSTS_SHIFT ); - speed &=SPDSTS_MASK ; status->link =0 ;
@@ -944,18 +944,6 @@ static void bcm_sf2_sw_fixed_link_update(struct dsa_switch *ds, int port, reg &= ~LINK_STS ;core_writel (priv, reg,CORE_STS_OVERRIDE_GMIIP_PORT (port)); -switch (speed) { -case SPDSTS_10 : - status->speed =SPEED_10 ; -break ; -case SPDSTS_100 : - status->speed =SPEED_100 ; -break ; -case SPDSTS_1000 : - status->speed =SPEED_1000 ; -break ; - } -if ((pause & (1 << port)) && (pause & (1 << (port +PAUSESTS_TX_PAUSE_SHIFT )))) { status->asym_pause =1 ;
drivers/net/dsa/bcm_sf2.h +2 -2
@@ -112,8 +112,8 @@ static inline u64 name##_readq(struct bcm_sf2_priv *priv, u32 off) \spin_unlock (&priv->indir_lock); \return (u64 )indir <<32 | dir; \ } \ -static inline void name##_writeq(struct bcm_sf2_priv *priv, u32 off, \ -u64 val) \ +static inline void name##_writeq(struct bcm_sf2_priv *priv, u64 val, \ +u32 off) \ { \spin_lock (&priv->indir_lock); \reg_writel (priv,upper_32_bits (val),REG_DIR_DATA_WRITE ); \
drivers/net/dsa/mv88e6xxx.c +1 -0
@@ -1387,6 +1387,7 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port) reg =_mv88e6xxx_reg_read (ds,REG_PORT (port),PORT_PCS_CTRL );if (dsa_is_cpu_port (ds, port) || ds->dsa_port_mask & (1 << port)) { + reg &= ~PORT_PCS_CTRL_UNFORCED ; reg |=PORT_PCS_CTRL_FORCE_LINK |PORT_PCS_CTRL_LINK_UP | PORT_PCS_CTRL_DUPLEX_FULL |
drivers/net/ethernet/altera/altera_tse_main.c +1 -2
@@ -511,8 +511,7 @@ static int tse_poll(struct napi_struct *napi, int budget)if (rxcomplete < budget) { -napi_gro_flush (napi, false); -__napi_complete (napi); +napi_complete (napi); netdev_dbg(priv->dev, "NAPI Complete, did %d packets with budget %d\n",
drivers/net/ethernet/freescale/fec_main.c +1 -0
@@ -1402,6 +1402,7 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)if ((status &BD_ENET_RX_LAST ) ==0 )netdev_err (ndev,"rcv is not +last\n" ); +writel (FEC_ENET_RXF , fep->hwp +FEC_IEVENT );/* Check for errors. */ if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO |
drivers/net/ethernet/marvell/mvneta.c +8 -5
@@ -1479,6 +1479,7 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo,struct mvneta_rx_desc *rx_desc =mvneta_rxq_next_desc_get (rxq);struct sk_buff *skb;unsigned char *data; +dma_addr_t phys_addr;u32 rx_status;int rx_bytes, err;
@@ -1486,6 +1487,7 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo, rx_status = rx_desc->status; rx_bytes = rx_desc->data_size - (ETH_FCS_LEN +MVNETA_MH_SIZE ); data = (unsigned char *)rx_desc->buf_cookie; + phys_addr = rx_desc->buf_phys_addr;if (!mvneta_rxq_desc_is_first_last (rx_status) || (rx_status &MVNETA_RXD_ERR_SUMMARY )) {
@@ -1534,7 +1536,7 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo,if (!skb) goto err_drop_frame; -dma_unmap_single (dev->dev.parent, rx_desc->buf_phys_addr, +dma_unmap_single (dev->dev.parent, phys_addr,MVNETA_RX_BUF_SIZE (pp->pkt_size),DMA_FROM_DEVICE ); rcvd_pkts++;
@@ -3027,8 +3029,8 @@ static int mvneta_probe(struct platform_device *pdev)const char *dt_mac_addr;char hw_mac_addr[ETH_ALEN ];const char *mac_from; +const char *managed;int phy_mode; -int fixed_phy =0 ;int err;/* Our multiqueue support is not complete, so for now, only
@@ -3062,7 +3064,6 @@ static int mvneta_probe(struct platform_device *pdev)dev_err (&pdev->dev,"cannot register fixed PHY\n" ); goto err_free_irq; } - fixed_phy =1 ;/* In the case of a fixed PHY, the DT node associated * to the PHY is the Ethernet MAC DT node.
@@ -3086,8 +3087,10 @@ static int mvneta_probe(struct platform_device *pdev) pp =netdev_priv (dev); pp->phy_node = phy_node; pp->phy_interface = phy_mode; - pp->use_inband_status = (phy_mode ==PHY_INTERFACE_MODE_SGMII ) && - fixed_phy; + + err =of_property_read_string (dn,"managed" , &managed); + pp->use_inband_status = (err ==0 && +strcmp (managed,"in-band-status" ) ==0 ); pp->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (pp->clk)) {
drivers/net/ethernet/mellanox/mlx4/en_rx.c +0 -2
@@ -1250,8 +1250,6 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv) rss_context->hash_fn =MLX4_RSS_HASH_TOP ;memcpy (rss_context->rss_key, priv->rss_key,MLX4_EN_RSS_KEY_SIZE ); -netdev_rss_key_fill (rss_context->rss_key, -MLX4_EN_RSS_KEY_SIZE ); }else {en_err (priv,"Unknown RSS hash function requested\n" ); err = -EINVAL ;
drivers/net/ethernet/mellanox/mlx4/main.c +9 -1
@@ -2654,9 +2654,14 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)if (msi_x) {int nreq = dev->caps.num_ports *num_online_cpus () +1 ; +bool shared_ports = false; nreq =min_t (int, dev->caps.num_eqs - dev->caps.reserved_eqs, nreq); +if (nreq >MAX_MSIX ) { + nreq =MAX_MSIX ; + shared_ports = true; + } entries =kcalloc (nreq,sizeof *entries,GFP_KERNEL );if (!entries)
@@ -2679,6 +2684,9 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)bitmap_zero (priv->eq_table.eq[MLX4_EQ_ASYNC ].actv_ports.ports, dev->caps.num_ports); +if (MLX4_IS_LEGACY_EQ_MODE (dev->caps)) + shared_ports = true; +for (i =0 ; i < dev->caps.num_comp_vectors +1 ; i++) {if (i ==MLX4_EQ_ASYNC )continue ;
@@ -2686,7 +2694,7 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) priv->eq_table.eq[i].irq = entries[i +1 - !!(i >MLX4_EQ_ASYNC )].vector; -if (MLX4_IS_LEGACY_EQ_MODE (dev->caps)) { +if (shared_ports) {bitmap_fill (priv->eq_table.eq[i].actv_ports.ports, dev->caps.num_ports);/* We don't set affinity hint when there
drivers/net/macvtap.c +2 -2
@@ -1111,10 +1111,10 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,return 0 ;case TUNSETSNDBUF : -if (get_user (u, up)) +if (get_user (s, sp))return -EFAULT ; - q->sk.sk_sndbuf = u; + q->sk.sk_sndbuf = s;return 0 ;case TUNGETVNETHDRSZ :
drivers/net/phy/fixed_phy.c +5 -3
@@ -52,6 +52,10 @@ static int fixed_phy_update_regs(struct fixed_phy *fp)u16 lpagb =0 ;u16 lpa =0 ; +if (!fp->status.link) + goto done; + bmsr |=BMSR_LSTATUS |BMSR_ANEGCOMPLETE ; +if (fp->status.duplex) { bmcr |=BMCR_FULLDPLX ;
@@ -96,15 +100,13 @@ static int fixed_phy_update_regs(struct fixed_phy *fp) } } -if (fp->status.link) - bmsr |=BMSR_LSTATUS |BMSR_ANEGCOMPLETE ; -if (fp->status.pause) lpa |=LPA_PAUSE_CAP ;if (fp->status.asym_pause) lpa |=LPA_PAUSE_ASYM ; +done: fp->regs[MII_PHYSID1 ] =0 ; fp->regs[MII_PHYSID2 ] =0 ;
drivers/net/phy/mdio_bus.c +1 -1
@@ -303,12 +303,12 @@ void mdiobus_unregister(struct mii_bus *bus)BUG_ON (bus->state !=MDIOBUS_REGISTERED ); bus->state =MDIOBUS_UNREGISTERED ; -device_del (&bus->dev);for (i =0 ; i <PHY_MAX_ADDR ; i++) {if (bus->phy_map[i])device_unregister (&bus->phy_map[i]->dev); bus->phy_map[i] =NULL ; } +device_del (&bus->dev); }EXPORT_SYMBOL (mdiobus_unregister);
drivers/net/ppp/ppp_generic.c +3 -1
@@ -2742,6 +2742,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,*/ dev_net_set (dev, net); +rtnl_lock ();mutex_lock (&pn->all_ppp_mutex);if (unit <0 ) {
@@ -2772,7 +2773,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit, ppp->file.index = unit;sprintf (dev->name,"ppp%d" , unit); - ret =register_netdev (dev); + ret =register_netdevice (dev);if (ret !=0 ) {unit_put (&pn->units_idr, unit); netdev_err(ppp->dev, "PPP: couldn't register device %s (%d)\n",
@@ -2784,6 +2785,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,atomic_inc (&ppp_unit_count);mutex_unlock (&pn->all_ppp_mutex); +rtnl_unlock (); *retp =0 ;return ppp;
drivers/of/of_mdio.c +17 -2
@@ -266,7 +266,8 @@ EXPORT_SYMBOL(of_phy_attach);bool of_phy_is_fixed_link (struct device_node *np) {struct device_node *dn; -int len; +int len, err; +const char *managed;/* New binding */ dn =of_get_child_by_name (np,"fixed-link" );
@@ -275,6 +276,10 @@ bool of_phy_is_fixed_link(struct device_node *np)return true; } + err =of_property_read_string (np,"managed" , &managed); +if (err ==0 &&strcmp (managed,"auto" ) !=0 ) +return true; +/* Old binding */ if (of_get_property (np,"fixed-link" , &len) && len == (5 *sizeof (__be32)))
@@ -289,8 +294,18 @@ int of_phy_register_fixed_link(struct device_node *np)struct fixed_phy_status status = {};struct device_node *fixed_link_node;const __be32 *fixed_link_prop; -int len; +int len, err;struct phy_device *phy; +const char *managed; + + err =of_property_read_string (np,"managed" , &managed); +if (err ==0 ) { +if (strcmp (managed,"in-band-status" ) ==0 ) { +/* status is zeroed, namely its .link member */ + phy =fixed_phy_register (PHY_POLL , &status, np); +return IS_ERR (phy) ?PTR_ERR (phy) :0 ; + } + }/* New binding */ fixed_link_node =of_get_child_by_name (np,"fixed-link" );
drivers/platform/x86/hp-wmi.c +20 -11
@@ -54,8 +54,9 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");#define HPWMI_HARDWARE_QUERY 0x4#define HPWMI_WIRELESS_QUERY 0x5#define HPWMI_BIOS_QUERY 0x9 +#define HPWMI_FEATURE_QUERY 0xb#define HPWMI_HOTKEY_QUERY 0xc -#define HPWMI_FEATURE_QUERY 0xd +#define HPWMI_FEATURE2_QUERY 0xd#define HPWMI_WIRELESS2_QUERY 0x1b#define HPWMI_POSTCODEERROR_QUERY 0x2a
@@ -295,25 +296,33 @@ static int hp_wmi_tablet_state(void)return (state &0x4 ) ?1 :0 ; } -static int __init hp_wmi_bios_2009_later (void ) +static int __init hp_wmi_bios_2008_later (void ) {int state =0 ;int ret =hp_wmi_perform_query (HPWMI_FEATURE_QUERY ,0 , &state,sizeof (state),sizeof (state)); -if (ret) -return ret; +if (!ret) +return 1 ; -return (state &0x10 ) ?1 :0 ; +return (ret ==HPWMI_RET_UNKNOWN_CMDTYPE ) ?0 : -ENXIO ; } -static int hp_wmi_enable_hotkeys (void ) +static int __init hp_wmi_bios_2009_later (void ) { -int ret; -int query =0x6e ; +int state =0 ; +int ret =hp_wmi_perform_query (HPWMI_FEATURE2_QUERY ,0 , &state, +sizeof (state),sizeof (state)); +if (!ret) +return 1 ; - ret =hp_wmi_perform_query (HPWMI_BIOS_QUERY ,1 , &query,sizeof (query), -0 ); +return (ret ==HPWMI_RET_UNKNOWN_CMDTYPE ) ?0 : -ENXIO ; +} +static int __init hp_wmi_enable_hotkeys (void ) +{ +int value =0x6e ; +int ret =hp_wmi_perform_query (HPWMI_BIOS_QUERY ,1 , &value, +sizeof (value),0 );if (ret)return -EINVAL ;return 0 ;
@@ -663,7 +672,7 @@ static int __init hp_wmi_input_setup(void) hp_wmi_tablet_state());input_sync (hp_wmi_input_dev); -if (hp_wmi_bios_2009_later () ==4 ) +if (!hp_wmi_bios_2009_later () &&hp_wmi_bios_2008_later ())hp_wmi_enable_hotkeys (); status =wmi_install_notify_handler (HPWMI_EVENT_GUID , hp_wmi_notify,NULL );
net/bridge/br_multicast.c +2 -2
@@ -991,7 +991,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br, ih =igmpv3_report_hdr (skb); num =ntohs (ih->ngrec); - len =sizeof (*ih); + len =skb_transport_offset (skb) +sizeof (*ih);for (i =0 ; i < num; i++) { len +=sizeof (*grec);
@@ -1052,7 +1052,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br, icmp6h =icmp6_hdr (skb); num =ntohs (icmp6h->icmp6_dataun.un_data16[1 ]); - len =sizeof (*icmp6h); + len =skb_transport_offset (skb) +sizeof (*icmp6h);for (i =0 ; i < num; i++) {__be16 *nsrcs, _nsrcs;
net/core/fib_rules.c +9 -5
@@ -615,15 +615,17 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb, {int idx =0 ;struct fib_rule *rule; +int err =0 ;rcu_read_lock ();list_for_each_entry_rcu (rule, &ops->rules_list, list) {if (idx < cb->args[1 ]) goto skip; -if (fib_nl_fill_rule (skb, rule,NETLINK_CB (cb->skb).portid, - cb->nlh->nlmsg_seq,RTM_NEWRULE , -NLM_F_MULTI , ops) <0 ) + err =fib_nl_fill_rule (skb, rule,NETLINK_CB (cb->skb).portid, + cb->nlh->nlmsg_seq,RTM_NEWRULE , +NLM_F_MULTI , ops); +if (err)break ; skip: idx++;
@@ -632,7 +634,7 @@ skip: cb->args[1 ] = idx;rules_ops_put (ops); -return skb->len; +return err; }static int fib_nl_dumprule (struct sk_buff *skb,struct netlink_callback *cb)
@@ -648,7 +650,9 @@ static int fib_nl_dumprule(struct sk_buff *skb, struct netlink_callback *cb)if (ops ==NULL )return -EAFNOSUPPORT ; -return dump_rules (skb, cb, ops); +dump_rules (skb, cb, ops); + +return skb->len; }rcu_read_lock ();
net/core/rtnetlink.c +16 -10
@@ -3021,6 +3021,7 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb)u32 portid =NETLINK_CB (cb->skb).portid;u32 seq = cb->nlh->nlmsg_seq;u32 filter_mask =0 ; +int err;if (nlmsg_len (cb->nlh) >sizeof (struct ifinfomsg )) {struct nlattr *extfilt;
@@ -3041,20 +3042,25 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb)struct net_device *br_dev =netdev_master_upper_dev_get (dev);if (br_dev && br_dev->netdev_ops->ndo_bridge_getlink) { -if (idx >= cb->args[0 ] && - br_dev->netdev_ops->ndo_bridge_getlink ( - skb, portid, seq, dev, filter_mask, -NLM_F_MULTI ) <0 ) -break ; +if (idx >= cb->args[0 ]) { + err = br_dev->netdev_ops->ndo_bridge_getlink ( + skb, portid, seq, dev, + filter_mask,NLM_F_MULTI ); +if (err <0 && err != -EOPNOTSUPP ) +break ; + } idx++; }if (ops->ndo_bridge_getlink) { -if (idx >= cb->args[0 ] && - ops->ndo_bridge_getlink (skb, portid, seq, dev, - filter_mask, -NLM_F_MULTI ) <0 ) -break ; +if (idx >= cb->args[0 ]) { + err = ops->ndo_bridge_getlink (skb, portid, + seq, dev, + filter_mask, +NLM_F_MULTI ); +if (err <0 && err != -EOPNOTSUPP ) +break ; + } idx++; } }
net/core/sock_diag.c +3 -0
@@ -90,6 +90,9 @@ int sock_diag_put_filterinfo(bool may_report_filterinfo, struct sock *sk, goto out; fprog = filter->prog->orig_prog; +if (!fprog) + goto out; + flen =bpf_classic_proglen (fprog); attr =nla_reserve (skb, attrtype, flen);
net/ipv4/tcp_output.c +1 -0
@@ -2898,6 +2898,7 @@ void tcp_send_active_reset(struct sock *sk, gfp_t priority)skb_reserve (skb,MAX_TCP_HEADER );tcp_init_nondata_skb (skb,tcp_acceptable_seq (sk),TCPHDR_ACK |TCPHDR_RST ); +skb_mstamp_get (&skb->skb_mstamp);/* Send it off. */ if (tcp_transmit_skb (sk, skb,0 , priority))NET_INC_STATS (sock_net (sk),LINUX_MIB_TCPABORTFAILED );
net/ipv6/exthdrs_offload.c +1 -1
@@ -36,6 +36,6 @@ out:return ret; out_rt: -inet_del_offload (&rthdr_offload,IPPROTO_ROUTING ); +inet6_del_offload (&rthdr_offload,IPPROTO_ROUTING ); goto out; }
net/ipv6/ip6mr.c +1 -1
@@ -550,7 +550,7 @@ static void ipmr_mfc_seq_stop(struct seq_file *seq, void *v)if (it->cache == &mrt->mfc6_unres_queue)spin_unlock_bh (&mfc_unres_lock); -else if (it->cache == mrt->mfc6_cache_array) +else if (it->cache == &mrt->mfc6_cache_array[it->ct])read_unlock (&mrt_lock); }
net/ipv6/route.c +175 -26
270 lines not on this page · raw message
net/netlink/af_netlink.c +49 -14
137 lines not on this page · raw message
net/netlink/af_netlink.h +10 -0
@@ -35,6 +35,7 @@ struct netlink_sock {unsigned long state;size_t max_recvmsg_len;wait_queue_head_t wait; +bool bound;bool cb_running;struct netlink_callback cb;struct mutex *cb_mutex;
@@ -59,6 +60,15 @@ static inline struct netlink_sock *nlk_sk(struct sock *sk) return container_of(sk, struct netlink_sock, sk); } +static inline bool netlink_skb_is_mmaped (const struct sk_buff *skb) +{ +#ifdef CONFIG_NETLINK_MMAP +return NETLINK_CB (skb).flags &NETLINK_SKB_MMAPED ; +#else +return false; +#endif /* CONFIG_NETLINK_MMAP */ +} +struct netlink_table {struct rhashtable hash;struct hlist_head mc_list;
net/openvswitch/datapath.c +2 -2
@@ -920,7 +920,7 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)if (error) goto err_kfree_flow; -ovs_flow_mask_key (&new_flow->key, &key, &mask); +ovs_flow_mask_key (&new_flow->key, &key, true, &mask);/* Extract flow identifier. */ error = ovs_nla_get_identifier(&new_flow->id, a[OVS_FLOW_ATTR_UFID],
@@ -1047,7 +1047,7 @@ static struct sw_flow_actions *get_flow_actions(const struct nlattr *a,struct sw_flow_key masked_key;int error; -ovs_flow_mask_key (&masked_key, key, mask); +ovs_flow_mask_key (&masked_key, key, true, mask); error =ovs_nla_copy_actions (a, &masked_key, &acts, log);if (error) { OVS_NLERR(log,
net/openvswitch/flow_table.c +12 -11
@@ -56,20 +56,21 @@ static u16 range_n_bytes(const struct sw_flow_key_range *range) }void ovs_flow_mask_key (struct sw_flow_key *dst,const struct sw_flow_key *src, -const struct sw_flow_mask *mask) +bool full,const struct sw_flow_mask *mask) { -const long *m = (const long *)((const u8 *)&mask->key + - mask->range.start); -const long *s = (const long *)((const u8 *)src + - mask->range.start); -long *d = (long *)((u8 *)dst + mask->range.start); +int start = full ?0 : mask->range.start; +int len = full ?sizeof *dst :range_n_bytes (&mask->range); +const long *m = (const long *)((const u8 *)&mask->key + start); +const long *s = (const long *)((const u8 *)src + start); +long *d = (long *)((u8 *)dst + start);int i; -/* The memory outside of the 'mask->range' are not set since -* further operations on 'dst' only uses contents within -* 'mask->range'. +/* If 'full' is true then all of 'dst' is fully initialized. Otherwise, +* if 'full' is false the memory outside of the 'mask->range' is left +* uninitialized. This can be used as an optimization when further +* operations on 'dst' only use contents within 'mask->range'. */ -for (i =0 ; i <range_n_bytes (&mask->range); i +=sizeof (long )) +for (i =0 ; i < len; i +=sizeof (long )) *d++ = *s++ & *m++; }
@@ -473,7 +474,7 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti,u32 hash;struct sw_flow_key masked_key; -ovs_flow_mask_key (&masked_key, unmasked, mask); +ovs_flow_mask_key (&masked_key, unmasked, false, mask); hash =flow_hash (&masked_key, &mask->range); head =find_bucket (ti, hash);hlist_for_each_entry_rcu (flow, head, flow_table.node[ti->node_ver]) {
net/openvswitch/flow_table.h +1 -1
@@ -86,5 +86,5 @@ struct sw_flow *ovs_flow_tbl_lookup_ufid(struct flow_table *,bool ovs_flow_cmp (const struct sw_flow *,const struct sw_flow_match *);void ovs_flow_mask_key (struct sw_flow_key *dst,const struct sw_flow_key *src, -const struct sw_flow_mask *mask); +bool full,const struct sw_flow_mask *mask);#endif /* flow_table.h */
net/packet/af_packet.c +17 -15
@@ -229,6 +229,8 @@ struct packet_skb_cb { } sa; }; +#define vio_le () virtio_legacy_is_little_endian() +#define PACKET_SKB_CB (__skb) ((struct packet_skb_cb *)((__skb)->cb))#define GET_PBDQC_FROM_RB (x) ((struct tpacket_kbdq_core *)(&(x)->prb_bdqc))
@@ -2561,15 +2563,15 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) goto out_unlock;if ((vnet_hdr.flags &VIRTIO_NET_HDR_F_NEEDS_CSUM ) && - (__virtio16_to_cpu (false, vnet_hdr.csum_start) + -__virtio16_to_cpu (false, vnet_hdr.csum_offset) +2 > -__virtio16_to_cpu (false, vnet_hdr.hdr_len))) - vnet_hdr.hdr_len =__cpu_to_virtio16 (false, -__virtio16_to_cpu (false, vnet_hdr.csum_start) + -__virtio16_to_cpu (false, vnet_hdr.csum_offset) +2 ); + (__virtio16_to_cpu (vio_le (), vnet_hdr.csum_start) + +__virtio16_to_cpu (vio_le (), vnet_hdr.csum_offset) +2 > +__virtio16_to_cpu (vio_le (), vnet_hdr.hdr_len))) + vnet_hdr.hdr_len =__cpu_to_virtio16 (vio_le (), +__virtio16_to_cpu (vio_le (), vnet_hdr.csum_start) + +__virtio16_to_cpu (vio_le (), vnet_hdr.csum_offset) +2 ); err = -EINVAL ; -if (__virtio16_to_cpu (false, vnet_hdr.hdr_len) > len) +if (__virtio16_to_cpu (vio_le (), vnet_hdr.hdr_len) > len) goto out_unlock;if (vnet_hdr.gso_type !=VIRTIO_NET_HDR_GSO_NONE ) {
@@ -2612,7 +2614,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) hlen =LL_RESERVED_SPACE (dev); tlen = dev->needed_tailroom; skb =packet_alloc_skb (sk, hlen + tlen, hlen, len, -__virtio16_to_cpu (false, vnet_hdr.hdr_len), +__virtio16_to_cpu (vio_le (), vnet_hdr.hdr_len), msg->msg_flags &MSG_DONTWAIT , &err);if (skb ==NULL ) goto out_unlock;
@@ -2659,8 +2661,8 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)if (po->has_vnet_hdr) {if (vnet_hdr.flags &VIRTIO_NET_HDR_F_NEEDS_CSUM ) { -u16 s =__virtio16_to_cpu (false, vnet_hdr.csum_start); -u16 o =__virtio16_to_cpu (false, vnet_hdr.csum_offset); +u16 s =__virtio16_to_cpu (vio_le (), vnet_hdr.csum_start); +u16 o =__virtio16_to_cpu (vio_le (), vnet_hdr.csum_offset);if (!skb_partial_csum_set (skb, s, o)) { err = -EINVAL ; goto out_free;
@@ -2668,7 +2670,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) }skb_shinfo (skb)->gso_size = -__virtio16_to_cpu (false, vnet_hdr.gso_size); +__virtio16_to_cpu (vio_le (), vnet_hdr.gso_size);skb_shinfo (skb)->gso_type = gso_type;/* Header must be checked, and gso_segs computed. */
@@ -3042,9 +3044,9 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,/* This is a hint as to how much should be linear. */ vnet_hdr.hdr_len = -__cpu_to_virtio16 (false,skb_headlen (skb)); +__cpu_to_virtio16 (vio_le (),skb_headlen (skb)); vnet_hdr.gso_size = -__cpu_to_virtio16 (false, sinfo->gso_size); +__cpu_to_virtio16 (vio_le (), sinfo->gso_size);if (sinfo->gso_type &SKB_GSO_TCPV4 ) vnet_hdr.gso_type =VIRTIO_NET_HDR_GSO_TCPV4 ;else if (sinfo->gso_type &SKB_GSO_TCPV6 )
@@ -3062,9 +3064,9 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,if (skb->ip_summed ==CHECKSUM_PARTIAL ) { vnet_hdr.flags =VIRTIO_NET_HDR_F_NEEDS_CSUM ; - vnet_hdr.csum_start =__cpu_to_virtio16 (false, + vnet_hdr.csum_start =__cpu_to_virtio16 (vio_le (),skb_checksum_start_offset (skb)); - vnet_hdr.csum_offset =__cpu_to_virtio16 (false, + vnet_hdr.csum_offset =__cpu_to_virtio16 (vio_le (), skb->csum_offset); }else if (skb->ip_summed ==CHECKSUM_UNNECESSARY ) { vnet_hdr.flags =VIRTIO_NET_HDR_F_DATA_VALID ;
net/sched/cls_fw.c +15 -15
@@ -33,7 +33,6 @@struct fw_head {u32 mask; -bool mask_set;struct fw_filter __rcu *ht[HTSIZE ];struct rcu_head rcu; };
@@ -84,7 +83,7 @@ static int fw_classify(struct sk_buff *skb, const struct tcf_proto *tp, } } }else { -/* old method */ +/* Old method: classify the packet using its skb mark. */ if (id && (TC_H_MAJ (id) ==0 || !(TC_H_MAJ (id ^ tp->q->handle)))) { res->classid = id;
@@ -114,14 +113,9 @@ static unsigned long fw_get(struct tcf_proto *tp, u32 handle)static int fw_init (struct tcf_proto *tp) { -struct fw_head *head; - - head =kzalloc (sizeof (struct fw_head ),GFP_KERNEL ); -if (head ==NULL ) -return -ENOBUFS ; - - head->mask_set = false; -rcu_assign_pointer (tp->root, head); +/* We don't allocate fw_head here, because in the old method +* we don't need it at all. +*/ return 0 ; }
@@ -252,7 +246,7 @@ static int fw_change(struct net *net, struct sk_buff *in_skb,int err;if (!opt) -return handle ? -EINVAL :0 ; +return handle ? -EINVAL :0 ;/* Succeed if it is old method. */ err =nla_parse_nested (tb,TCA_FW_MAX , opt, fw_policy);if (err <0 )
@@ -302,11 +296,17 @@ static int fw_change(struct net *net, struct sk_buff *in_skb,if (!handle)return -EINVAL ; -if (!head->mask_set) { - head->mask =0xFFFFFFFF ; +if (!head) { +u32 mask =0xFFFFFFFF ;if (tb[TCA_FW_MASK ]) - head->mask =nla_get_u32 (tb[TCA_FW_MASK ]); - head->mask_set = true; + mask =nla_get_u32 (tb[TCA_FW_MASK ]); + + head =kzalloc (sizeof (*head),GFP_KERNEL ); +if (!head) +return -ENOBUFS ; + head->mask = mask; + +rcu_assign_pointer (tp->root, head); } f =kzalloc (sizeof (struct fw_filter ),GFP_KERNEL );
net/sctp/protocol.c +41 -23
134 lines not on this page · raw message