Bug 12323 - recv() with MSG_PEEK on an AF_UNIX socket only reads a single skb
Summary: recv() with MSG_PEEK on an AF_UNIX socket only reads a single skb
Status: REOPENED
Alias: None
Product: Networking
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Arnaldo Carvalho de Melo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-29 08:57 UTC by Henri Verbeet
Modified: 2015-10-06 15:04 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.5.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Test case (233 bytes, text/x-python-script)
2014-02-09 22:53 UTC, Sidney San Martín
Details

Description Henri Verbeet 2008-12-29 08:57:45 UTC
As described in the LKML thread at http://lkml.org/lkml/2008/1/8/444, calling recv() with MSG_PEEK on an AF_UNIX socket only reads a single skb. Wine uses AF_UNIX sockets for its named pipe implementation and runs into this bug. The patch posted at http://lkml.org/lkml/2008/1/10/436 works for me, but probably doesn't handle fd passing correctly, as the mail already mentions.
Comment 1 Alan 2012-10-30 15:41:47 UTC
If this is still seen on modern kernels then please re-open/update
Comment 2 Sidney San Martín 2014-02-09 22:53:53 UTC
Created attachment 125431 [details]
Test case

This still exists on modern kernels (tried 3.5.0-17-generic), it'd be awesome if it could be fixed.

Here's a short Python script to demonstrate the problem. It passes on FreeBSD and Mac OS.
Comment 3 Aaron Conole 2015-10-06 15:04:40 UTC
This bug can be resolved with the following commits: 

- 4613012db1d911f80897f9446a49de817b2c4c47
- 9f389e35674f5b086edd70ed524ca0f287259725
- e9193d60d363e4dff75ff6d43a48f22be26d59c7

Note You need to log in before you can comment on or make changes to this bug.