From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751635AbdBJBi1 (ORCPT ); Thu, 9 Feb 2017 20:38:27 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:36190 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbdBJBiZ (ORCPT ); Thu, 9 Feb 2017 20:38:25 -0500 MIME-Version: 1.0 In-Reply-To: <20170207142035.vfnyrbggb6kbfzgd@dhcp-1-212.brq.redhat.com> References: <20161209064144.GZ1555@ZenIV.linux.org.uk> <20170126232912.rgh6undqxd4tofqj@dhcp-1-212.brq.redhat.com> <20170127064143.ddyt43iglu2odlld@dhcp-1-212.brq.redhat.com> <20170131181411.cq3o7yxrnhq6thpt@dhcp-1-212.brq.redhat.com> <20170207142035.vfnyrbggb6kbfzgd@dhcp-1-212.brq.redhat.com> From: Cong Wang Date: Thu, 9 Feb 2017 17:37:56 -0800 Message-ID: Subject: Re: fs, net: deadlock between bind/splice on af_unix To: Mateusz Guzik Cc: Dmitry Vyukov , Al Viro , "linux-fsdevel@vger.kernel.org" , LKML , David Miller , Rainer Weikusat , Hannes Frederic Sowa , netdev , Eric Dumazet , syzkaller Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 7, 2017 at 6:20 AM, Mateusz Guzik wrote: > > Yes, but unix_release_sock is expected to leave the file behind. > Note I'm not claiming there is a leak, but that racing threads will be > able to trigger a condition where you create a file and fail to bind it. > Which is expected, right? No one guarantees the success of file creation is the success of bind, the previous code does but it is not part of API AFAIK. Should a sane user-space application check the file creation for a successful bind() or just check its return value? > What to do with the file now? > We just do what unix_release_sock() does, so why do you keep asking the same question? If you still complain about the race with user-space, think about the same race in-between a successful bind() and close(), nothing is new.