Re: [RFC] unix: fix use-after-free in unix_dgram_poll()/ 4.2.5

2015-11-02 Thread Rainer Weikusat
Olivier Mauras writes: [...] > I've encountered issues with Jason's patch ported to 3.14.x which would break > openldap, rendering it unable to answer any query - Here's a strace of the > slapd process in this state http://pastebin.ca/3226383 > Just ported Rainer's patch to 3.14 and so far I ca

Re: [RFC] unix: fix use-after-free in unix_dgram_poll()/ 4.2.5

2015-10-30 Thread Rainer Weikusat
Same changes ported to 4.2.5 with some minor improvments (I hope), namely, - applied a round of DeMorgan to the 'quick' check function in order to simplify the condition - fixed a (minor) error in the dgram_sendmsg change: In case the 2nd check resulted in 'can

Re: [RFC] unix: fix use-after-free in unix_dgram_poll()

2015-10-29 Thread Rainer Weikusat
Jason Baron writes: > On 10/28/2015 12:46 PM, Rainer Weikusat wrote: >> Rainer Weikusat writes: >>> Jason Baron writes: [...] >> and the not-so-nice additional property that the connect and >> disconnect functions need to take the peer_wait.lock spinlock >> explicitly so that this lock is used

Re: [RFC] unix: fix use-after-free in unix_dgram_poll()

2015-10-28 Thread Jason Baron
On 10/28/2015 12:46 PM, Rainer Weikusat wrote: > Rainer Weikusat writes: >> Jason Baron writes: > > [...] > >>> 2) >>> >>> For the case of epoll() in edge triggered mode we need to ensure that >>> when we return -EAGAIN from unix_dgram_sendmsg() when unix_recvq_full() >>> is true, we need to ad

[RFC] unix: fix use-after-free in unix_dgram_poll()

2015-10-28 Thread Rainer Weikusat
Rainer Weikusat writes: > Jason Baron writes: [...] >> 2) >> >> For the case of epoll() in edge triggered mode we need to ensure that >> when we return -EAGAIN from unix_dgram_sendmsg() when unix_recvq_full() >> is true, we need to add a unix_peer_wake_connect() call to guarantee a >> wakeup. O