Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1258084
| From | Jiri Slaby <jslaby@suse.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.12 083/123] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag |
| Date | 2015-10-28 15:10 +0100 |
| Message-ID | <qozAm-3CV-15@gated-at.bofh.it> (permalink) |
| References | <qozqF-3k6-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Aaron Conole <aconole@bytheb.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 9f389e35674f5b086edd70ed524ca0f287259725 ]
AF_UNIX sockets now return multiple skbs from recv() when MSG_PEEK flag
is set.
This is referenced in kernel bugzilla #12323 @
https://bugzilla.kernel.org/show_bug.cgi?id=12323
As described both in the BZ and lkml thread @
http://lkml.org/lkml/2008/1/8/444 calling recv() with MSG_PEEK on an
AF_UNIX socket only reads a single skb, where the desired effect is
to return as much skb data has been queued, until hitting the recv
buffer size (whichever comes first).
The modified MSG_PEEK path will now move to the next skb in the tree
and jump to the again: label, rather than following the natural loop
structure. This requires duplicating some of the loop head actions.
This was tested using the python socketpair python code attached to
the bugzilla issue.
Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
net/unix/af_unix.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 9afa362d8a31..39b9429c2c86 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2062,8 +2062,20 @@ again:
if (UNIXCB(skb).fp)
siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp);
- sk_peek_offset_fwd(sk, chunk);
+ if (skip) {
+ sk_peek_offset_fwd(sk, chunk);
+ skip -= chunk;
+ }
+
+ if (UNIXCB(skb).fp)
+ break;
+ last = skb;
+ unix_state_lock(sk);
+ skb = skb_peek_next(skb, &sk->sk_receive_queue);
+ if (skb)
+ goto again;
+ unix_state_unlock(sk);
break;
}
} while (size);
--
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 3.12 038/123] spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is disabled Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 118/123] usb: core: implement AMD remote wakeup quirk Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 120/123] USB: Add OTG PET device to TPL Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 092/123] crypto: sparc - initialize blkcipher.ivsize Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 116/123] [media] v4l: vsp1: Fix VI6_WPF_SZCLIP_SIZE_MASK macro Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 093/123] crypto: ahash - ensure statesize is non-zero Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 115/123] [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FP_MASK macro Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 062/123] ipvs: do not use random local source address for tunnels Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 122/123] ath9k: declare required extra tx headroom Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 041/123] ALSA: hda - Apply SPDIF pin ctl to MacBookPro 12,1 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 121/123] Revert "USB: Add device quirk for ASUS T100 Base Station keyboard" Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
[PATCH 3.12 117/123] [media] gscpa_m5602: use msecs_to_jiffies for conversions Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:00 +0100
Re: [PATCH 3.12 117/123] [media] gscpa_m5602: use msecs_to_jiffies for conversions Nicholas Mc Guire <der.herr@hofr.at> - 2015-10-28 15:50 +0100
[PATCH 3.12 110/123] Input: serio - fix blocking of parport Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 094/123] btrfs: fix use after free iterating extrefs Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 100/123] drm/nouveau/fbcon: take runpm reference when userspace has an open fd Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 109/123] Input: psmouse - add small delay for IBM trackpoint pass-through mode Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 083/123] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 103/123] usb: chipidea: debug: add runtime pm for register access Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 096/123] i2c: rcar: enable RuntimePM before registering to the core Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 095/123] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 079/123] mm/slab: fix unexpected index mapping result of kmalloc_size(INDEX_NODE+1) Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 090/123] asix: Don't reset PHY on if_up for ASIX 88772 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 080/123] 3w-9xxx: don't unmap bounce buffered commands Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 108/123] HID: quirks: add QUIRK_NOGET for an other TPV touchscreen Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 099/123] workqueue: make sure delayed work run in local cpu Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 107/123] HID: apple: Add support for the 2015 Macbook Pro Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 097/123] i2c: s3c2410: enable RuntimePM before registering to the core Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 104/123] USB: symbolserial: Correct transferred data size Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 102/123] rbd: fix double free on rbd_dev->header_name Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 111/123] Input: omap4-keypad - fix memory leak Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 098/123] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 089/123] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 106/123] usb: musb: fix cppi channel teardown for isoch transfer Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 112/123] Input: zhenhua - ensure we have BITREVERSE Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 091/123] asix: Do full reset during ax88772_bind Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 101/123] dm thin: fix missing pool reference count decrement in pool_ctr error path Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:10 +0100
[PATCH 3.12 070/123] USB: Add reset-resume quirk for two Plantronics usb headphones. Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 073/123] UBI: return ENOSPC if no enough space available Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 068/123] usb: Use the USB_SS_MULT() macro to get the burst multiplier. Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 088/123] ppp: don't override sk->sk_state in pppoe_flush_dev() Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 075/123] m68k: Define asmlinkage_protect Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 076/123] genirq: Fix race in register_irq_proc() Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 065/123] regmap: debugfs: Ensure we don't underflow when printing access masks Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 082/123] af_unix: Convert the unix_sk macro to an inline function for type safety Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 066/123] regmap: debugfs: Don't bother actually printing when calculating max length Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 058/123] usb: xhci: Clear XHCI_STATE_DYING on start Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 069/123] usb: Add device quirk for Logitech PTZ cameras Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 061/123] Initialize msg/shm IPC objects before doing ipc_addid() Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 085/123] skbuff: Fix skb checksum flag on skb pull Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 087/123] net: add pfmemalloc check in sk_add_backlog() Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 071/123] MIPS: dma-default: Fix 32-bit fall back to GFP_DMA Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 074/123] arm64: readahead: fault retry breaks mmap file read random detection Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 077/123] dm cache: fix NULL pointer when switching from cleaner policy Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 067/123] security: fix typo in security_task_prctl Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 072/123] UBI: Validate data_size Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 086/123] skbuff: Fix skb checksum partial check. Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 040/123] ALSA: synth: Fix conflicting OSS device registration on AWE32 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 084/123] net/unix: fix logic about sk_peek_offset Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:20 +0100
[PATCH 3.12 060/123] usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 043/123] ASoC: fix broken pxa SoC support Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 039/123] mm: hugetlbfs: skip shared VMAs when unmapping private pages to satisfy a fault Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 047/123] Btrfs: update fix for read corruption of compressed and shared extents Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 048/123] dm btree: add ref counting ops for the leaves of top level btrees Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 045/123] btrfs: skip waiting on ordered range for special files Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 054/123] drm/qxl: only report first monitor as connected if we have no state Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 053/123] disabling oplocks/leases via module parm enable_oplocks broken for SMB3 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 055/123] drm/qxl: recreate the primary surface when the bo is not primary Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 051/123] netfilter: nf_conntrack: Support expectations in different zones Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 049/123] USB: option: add ZTE PIDs Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 046/123] Btrfs: fix read corruption of compressed and shared extents Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 064/123] cifs: use server timestamp for ntlmv2 authentication Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 059/123] xhci: change xhci 1.0 only restrictions to support xhci 1.1 Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 056/123] drm: Reject DRI1 hw lock ioctl functions for kms drivers Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 042/123] ASoC: pxa: pxa2xx-ac97: fix dma requestor lines Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 057/123] USB: whiteheat: fix potential null-deref at probe Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 052/123] netfilter: ctnetlink: put back references to master ct and expect objects Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 044/123] ASoC: dwc: correct irq clear method Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
[PATCH 3.12 050/123] dm raid: fix round up of default region size Jiri Slaby <jslaby@suse.cz> - 2015-10-28 15:30 +0100
csiph-web