summaryrefslogtreecommitdiff
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2017-06-07 12:36:01 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2017-06-07 12:36:01 +0200
commit6fc0573f6daffb79bb6ea76daea17b99a3c4526a (patch)
treeacae9cc6aa81807fc64787502232976d047d64a6 /net/core/sock.c
parent5c31a5e9a365d1111568ac0484c0dda0e4bd09fe (diff)
parent4bbbc769640554a216a25b2dbaa3d4d2869bbf79 (diff)
Merge 4.4.71 into android-4.4
Changes in 4.4.71 sparc: Fix -Wstringop-overflow warning dccp/tcp: do not inherit mc_list from parent ipv6/dccp: do not inherit ipv6_mc_list from parent s390/qeth: handle sysfs error during initialization s390/qeth: unbreak OSM and OSN support s390/qeth: avoid null pointer dereference on OSN tcp: avoid fragmenting peculiar skbs in SACK sctp: fix src address selection if using secondary addresses for ipv6 sctp: do not inherit ipv6_{mc|ac|fl}_list from parent tcp: eliminate negative reordering in tcp_clean_rtx_queue net: Improve handling of failures on link and route dumps ipv6: Prevent overrun when parsing v6 header options ipv6: Check ip6_find_1stfragopt() return value properly. bridge: netlink: check vlan_default_pvid range qmi_wwan: add another Lenovo EM74xx device ID bridge: start hello_timer when enabling KERNEL_STP in br_stp_start ipv6: fix out of bound writes in __ip6_append_data() be2net: Fix offload features for Q-in-Q packets virtio-net: enable TSO/checksum offloads for Q-in-Q vlans tcp: avoid fastopen API to be used on AF_UNSPEC sctp: fix ICMP processing if skb is non-linear ipv4: add reference counting to metrics netem: fix skb_orphan_partial() net: phy: marvell: Limit errata to 88m1101 vlan: Fix tcp checksum offloads in Q-in-Q vlans i2c: i2c-tiny-usb: fix buffer not being DMA capable mmc: sdhci-iproc: suppress spurious interrupt with Multiblock read HID: wacom: Have wacom_tpc_irq guard against possible NULL dereference scsi: mpt3sas: Force request partial completion alignment drm/radeon/ci: disable mclk switching for high refresh rates (v2) drm/radeon: Unbreak HPD handling for r600+ pcmcia: remove left-over %Z format ALSA: hda - apply STAC_9200_DELL_M22 quirk for Dell Latitude D430 slub/memcg: cure the brainless abuse of sysfs attributes drm/gma500/psb: Actually use VBT mode when it is found mm/migrate: fix refcount handling when !hugepage_migration_supported() mlock: fix mlock count can not decrease in race condition xfs: Fix missed holes in SEEK_HOLE implementation xfs: fix off-by-one on max nr_pages in xfs_find_get_desired_pgoff() xfs: fix over-copying of getbmap parameters from userspace xfs: handle array index overrun in xfs_dir2_leaf_readbuf() xfs: prevent multi-fsb dir readahead from reading random blocks xfs: fix up quotacheck buffer list error handling xfs: support ability to wait on new inodes xfs: update ag iterator to support wait on new inodes xfs: wait on new inodes during quotaoff dquot release xfs: fix indlen accounting error on partial delalloc conversion xfs: bad assertion for delalloc an extent that start at i_size xfs: fix unaligned access in xfs_btree_visit_blocks xfs: in _attrlist_by_handle, copy the cursor back to userspace xfs: only return -errno or success from attr ->put_listent Linux 4.4.71 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 0689430b7a8b..2871364e4420 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1690,17 +1690,17 @@ EXPORT_SYMBOL(skb_set_owner_w);
void skb_orphan_partial(struct sk_buff *skb)
{
- /* TCP stack sets skb->ooo_okay based on sk_wmem_alloc,
- * so we do not completely orphan skb, but transfert all
- * accounted bytes but one, to avoid unexpected reorders.
- */
if (skb->destructor == sock_wfree
#ifdef CONFIG_INET
|| skb->destructor == tcp_wfree
#endif
) {
- atomic_sub(skb->truesize - 1, &skb->sk->sk_wmem_alloc);
- skb->truesize = 1;
+ struct sock *sk = skb->sk;
+
+ if (atomic_inc_not_zero(&sk->sk_refcnt)) {
+ atomic_sub(skb->truesize, &sk->sk_wmem_alloc);
+ skb->destructor = sock_efree;
+ }
} else {
skb_orphan(skb);
}