Linux 4.4.161
Greg KH
maintainerI'm announcing the release of the 4.4.161 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.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 arch/arc/kernel/process.c | 20 + arch/powerpc/kernel/fadump.c | 23 - arch/x86/entry/vdso/vclock_gettime.c | 26 - drivers/base/power/main.c | 5 drivers/infiniband/core/ucma.c | 2 drivers/md/dm-cache-target.c | 9 drivers/net/wireless/ath/ath10k/trace.h | 12 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 8 drivers/net/wireless/ath/ath10k/wmi.c | 2 drivers/of/unittest.c | 28 + drivers/pci/pci.c | 27 + drivers/usb/host/xhci-pci.c | 2 drivers/usb/serial/usb-serial-simple.c | 3 drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c | 5 fs/ext4/xattr.c | 6 fs/ubifs/super.c | 3 include/linux/netfilter_bridge/ebtables.h | 5 include/linux/skbuff.h | 8 include/linux/tcp.h | 7 include/net/sock.h | 7 include/net/tcp.h | 2 kernel/cgroup.c | 6 mm/vmstat.c | 3 net/bridge/netfilter/ebt_arpreply.c | 3 net/core/skbuff.c | 19 + net/ipv4/tcp.c | 4 net/ipv4/tcp_input.c | 417 ++++++++++++++---------- net/ipv4/tcp_ipv4.c | 3 net/ipv4/tcp_minisocks.c | 1 net/ipv6/tcp_ipv6.c | 1 net/mac80211/cfg.c | 2 32 files changed, 438 insertions(+), 233 deletions(-)
Andy Lutomirski (2):
x86/vdso: Fix asm constraints on vDSO syscall fallbacks x86/vdso: Fix vDSO syscall fallback asm constraint regression
Carl Huang (1):
ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait
Cong Wang (1):
ucma: fix a use-after-free in ucma_resolve_ip()
Daniel Drake (1):
PCI: Reprogram bridge prefetch registers on resume
Eric Dumazet (5):
tcp: increment sk_drops for dropped rx packets
tcp: fix a stale ooo_last_skb after a replace
tcp: free batches of packets in tcp_prune_ofo_queue()
tcp: call tcp_drop() from tcp_data_queue_ofo()
tcp: add tcp_ooo_try_coalesce() helper
Felix Fietkau (1):
mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys
Gao Feng (1):
ebtables: arpreply: Add the standard target sanity check
Greg Kroah-Hartman (1):
Linux 4.4.161
Guenter Roeck (1):
of: unittest: Disable interrupt node tests for old world MAC systems
Jann Horn (1):
mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly
Johan Hovold (1):
USB: serial: simple: add Motorola Tetra MTP6550 id
Mathias Nyman (1):
xhci: Add missing CAS workaround for Intel Sunrise Point xHCI
Michal Suchanek (1):
powerpc/fadump: Return error when fadump registration fails
Mike Snitzer (1):
dm cache: fix resize crash if user doesn't reload cache table
Prateek Sood (1):
cgroup: Fix deadlock in cpu hotplug path
Rafael J. Wysocki (1):
PM / core: Clear the direct_complete flag on errors
Richard Weinberger (1):
ubifs: Check for name being NULL while mounting
Theodore Ts'o (1):
ext4: always verify the magic number in xattr blocks
Tomi Valkeinen (1):
fbdev/omapfb: fix omapfb_memory_read infoleak
Vineet Gupta (1):
ARC: clone syscall to setp r25 as thread pointer
Yaogong Wang (1):
tcp: use an RB tree for ooo receive queue
Zhi Chen (1):
ath10k: fix scan crash due to incorrect length calculation
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 160 +SUBLEVEL = 161 EXTRAVERSION = NAME = Blurry Fish Butt
arch/arc/kernel/process.c +20 -0
@@ -153,6 +153,26 @@ int copy_thread(unsigned long clone_flags,task_thread_info (current)->thr_ptr; } + +/* +* setup usermode thread pointer #1: +* when child is picked by scheduler, __switch_to() uses @c_callee to +* populate usermode callee regs: this works (despite being in a kernel +* function) since special return path for child @ret_from_fork() +* ensures those regs are not clobbered all the way to RTIE to usermode +*/ + c_callee->r25 =task_thread_info (p)->thr_ptr; + +#ifdef CONFIG_ARC_CURR_IN_REG +/* +* setup usermode thread pointer #2: +* however for this special use of r25 in kernel, __switch_to() sets +* r25 for kernel needs and only in the final return path is usermode +* r25 setup, from pt_regs->user_r25. So set that up as well +*/ + c_regs->user_r25 = c_callee->r25; +#endif +return 0 ; }
arch/powerpc/kernel/fadump.c +15 -8
@@ -360,9 +360,9 @@ static int __init early_fadump_reserve_mem(char *p) }early_param ("fadump_reserve_mem" , early_fadump_reserve_mem); -static void register_fw_dump (struct fadump_mem_struct *fdm) +static int register_fw_dump (struct fadump_mem_struct *fdm) { -int rc; +int rc, err;unsigned int wait_time;pr_debug ("Registering for firmware-assisted kernel dump...\n" );
@@ -379,7 +379,11 @@ static void register_fw_dump(struct fadump_mem_struct *fdm) }while (wait_time); + err = -EIO ;switch (rc) { +default : +pr_err ("Failed to register. Unknown Error(%d).\n" , rc); +break ;case -1 :printk (KERN_ERR "Failed to register firmware-assisted kernel" " dump. Hardware Error(%d).\n" , rc);
@@ -387,18 +391,22 @@ static void register_fw_dump(struct fadump_mem_struct *fdm)case -3 :printk (KERN_ERR "Failed to register firmware-assisted kernel" " dump. Parameter Error(%d).\n" , rc); + err = -EINVAL ;break ;case -9 :printk (KERN_ERR "firmware-assisted kernel dump is already " " registered." ); fw_dump.dump_registered =1 ; + err = -EEXIST ;break ;case 0 :printk (KERN_INFO "firmware-assisted kernel dump registration" " is successful\n" ); fw_dump.dump_registered =1 ; + err =0 ;break ; } +return err; }void crash_fadump (struct pt_regs *regs,const char *str)
@@ -997,7 +1005,7 @@ static unsigned long init_fadump_header(unsigned long addr)return addr; } -static void register_fadump (void ) +static int register_fadump (void ) {unsigned long addr;void *vaddr;
@@ -1008,7 +1016,7 @@ static void register_fadump(void)* assisted dump. */ if (!fw_dump.reserve_dump_area_size) -return ; +return -ENODEV ; ret =fadump_setup_crash_memory_ranges ();if (ret)
@@ -1023,7 +1031,7 @@ static void register_fadump(void)fadump_create_elfcore_headers (vaddr);/* register the future kernel dump with firmware. */ -register_fw_dump (&fdm); +return register_fw_dump (&fdm); }static int fadump_unregister_dump (struct fadump_mem_struct *fdm)
@@ -1208,7 +1216,6 @@ static ssize_t fadump_register_store(struct kobject *kobj,switch (buf[0 ]) {case '0' :if (fw_dump.dump_registered ==0 ) { - ret = -EINVAL ; goto unlock_out; }/* Un-register Firmware-assisted dump */
@@ -1216,11 +1223,11 @@ static ssize_t fadump_register_store(struct kobject *kobj,break ;case '1' :if (fw_dump.dump_registered ==1 ) { - ret = -EINVAL ; + ret = -EEXIST ; goto unlock_out; }/* Register Firmware-assisted dump */ -register_fadump (); + ret =register_fadump ();break ;default : ret = -EINVAL ;
arch/x86/entry/vdso/vclock_gettime.c +14 -12
@@ -51,8 +51,9 @@ extern u8 pvclock_page notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) {long ret; - asm("syscall" :"=a" (ret) : -"0" (__NR_clock_gettime),"D" (clock),"S" (ts) :"memory" ); + asm ("syscall" :"=a" (ret),"=m" (*ts) : +"0" (__NR_clock_gettime),"D" (clock),"S" (ts) : +"memory" ,"rcx" ,"r11" );return ret; }
@@ -60,8 +61,9 @@ notrace static long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz) {long ret; - asm("syscall" :"=a" (ret) : -"0" (__NR_gettimeofday),"D" (tv),"S" (tz) :"memory" ); + asm ("syscall" :"=a" (ret),"=m" (*tv),"=m" (*tz) : +"0" (__NR_gettimeofday),"D" (tv),"S" (tz) : +"memory" ,"rcx" ,"r11" );return ret; }
@@ -143,13 +145,13 @@ notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) {long ret; - asm( + asm ("mov %%ebx, %%edx \n" -"mov %2, %%ebx \n" +"mov %[clock], %%ebx \n" "call __kernel_vsyscall \n" "mov %%edx, %%ebx \n" - :"=a" (ret) - :"0" (__NR_clock_gettime),"g" (clock),"c" (ts) + :"=a" (ret),"=m" (*ts) + :"0" (__NR_clock_gettime), [clock]"g" (clock),"c" (ts) :"memory" ,"edx" );return ret; }
@@ -158,13 +160,13 @@ notrace static long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz) {long ret; - asm( + asm ("mov %%ebx, %%edx \n" -"mov %2, %%ebx \n" +"mov %[tv], %%ebx \n" "call __kernel_vsyscall \n" "mov %%edx, %%ebx \n" - :"=a" (ret) - :"0" (__NR_gettimeofday),"g" (tv),"c" (tz) + :"=a" (ret),"=m" (*tv),"=m" (*tz) + :"0" (__NR_gettimeofday), [tv]"g" (tv),"c" (tz) :"memory" ,"edx" );return ret; }
drivers/base/power/main.c +4 -1
@@ -1355,8 +1355,10 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)dpm_wait_for_children (dev, async); -if (async_error) +if (async_error) { + dev->power.direct_complete = false; goto Complete; + }/* * If a device configured to wake up the system from sleep states
@@ -1368,6 +1370,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)pm_wakeup_event (dev,0 );if (pm_wakeup_pending ()) { + dev->power.direct_complete = false; async_error = -EBUSY ; goto Complete; }
drivers/infiniband/core/ucma.c +2 -0
@@ -1709,6 +1709,8 @@ static int ucma_close(struct inode *inode, struct file *filp)mutex_lock (&mut);if (!ctx->closing) {mutex_unlock (&mut); +ucma_put_ctx (ctx); +wait_for_completion (&ctx->comp);/* rdma_destroy_id ensures that no event handlers are * inflight for that id before releasing it. */
drivers/md/dm-cache-target.c +7 -2
@@ -3391,8 +3391,13 @@ static dm_cblock_t get_cache_dev_size(struct cache *cache)static bool can_resize (struct cache *cache,dm_cblock_t new_size) { -if (from_cblock (new_size) >from_cblock (cache->cache_size)) -return true; +if (from_cblock (new_size) >from_cblock (cache->cache_size)) { +if (cache->sized) { +DMERR ("%s: unable to extend cache due to missing cache table reload" , +cache_device_name (cache)); +return false; + } + }/* * We can't drop a dirty block when shrinking the cache.
drivers/net/wireless/ath/ath10k/trace.h +4 -8
@@ -152,10 +152,9 @@ TRACE_EVENT(ath10k_log_dbg_dump, ); TRACE_EVENT(ath10k_wmi_cmd, - TP_PROTO(struct ath10k *ar, int id, const void *buf, size_t buf_len, - int ret), + TP_PROTO(struct ath10k *ar, int id, const void *buf, size_t buf_len), - TP_ARGS(ar, id, buf, buf_len, ret), + TP_ARGS(ar, id, buf, buf_len), TP_STRUCT__entry( __string(device, dev_name(ar->dev))
@@ -163,7 +162,6 @@ TRACE_EVENT(ath10k_wmi_cmd, __field(unsigned int, id) __field(size_t, buf_len) __dynamic_array(u8, buf, buf_len) - __field(int, ret) ), TP_fast_assign(
@@ -171,17 +169,15 @@ TRACE_EVENT(ath10k_wmi_cmd,__assign_str (driver,dev_driver_string (ar->dev)); __entry->id = id; __entry->buf_len = buf_len; - __entry->ret = ret;memcpy (__get_dynamic_array (buf), buf, buf_len); ),TP_printk ( -"%s %s id %d len %zu ret %d" , +"%s %s id %d len %zu" ,__get_str (driver),__get_str (device), __entry->id, - __entry->buf_len, - __entry->ret + __entry->buf_len ) );
drivers/net/wireless/ath/ath10k/wmi-tlv.c +4 -4
@@ -1459,10 +1459,10 @@ ath10k_wmi_tlv_op_gen_start_scan(struct ath10k *ar, bssid_len = arg->n_bssids *sizeof (struct wmi_mac_addr ); ie_len =roundup (arg->ie_len,4 ); len = (sizeof (*tlv) +sizeof (*cmd)) + - (arg->n_channels ?sizeof (*tlv) + chan_len :0 ) + - (arg->n_ssids ?sizeof (*tlv) + ssid_len :0 ) + - (arg->n_bssids ?sizeof (*tlv) + bssid_len :0 ) + - (arg->ie_len ?sizeof (*tlv) + ie_len :0 ); +sizeof (*tlv) + chan_len + +sizeof (*tlv) + ssid_len + +sizeof (*tlv) + bssid_len + +sizeof (*tlv) + ie_len; skb =ath10k_wmi_alloc_skb (ar, len);if (!skb)
drivers/net/wireless/ath/ath10k/wmi.c +1 -1
@@ -1642,8 +1642,8 @@ int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb, cmd_hdr->cmd_id =__cpu_to_le32 (cmd);memset (skb_cb,0 ,sizeof (*skb_cb)); +trace_ath10k_wmi_cmd (ar, cmd_id, skb->data, skb->len); ret =ath10k_htc_send (&ar->htc, ar->wmi.eid, skb); -trace_ath10k_wmi_cmd (ar, cmd_id, skb->data, skb->len, ret);if (ret) goto err_pull;
drivers/of/unittest.c +19 -9
@@ -553,6 +553,9 @@ static void __init of_unittest_parse_interrupts(void)struct of_phandle_args args;int i, rc; +if (of_irq_workarounds &OF_IMAP_OLDWORLD_MAC ) +return ; + np =of_find_node_by_path ("/testcase-data/interrupts/interrupts0" );if (!np) {pr_err ("missing testcase data\n" );
@@ -627,6 +630,9 @@ static void __init of_unittest_parse_interrupts_extended(void)struct of_phandle_args args;int i, rc; +if (of_irq_workarounds &OF_IMAP_OLDWORLD_MAC ) +return ; + np =of_find_node_by_path ("/testcase-data/interrupts/interrupts-extended0" );if (!np) {pr_err ("missing testcase data\n" );
@@ -778,15 +784,19 @@ static void __init of_unittest_platform_populate(void) pdev =of_find_device_by_node (np);unittest (pdev,"device 1 creation failed\n" ); - irq =platform_get_irq (pdev,0 ); -unittest (irq == -EPROBE_DEFER ,"device deferred probe failed - %d\n" , irq); - -/* Test that a parsing failure does not return -EPROBE_DEFER */ - np =of_find_node_by_path ("/testcase-data/testcase-device2" ); - pdev =of_find_device_by_node (np); -unittest (pdev,"device 2 creation failed\n" ); - irq =platform_get_irq (pdev,0 ); -unittest (irq <0 && irq != -EPROBE_DEFER ,"device parsing error failed - %d\n" , irq); +if (!(of_irq_workarounds &OF_IMAP_OLDWORLD_MAC )) { + irq =platform_get_irq (pdev,0 ); +unittest (irq == -EPROBE_DEFER , +"device deferred probe failed - %d\n" , irq); + +/* Test that a parsing failure does not return -EPROBE_DEFER */ + np =of_find_node_by_path ("/testcase-data/testcase-device2" ); + pdev =of_find_device_by_node (np); +unittest (pdev,"device 2 creation failed\n" ); + irq =platform_get_irq (pdev,0 ); +unittest (irq <0 && irq != -EPROBE_DEFER , +"device parsing error failed - %d\n" , irq); + } np =of_find_node_by_path ("/testcase-data/platform-tests" );unittest (np,"No testcase data in device tree\n" );
drivers/pci/pci.c +19 -8
@@ -1064,12 +1064,12 @@ int pci_save_state(struct pci_dev *dev)EXPORT_SYMBOL (pci_save_state);static void pci_restore_config_dword (struct pci_dev *pdev,int offset, -u32 saved_val,int retry) +u32 saved_val,int retry,bool force) {u32 val;pci_read_config_dword (pdev, offset, &val); -if (val == saved_val) +if (!force && val == saved_val)return ;for (;;) {
@@ -1088,25 +1088,36 @@ static void pci_restore_config_dword(struct pci_dev *pdev, int offset, }static void pci_restore_config_space_range (struct pci_dev *pdev, -int start,int end,int retry) +int start,int end,int retry, +bool force) {int index;for (index = end; index >= start; index--)pci_restore_config_dword (pdev,4 * index, pdev->saved_config_space[index], - retry); + retry, force); }static void pci_restore_config_space (struct pci_dev *pdev) {if (pdev->hdr_type ==PCI_HEADER_TYPE_NORMAL ) { -pci_restore_config_space_range (pdev,10 ,15 ,0 ); +pci_restore_config_space_range (pdev,10 ,15 ,0 , false);/* Restore BARs before the command register. */ -pci_restore_config_space_range (pdev,4 ,9 ,10 ); -pci_restore_config_space_range (pdev,0 ,3 ,0 ); +pci_restore_config_space_range (pdev,4 ,9 ,10 , false); +pci_restore_config_space_range (pdev,0 ,3 ,0 , false); + }else if (pdev->hdr_type ==PCI_HEADER_TYPE_BRIDGE ) { +pci_restore_config_space_range (pdev,12 ,15 ,0 , false); + +/* +* Force rewriting of prefetch registers to avoid S3 resume +* issues on Intel PCI bridges that occur when these +* registers are not explicitly written. +*/ +pci_restore_config_space_range (pdev,9 ,11 ,0 , true); +pci_restore_config_space_range (pdev,0 ,8 ,0 , false); }else { -pci_restore_config_space_range (pdev,0 ,15 ,0 ); +pci_restore_config_space_range (pdev,0 ,15 ,0 , false); } }
drivers/usb/host/xhci-pci.c +2 -0
@@ -174,6 +174,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) }if (pdev->vendor ==PCI_VENDOR_ID_INTEL && (pdev->device ==PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || + pdev->device ==PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || + pdev->device ==PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI || pdev->device ==PCI_DEVICE_ID_INTEL_APL_XHCI || pdev->device ==PCI_DEVICE_ID_INTEL_DNV_XHCI )) xhci->quirks |=XHCI_MISSING_CAS ;
drivers/usb/serial/usb-serial-simple.c +2 -1
@@ -87,7 +87,8 @@ DEVICE(moto_modem, MOTO_IDS);/* Motorola Tetra driver */ #define MOTOROLA_TETRA_IDS () \ - { USB_DEVICE(0x0cad, 0x9011) }/* Motorola Solutions TETRA PEI */ + { USB_DEVICE(0x0cad, 0x9011) },/* Motorola Solutions TETRA PEI */ \ + { USB_DEVICE(0x0cad, 0x9012) } /* MTP6550 */DEVICE (motorola_tetra,MOTOROLA_TETRA_IDS );/* Novatel Wireless GPS driver */
drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c +4 -1
@@ -496,6 +496,9 @@ static int omapfb_memory_read(struct fb_info *fbi,if (!access_ok (VERIFY_WRITE , mr->buffer, mr->buffer_size))return -EFAULT ; +if (mr->w >4096 || mr->h >4096 ) +return -EINVAL ; +if (mr->w * mr->h *3 > mr->buffer_size)return -EINVAL ;
@@ -509,7 +512,7 @@ static int omapfb_memory_read(struct fb_info *fbi, mr->x, mr->y, mr->w, mr->h);if (r >0 ) { -if (copy_to_user (mr->buffer, buf, mr->buffer_size)) +if (copy_to_user (mr->buffer, buf, r)) r = -EFAULT ; }
fs/ext4/xattr.c +3 -3
@@ -220,12 +220,12 @@ ext4_xattr_check_block(struct inode *inode, struct buffer_head *bh) {int error; -if (buffer_verified (bh)) -return 0 ; -if (BHDR (bh)->h_magic !=cpu_to_le32 (EXT4_XATTR_MAGIC ) ||BHDR (bh)->h_blocks !=cpu_to_le32 (1 ))return -EFSCORRUPTED ; +if (buffer_verified (bh)) +return 0 ; +if (!ext4_xattr_block_csum_verify (inode, bh->b_blocknr,BHDR (bh)))return -EFSBADCRC ; error = ext4_xattr_check_names(BFIRST(bh), bh->b_data + bh->b_size,
fs/ubifs/super.c +3 -0
@@ -1918,6 +1918,9 @@ static struct ubi_volume_desc *open_ubi(const char *name, int mode)int dev, vol;char *endptr; +if (!name || !*name) +return ERR_PTR (-EINVAL ); +/* First, try to open using the device node path method */ ubi =ubi_open_volume_path (name, mode);if (!IS_ERR (ubi))
include/linux/netfilter_bridge/ebtables.h +5 -0
@@ -125,4 +125,9 @@ extern unsigned int ebt_do_table(struct sk_buff *skb,/* True if the target is not a standard target */ #define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0) +static inline bool ebt_invalid_target (int target) +{ +return (target < -NUM_STANDARD_TARGETS || target >=0 ); +} +#endif
include/linux/skbuff.h +8 -0
@@ -2273,6 +2273,8 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)kfree_skb (skb); } +void skb_rbtree_purge (struct rb_root *root); +void *netdev_alloc_frag (unsigned int fragsz); struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length,
@@ -2807,6 +2809,12 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)return __pskb_trim (skb, len); } +#define rb_to_skb (rb) rb_entry_safe(rb, struct sk_buff, rbnode) +#define skb_rb_first (root) rb_to_skb(rb_first(root)) +#define skb_rb_last (root) rb_to_skb(rb_last(root)) +#define skb_rb_next (skb) rb_to_skb(rb_next(&(skb)->rbnode)) +#define skb_rb_prev (skb) rb_to_skb(rb_prev(&(skb)->rbnode)) +#define skb_queue_walk (queue, skb) \ for (skb = (queue)->next; \ skb != (struct sk_buff *)(queue); \
include/linux/tcp.h +3 -4
@@ -279,10 +279,9 @@ struct tcp_sock {struct sk_buff * lost_skb_hint;struct sk_buff *retransmit_skb_hint; -/* OOO segments go in this list. Note that socket lock must be held, -* as we do not use sk_buff_head lock. -*/ -struct sk_buff_head out_of_order_queue; +/* OOO segments go in this rbtree. Socket lock must be held. */ +struct rb_root out_of_order_queue; +struct sk_buff *ooo_last_skb;/* cache rb_last(out_of_order_queue) */ /* SACKs data, these 2 need to be together (see tcp_options_write) */ struct tcp_sack_block duplicate_sack[1 ];/* D-SACK block */
include/net/sock.h +7 -0
@@ -2139,6 +2139,13 @@ sock_skb_set_dropcount(const struct sock *sk, struct sk_buff *skb)SOCK_SKB_CB (skb)->dropcount =atomic_read (&sk->sk_drops); } +static inline void sk_drops_add (struct sock *sk,const struct sk_buff *skb) +{ +int segs =max_t (u16,1 ,skb_shinfo (skb)->gso_segs); + +atomic_add (segs, &sk->sk_drops); +} +void __sock_recv_timestamp (struct msghdr *msg,struct sock *sk,struct sk_buff *skb); void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
include/net/tcp.h +1 -1
@@ -649,7 +649,7 @@ static inline void tcp_fast_path_check(struct sock *sk) {struct tcp_sock *tp =tcp_sk (sk); -if (skb_queue_empty (&tp->out_of_order_queue) && +if (RB_EMPTY_ROOT (&tp->out_of_order_queue) && tp->rcv_wnd &&atomic_read (&sk->sk_rmem_alloc) < sk->sk_rcvbuf && !tp->urg_data)
kernel/cgroup.c +5 -1
@@ -4083,7 +4083,11 @@ int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from)*/ do { css_task_iter_start(&from->self, &it); - task = css_task_iter_next(&it); + + do { + task = css_task_iter_next(&it); + } while (task && (task->flags & PF_EXITING)); + if (task) get_task_struct(task); css_task_iter_end(&it);
mm/vmstat.c +3 -0
@@ -858,6 +858,9 @@ const char * const vmstat_text[] = {#ifdef CONFIG_SMP "nr_tlb_remote_flush" ,"nr_tlb_remote_flush_received" , +#else +"" ,/* nr_tlb_remote_flush */ +"" ,/* nr_tlb_remote_flush_received */ #endif /* CONFIG_SMP */"nr_tlb_local_flush_all" , "nr_tlb_local_flush_one",
net/bridge/netfilter/ebt_arpreply.c +3 -0
@@ -67,6 +67,9 @@ static int ebt_arpreply_tg_check(const struct xt_tgchk_param *par)if (e->ethproto !=htons (ETH_P_ARP ) || e->invflags &EBT_IPROTO )return -EINVAL ; +if (ebt_invalid_target (info->target)) +return -EINVAL ; +return 0 ; }
net/core/skbuff.c +19 -0
@@ -2377,6 +2377,25 @@ void skb_queue_purge(struct sk_buff_head *list) }EXPORT_SYMBOL (skb_queue_purge); +/** +* skb_rbtree_purge - empty a skb rbtree +* @root: root of the rbtree to empty +* +* Delete all buffers on an &sk_buff rbtree. Each buffer is removed from +* the list and one reference dropped. This function does not take +* any lock. Synchronization should be handled by the caller (e.g., TCP +* out-of-order queue is protected by the socket lock). +*/ +void skb_rbtree_purge (struct rb_root *root) +{ +struct sk_buff *skb, *next; + +rbtree_postorder_for_each_entry_safe (skb, next, root, rbnode) +kfree_skb (skb); + + *root =RB_ROOT ; +} +/** * skb_queue_head - queue a buffer at the list head * @list: list to use
net/ipv4/tcp.c +2 -2
@@ -382,7 +382,7 @@ void tcp_init_sock(struct sock *sk)struct inet_connection_sock *icsk =inet_csk (sk);struct tcp_sock *tp =tcp_sk (sk); -__skb_queue_head_init (&tp->out_of_order_queue); + tp->out_of_order_queue =RB_ROOT ;tcp_init_xmit_timers (sk);tcp_prequeue_init (tp);INIT_LIST_HEAD (&tp->tsq_node);
@@ -2240,7 +2240,7 @@ int tcp_disconnect(struct sock *sk, int flags)tcp_clear_xmit_timers (sk);__skb_queue_purge (&sk->sk_receive_queue);tcp_write_queue_purge (sk); -__skb_queue_purge (&tp->out_of_order_queue); +skb_rbtree_purge (&tp->out_of_order_queue); inet->inet_dport =0 ;
net/ipv4/tcp_input.c +254 -163
669 lines not on this page · raw message
net/ipv4/tcp_ipv4.c +2 -1
@@ -1716,6 +1716,7 @@ discard_it:return 0 ; discard_and_relse: +sk_drops_add (sk, skb);sock_put (sk); goto discard_it;
@@ -1829,7 +1830,7 @@ void tcp_v4_destroy_sock(struct sock *sk)tcp_write_queue_purge (sk);/* Cleans up our, hopefully empty, out_of_order_queue. */ -__skb_queue_purge (&tp->out_of_order_queue); +skb_rbtree_purge (&tp->out_of_order_queue);#ifdef CONFIG_TCP_MD5SIG /* Clean up the MD5 key list, if any */
net/ipv4/tcp_minisocks.c +0 -1
@@ -496,7 +496,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, newtp->snd_cwnd_cnt =0 ;tcp_init_xmit_timers (newsk); -__skb_queue_head_init (&newtp->out_of_order_queue); newtp->write_seq = newtp->pushed_seq = treq->snt_isn +1 ; newtp->rx_opt.saw_tstamp =0 ;
net/ipv6/tcp_ipv6.c +1 -0
@@ -1505,6 +1505,7 @@ discard_it:return 0 ; discard_and_relse: +sk_drops_add (sk, skb);sock_put (sk); goto discard_it;
net/mac80211/cfg.c +1 -1
@@ -219,7 +219,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,case NL80211_IFTYPE_AP :case NL80211_IFTYPE_AP_VLAN :/* Keys without a station are used for TX only */ -if (key->sta &&test_sta_flag (key->sta,WLAN_STA_MFP )) +if (sta &&test_sta_flag (sta,WLAN_STA_MFP )) key->conf.flags |=IEEE80211_KEY_FLAG_RX_MGMT ;break ;case NL80211_IFTYPE_ADHOC :