Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752525AbbKKSwM (ORCPT ); Wed, 11 Nov 2015 13:52:12 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42930 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751414AbbKKSwJ (ORCPT ); Wed, 11 Nov 2015 13:52:09 -0500 Message-Id: <1447267928.3704532.436332953.6FB2A816@webmail.messagingengine.com> X-Sasl-Enc: 8dbOl+pnzv6qtiQd0FRFo5wMKPf0Ri/JoJB0w9xoASdd 1447267928 From: Hannes Frederic Sowa To: Rainer Weikusat Cc: Jason Baron , Dmitry Vyukov , syzkaller , Michal Kubecek , Al Viro , linux-fsdevel@vger.kernel.org, LKML , David Miller , David Howells , Paul Moore , salyzyn@android.com, sds@tycho.nsa.gov, ying.xue@windriver.com, netdev , Kostya Serebryany , Alexander Potapenko , Andrey Konovalov , Sasha Levin , Julien Tinnes , Kees Cook , Mathias Krause MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-643af86c Subject: Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue Date: Wed, 11 Nov 2015 19:52:08 +0100 In-Reply-To: <87ziyk347o.fsf@doppelsaurus.mobileactivedefense.com> References: <20151012120249.GB16370@unicorn.suse.cz> <1444652071.27760.156.camel@edumazet-glaptop2.roam.corp.google.com> <563CC002.5050307@akamai.com> <87ziyrcg67.fsf@doppelsaurus.mobileactivedefense.com> <87fv0fnslr.fsf_-_@doppelsaurus.mobileactivedefense.com> <877flp34fl.fsf@doppelsaurus.mobileactivedefense.com> <1447244898.1936942.435925969.525D20D9@webmail.messagingengine.com> <87ziyk347o.fsf@doppelsaurus.mobileactivedefense.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1521 Lines: 42 Hi, On Wed, Nov 11, 2015, at 17:12, Rainer Weikusat wrote: > Hannes Frederic Sowa writes: > > On Tue, Nov 10, 2015, at 22:55, Rainer Weikusat wrote: > >> An AF_UNIX datagram socket being the client in an n:1 association with > >> some server socket is only allowed to send messages to the server if the > >> receive queue of this socket contains at most sk_max_ack_backlog > >> datagrams. > > [...] > > > This whole patch seems pretty complicated to me. > > > > Can't we just remove the unix_recvq_full checks alltogether and unify > > unix_dgram_poll with unix_poll? > > > > If we want to be cautious we could simply make unix_max_dgram_qlen limit > > the number of skbs which are in flight from a sending socket. The skb > > destructor can then decrement this. This seems much simpler. > > > > Would this work? > > In the way this is intended to work, cf > > http://marc.info/?t=115627606000002&r=1&w=2 Oh, I see, we don't limit closed but still referenced sockets. This actually makes sense on how fd handling is implemented, just as a range check. Have you checked if we can somehow deregister the socket in the poll event framework? You wrote that it does not provide such a function but maybe it would be easy to add? Thanks, Hannes -- 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/