Linux 3.4.68
Greg KH
maintainerI'm announcing the release of the 3.4.68 kernel.
All users of the 3.4 kernel series must upgrade.
The updated 3.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.4.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 drivers/connector/cn_proc.c | 16 ++ drivers/connector/connector.c | 7 - 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/marvell/mv643xx_eth.c | 6 drivers/net/ethernet/ti/davinci_emac.c | 3 drivers/net/wan/farsync.c | 1 drivers/net/wan/wanxl.c | 1 drivers/usb/serial/option.c | 9 + drivers/usb/serial/ti_usb_3410_5052.c | 1 fs/ext3/dir.c | 167 +++++++++++++++++------- fs/ext3/ext3.h | 6 fs/ext3/hash.c | 4 include/linux/skbuff.h | 15 ++ include/net/cipso_ipv4.h | 6 include/net/dst.h | 12 + mm/page-writeback.c | 10 - net/8021q/vlan_netlink.c | 2 net/bridge/br_stp_if.c | 2 net/compat.c | 2 net/ipv4/inet_hashtables.c | 2 net/ipv4/ip_output.c | 2 net/ipv4/route.c | 2 net/ipv4/tcp_input.c | 5 net/ipv4/tcp_output.c | 9 - net/ipv6/inet6_hashtables.c | 2 net/ipv6/ip6_output.c | 2 net/ipv6/route.c | 11 + net/l2tp/l2tp_ppp.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 - 36 files changed, 287 insertions(+), 98 deletions(-)
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
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 (5):
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
Eric Sandeen (1):
ext3: return 32/64-bit dir name hash according to usage type
Fan Du (1):
sctp: Use software crc32 checksum when xfrm transform will happen.
Fengguang Wu (1):
writeback: fix negative bdi max pause
Greg Kroah-Hartman (2):
USB: serial: option: add support for Inovia SEW858 device Linux 3.4.68
Hannes Frederic Sowa (1):
inet: fix possible memory corruption with UDP_CORK and UFO
Jiri Benc (1):
ipv4: fix ineffective source address selection
Johannes Berg (1):
wireless: radiotap: fix parsing buffer overrun
Marc Kleine-Budde (2):
can: dev: fix nlmsg size calculation in can_get_size()
net: vlan: fix nlmsg size calculation in vlan_get_size()
Marcelo Ricardo Leitner (1):
ipv6: restrict neighbor entry creation to output flow
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
Mikulas Patocka (1):
dm snapshot: fix data corruption
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
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.
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 4 -SUBLEVEL = 67 +SUBLEVEL = 68 EXTRAVERSION = NAME = Saber-toothed Squirrel
drivers/connector/cn_proc.c +16 -0
@@ -64,6 +64,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);
@@ -79,6 +80,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 ); }
@@ -95,6 +97,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);
@@ -105,6 +108,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 ); }
@@ -121,6 +125,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;
@@ -144,6 +149,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 ); }
@@ -159,6 +165,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);
@@ -169,6 +176,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 ); }
@@ -184,6 +192,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);
@@ -202,6 +211,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 ); }
@@ -217,6 +227,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);
@@ -228,6 +239,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 ); }
@@ -243,6 +255,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);
@@ -255,6 +268,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 ); }
@@ -278,6 +292,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);
@@ -287,6 +302,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_SPACE (0 )) { 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/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
@@ -665,14 +665,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
@@ -547,6 +547,7 @@ static inline void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, skb, cqe, cqe_idx)) { if (tpa_info->parsing_flags & PARSING_FLAGS_VLAN) __vlan_hwaccel_put_tag(skb, tpa_info->vlan_tag); + skb_record_rx_queue(skb, fp->rx_queue); napi_gro_receive(&fp->napi, skb); } else { DP(NETIF_MSG_RX_STATUS,
drivers/net/ethernet/marvell/mv643xx_eth.c +2 -4
@@ -1274,15 +1274,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 ); }
@@ -2370,6 +2368,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 );
@@ -2911,7 +2910,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
@@ -875,8 +875,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/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/usb/serial/option.c +8 -1
@@ -457,6 +457,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 ,
@@ -1279,7 +1283,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) },
@@ -1367,6 +1373,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
@@ -210,6 +210,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) }, { } };
fs/ext3/dir.c +122 -45
258 lines not on this page · raw message
fs/ext3/ext3.h +5 -1
@@ -920,7 +920,11 @@ struct dx_hash_infou32 *seed; }; -#define EXT3_HTREE_EOF 0x7fffffff + +/* 32 and 64 bit signed EOF for dx directories */ +#define EXT3_HTREE_EOF_32BIT ((1UL << (32 - 1)) - 1) +#define EXT3_HTREE_EOF_64BIT ((1ULL << (64 - 1)) - 1) +/* * Control parameters used by ext3_htree_next_block
fs/ext3/hash.c +2 -2
@@ -198,8 +198,8 @@ int ext3fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo)return -1 ; } hash = hash & ~1 ; -if (hash == (EXT3_HTREE_EOF <<1 )) - hash = (EXT3_HTREE_EOF -1 ) <<1 ; +if (hash == (EXT3_HTREE_EOF_32BIT <<1 )) + hash = (EXT3_HTREE_EOF_32BIT -1 ) <<1 ; hinfo->hash = hash; hinfo->minor_hash = minor_hash;return 0 ;
include/linux/skbuff.h +15 -0
@@ -760,6 +760,16 @@ static inline int skb_cloned(const struct sk_buff *skb) (atomic_read (&skb_shinfo (skb)->dataref) &SKB_DATAREF_MASK ) !=1 ; } +static inline int skb_unclone (struct sk_buff *skb,gfp_t pri) +{ +might_sleep_if (pri & __GFP_WAIT); + +if (skb_cloned (skb)) +return pskb_expand_head (skb,0 ,0 , pri); + +return 0 ; +} +/** * skb_header_cloned - is the header a clone * @skb: buffer to check
@@ -1198,6 +1208,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
@@ -464,10 +464,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 */
mm/page-writeback.c +5 -5
@@ -1072,11 +1072,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
@@ -1088,7 +1088,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
@@ -152,7 +152,7 @@ static size_t vlan_get_size(const struct net_device *dev)struct vlan_dev_priv *vlan =vlan_dev_priv (dev);return 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/ipv4/inet_hashtables.c +1 -1
@@ -268,7 +268,7 @@ begintw: }if (unlikely (!INET_TW_MATCH (sk, net, hash, 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
@@ -846,7 +846,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/route.c +1 -1
@@ -2713,7 +2713,7 @@ static struct rtable *ip_route_output_slow(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/tcp_input.c +4 -1
@@ -1468,7 +1468,10 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb, tp->lost_cnt_hint -=tcp_skb_pcount (prev); } -TCP_SKB_CB (skb)->tcp_flags |=TCP_SKB_CB (prev)->tcp_flags; +TCP_SKB_CB (prev)->tcp_flags |=TCP_SKB_CB (skb)->tcp_flags; +if (TCP_SKB_CB (skb)->tcp_flags &TCPHDR_FIN ) +TCP_SKB_CB (prev)->end_seq++; +if (skb ==tcp_highest_sack (sk))tcp_advance_highest_sack (sk, skb);
net/ipv4/tcp_output.c +6 -3
@@ -933,6 +933,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
@@ -1014,9 +1017,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. */
@@ -2129,6 +2130,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
@@ -110,7 +110,7 @@ begintw: goto out; }if (!INET6_TW_MATCH (sk, net, hash, saddr, daddr, ports, dif)) { -sock_put (sk); +inet_twsk_put (inet_twsk (sk)); goto begintw; } goto out;
net/ipv6/ip6_output.c +1 -1
@@ -1345,7 +1345,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 +7 -4
@@ -818,7 +818,7 @@ static struct rt6_info *rt6_alloc_clone(struct rt6_info *ort, }static struct rt6_info *ip6_pol_route (struct net *net,struct fib6_table *table,int oif, -struct flowi6 *fl6,int flags) +struct flowi6 *fl6,int flags,bool input) {struct fib6_node *fn;struct rt6_info *rt, *nrt;
@@ -826,8 +826,11 @@ static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,int attempts =3 ;int err;int reachable = net->ipv6.devconf_all->forwarding ?0 :RT6_LOOKUP_F_REACHABLE ; +int local =RTF_NONEXTHOP ; strict |= flags &RT6_LOOKUP_F_IFACE ; +if (input) + local |=RTF_LOCAL ; relookup:read_lock_bh (&table->tb6_lock);
@@ -847,7 +850,7 @@ restart:read_unlock_bh (&table->tb6_lock);if (!dst_get_neighbour_noref_raw (&rt->dst) && - !(rt->rt6i_flags & (RTF_NONEXTHOP |RTF_LOCAL ))) + !(rt->rt6i_flags & local)) nrt =rt6_alloc_cow (rt, &fl6->daddr, &fl6->saddr);else if (!(rt->dst.flags &DST_HOST )) nrt =rt6_alloc_clone (rt, &fl6->daddr);
@@ -891,7 +894,7 @@ out2:static struct rt6_info *ip6_pol_route_input (struct net *net,struct fib6_table *table,struct flowi6 *fl6,int flags) { -return ip6_pol_route (net, table, fl6->flowi6_iif, fl6, flags); +return ip6_pol_route (net, table, fl6->flowi6_iif, fl6, flags, true); } static struct dst_entry *ip6_route_input_lookup(struct net *net,
@@ -924,7 +927,7 @@ void ip6_route_input(struct sk_buff *skb)static struct rt6_info *ip6_pol_route_output (struct net *net,struct fib6_table *table,struct flowi6 *fl6,int flags) { -return ip6_pol_route (net, table, fl6->flowi6_oif, fl6, flags); +return ip6_pol_route (net, table, fl6->flowi6_oif, fl6, flags, false); } struct dst_entry * ip6_route_output(struct net *net, const struct sock *sk,
net/l2tp/l2tp_ppp.c +4 -0
@@ -357,7 +357,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);
@@ -432,7 +434,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/sctp/output.c +2 -1
@@ -518,7 +518,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
@@ -1899,6 +1899,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 flags,struct used_address *used_address)
@@ -1917,8 +1927,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; + }/* do not move before msg_sys is valid */ err = -EMSGSIZE ;
@@ -2129,8 +2142,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; + } err = -EMSGSIZE ;if (msg_sys->msg_iovlen >UIO_MAXIOV )
net/unix/af_unix.c +10 -0
@@ -1247,6 +1247,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;
@@ -1281,6 +1290,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
@@ -134,6 +134,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
@@ -95,6 +95,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 ;
@@ -129,7 +133,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 ; }