From: Daniel Borkmann <daniel@iogearbox.net>
To: Florian Westphal <fw@strlen.de>, Saeed Mahameed <saeedm@mellanox.com>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
Yevgeny Petrilin <yevgenyp@mellanox.com>,
Andre Melkoumian <andre@mellanox.com>,
Matthew Finlay <matt@mellanox.com>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Patrick McHardy <kaber@trash.net>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Subject: Re: [PATCH net-next] nfnetlink_queue: enable PID info retrieval
Date: Fri, 10 Jun 2016 00:21:41 +0200 [thread overview]
Message-ID: <5759EBF5.4010902@iogearbox.net> (raw)
In-Reply-To: <20160609213517.GA25288@breakpoint.cc>
On 06/09/2016 11:35 PM, Florian Westphal wrote:
> Saeed Mahameed <saeedm@mellanox.com> wrote:
>> index a1bd161..67de200 100644
>> --- a/net/socket.c
>> +++ b/net/socket.c
>> @@ -382,6 +382,7 @@ struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname)
>> }
>>
>> sock->file = file;
>> + file->f_owner.sock_pid = find_get_pid(task_pid_nr(current));
>> file->f_flags = O_RDWR | (flags & O_NONBLOCK);
>> file->private_data = sock;
>> return file;
>
> This looks like this leaks sock_pid reference...?
>
> (find_get_pid -> get_pid -> atomic_inc() , I don't see a put_pid in the
> patch)
>
> Can't comment further than this since I'm not familiar with vfs; e.g.
> I can't say if fown_struct is right place or not, or if this approach
> even works when creating process has exited after fork, etc.
Or ... if you xmit the fd via unix domain socket to a different process
and initial owner terminates, which should give you invalid information
then; afaik, this would just increase struct file's refcnt and hand out
an unused fdnum ( get_unused_fd_flags() + fd_install(), etc).
For extending 'struct fown_struct', you probably also need to Cc fs folks.
next prev parent reply other threads:[~2016-06-09 22:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-09 20:50 [PATCH net-next] nfnetlink_queue: enable PID info retrieval Saeed Mahameed
2016-06-09 21:17 ` Eric Dumazet
2016-06-10 14:29 ` David Laight
2016-06-10 15:31 ` Eric Dumazet
2016-06-09 21:35 ` Florian Westphal
2016-06-09 22:21 ` Daniel Borkmann [this message]
2016-06-09 23:22 ` Daniel Borkmann
2016-06-10 6:40 ` Daniel Wagner
2016-06-15 18:47 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5759EBF5.4010902@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=andre@mellanox.com \
--cc=davem@davemloft.net \
--cc=fw@strlen.de \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=matt@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=saeedm@mellanox.com \
--cc=yevgenyp@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.