Re: [PATCH] af_unix: fix garbage collect vs. MSG_PEEK

2016-12-19 Thread Miklos Szeredi
On Tue, Oct 4, 2016 at 3:51 AM, David Miller wrote: > From: Miklos Szeredi > Date: Thu, 29 Sep 2016 14:09:14 +0200 > >> @@ -1550,6 +1550,17 @@ static int unix_attach_fds(struct scm_cookie *scm, >> struct sk_buff *skb) >> return max_level; >> } >> >> +static void unix_peek_fds(struct scm_c

Re: [PATCH] af_unix: fix garbage collect vs. MSG_PEEK

2016-10-03 Thread David Miller
From: Miklos Szeredi Date: Thu, 29 Sep 2016 14:09:14 +0200 > @@ -1550,6 +1550,17 @@ static int unix_attach_fds(struct scm_cookie *scm, > struct sk_buff *skb) > return max_level; > } > > +static void unix_peek_fds(struct scm_cookie *scm, struct sk_buff *skb) > +{ > + scm->fp = scm_fp

[PATCH] af_unix: fix garbage collect vs. MSG_PEEK

2016-09-29 Thread Miklos Szeredi
Gc assumes that in-flight sockets that don't have an external ref can't gain one while unix_gc_lock is held. That is true because unix_notinflight() will be called before detaching fds, which takes unix_gc_lock. Only MSG_PEEK was somehow overlooked. That one also clones the fds, also keeping the