From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753549AbcADVom (ORCPT ); Mon, 4 Jan 2016 16:44:42 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:48578 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752106AbcADVok (ORCPT ); Mon, 4 Jan 2016 16:44:40 -0500 Date: Mon, 04 Jan 2016 16:44:35 -0500 (EST) Message-Id: <20160104.164435.2254202571374844451.davem@davemloft.net> nTo: w@1wt.eu Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, edumazet@google.com, hannes@stressinduktion.org, socketpair@gmail.com Subject: Re: [PATCH] unix: properly account for FDs passed over unix sockets From: David Miller In-Reply-To: <20151228141435.GA13351@1wt.eu> References: <20151228141435.GA13351@1wt.eu> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 04 Jan 2016 13:44:39 -0800 (PST) To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Willy Tarreau Date: Mon, 28 Dec 2015 15:14:35 +0100 > It is possible for a process to allocate and accumulate far more FDs than > the process' limit by sending them over a unix socket then closing them > to keep the process' fd count low. > > This change addresses this problem by keeping track of the number of FDs > in flight per user and preventing non-privileged processes from having > more FDs in flight than their configured FD limit. > > Reported-by: socketpair@gmail.com > Suggested-by: Linus Torvalds > Signed-off-by: Willy Tarreau > --- > It would be nice if (if accepted) it would be backported to -stable as the > issue is currently exploitable. As mentioned, please remove the unix_sock_count variable and associated code as it is completely unused after this patch.