From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2098.outbound.protection.outlook.com [40.107.243.98]) by sourceware.org (Postfix) with ESMTPS id 5DDC73858009 for ; Sun, 22 Nov 2020 20:44:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5DDC73858009 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ogN5MCmg0LvFzlx0YdWvU2tP2pzojoVcKiB2Ccs+ZfwkHoOwgbsaoKwVhz4qCGYXXvg7Gk0ofT1chyk3cb1Jp0tdpskY116sZktGeXxlYeCHGHnlcyu/g1SuwVM7g59QPmp65JkP1v5yiHAKoFCRRQ5RUhcHF9+HFpwFmnTqfiFJ/r6zxw4+ajC0gSGMdVyFbX5wmbpfOEbnm67VKWeIn+QJAHZtlrRc0J2F3NybZe7zf8xSwskcjiK4Pgz9VcJj2zVCEFOk2G5N+dCH+2sk4CuKzSToj6qfs9kZwvu2bmCzMeWMgv9WBQBPCUC842mwGclXYGY1Mu6mtgQOiwQrqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FYy1t0JfjxMQv8CSabCLMfelJbEX4KeJ8o3GrVrg8u0=; b=X+kh6MTwcYh+t2GiKGUvJMkcBixByaY9c95mF1+YW7Mk2sCDjtmdT5Tw7fea/4zw7AIJUkLtvb3kFdrEyT9YmufjgubKLzRBqIT7soSsVzwCkLmBWy0m8xrKkCvZX4bnnvC9XdIiKj2WFOSz7hYR1dol6PY/ndJ8jC91Yh9FgSzjX+TgzFasITYiAnpSj82zEXVzz0J29Ynk7s3u4WzXbvEJ7JeaTWEIj7rtvZy4GJMLuTkDfnu42PbWGIGbMRC/5RVLW+NlGoFWxF0bCPAeG9TnaCHJFil1z0UvLQZmegWe22mY8DFbkeNfCQkUctuVPQUsGx+dKl3fZTrWmlng7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none Received: from MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) by MN2PR04MB6270.namprd04.prod.outlook.com (2603:10b6:208:e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.29; Sun, 22 Nov 2020 20:44:22 +0000 Received: from MN2PR04MB6176.namprd04.prod.outlook.com ([fe80::113e:c874:1207:eca8]) by MN2PR04MB6176.namprd04.prod.outlook.com ([fe80::113e:c874:1207:eca8%6]) with mapi id 15.20.3589.030; Sun, 22 Nov 2020 20:44:22 +0000 Subject: Re: AF_UNIX status report To: cygwin-developers@cygwin.com References: <38e33f7a-e87d-fea8-ac9e-826f94c189d4@cornell.edu> <20201104120304.GF33165@calimero.vinschen.de> <88b3dfe6-a67d-c597-afe2-4edb13cee5d7@cornell.edu> <20201105172140.GP33165@calimero.vinschen.de> <80cb96b8-065d-b146-b879-170031ba28b5@cornell.edu> <20201106091240.GT33165@calimero.vinschen.de> <99e02f87-1c58-ce6f-58e0-0deb26c4c899@cornell.edu> <20201109090812.GV33165@calimero.vinschen.de> <6c3e9c53-8575-de80-be2d-49af2b87eaa5@cornell.edu> <20201118083447.GL41926@calimero.vinschen.de> From: Ken Brown Message-ID: Date: Sun, 22 Nov 2020 15:44:19 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 In-Reply-To: <20201118083447.GL41926@calimero.vinschen.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2604:6000:b407:7f00:7df6:6f91:4c26:4a48] X-ClientProxiedBy: CH2PR20CA0021.namprd20.prod.outlook.com (2603:10b6:610:58::31) To MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2604:6000:b407:7f00:7df6:6f91:4c26:4a48] (2604:6000:b407:7f00:7df6:6f91:4c26:4a48) by CH2PR20CA0021.namprd20.prod.outlook.com (2603:10b6:610:58::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sun, 22 Nov 2020 20:44:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 161ae54c-5d90-48bd-fd11-08d88f27642a X-MS-TrafficTypeDiagnostic: MN2PR04MB6270: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MfljKc9mMrSdEjgcqNRuTpYvvk3qQsUXVbH+kb5xG6tsAN0zzOVaD5dqWOtJGIW5VXV6OYbhd+LMnDEd8+/MCN569PfqZnqyz4dPh5z4AGqwvd8DyUXUgCSXY3JGYcZzRn5f2i0N3WDO5AvDC2BV4jNr7WX8qaC9j+Vc/GI1zD6UgZlfLZLy4epfRRg831N+8EttXHscHYcDocwGYJijNJ9D6ro0h/LmhBXd7uS173rjCQHJJu2iGHAu6kC0zsyMhQirIOtrED6xmhCWdWGxzHW1rLf8mzkuE+smOnN98Vs/qZEZcEP8hYeuCYIRH2kjM8wj1uWoVDwu4MEmk1o9fIu6c39hO6xc0Nw18v3nWaIu8AzbhoFdJz5snLL2wGEp X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR04MB6176.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(376002)(346002)(396003)(39860400002)(6916009)(66556008)(786003)(2616005)(316002)(5660300002)(16526019)(36756003)(7116003)(6486002)(186003)(86362001)(66946007)(52116002)(31686004)(83380400001)(53546011)(66476007)(8936002)(75432002)(31696002)(8676002)(478600001)(2906002)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: c0iHzdMi3pULPpCU3UTOO0w2ZcYa41SMQknCwc1Moj6Gr2UNjrmoj6sP9H+CJo0f7ZwuNkjfFva5deXJqVCPJJPUcHcn3D83V12o7BgwSetjDjIWK4TMG/x4Qn07j1/aCgbI+shFL1TYAcjidWlhRS0kSH3/dFmuM23SQoM1/afN33FuSmF+nFTuwxAaUQLfCF86myTkoxD+T/DrZL+tOtIT4LIVgZSsW90++xj1qIasAxX+AAlsm3/hXesxfKgJsS8jDtNYEe2wtqjR/gbyvNM8k59XQwevV5cpmOv+ls28wy7UqA3APSc32yvVHpzqRPFvCrbVe5bqGw0OkR9HgrS+kv6KyeB1fI2XaVQSkn6Zu0p+LA/Gu/j59YsHt1HFvsP1EE915lAVwOsSRl0EkfwWCWPcR+U3k86ENv0gkeDB+7gNqQzzVN+znjRPbAFRTRuCt4chr2NlhWVlEigTp7a3sVOXl9Mvi24EqqJOuzoLdDD1PjxJLDYMfcfajsnsNyrheopaYLBB0c9waU5YfMqaz0hrP2/KzobYU5YquFjtwzwCKKQBe+kcZXS6WGv5DsVR8QcxstmqltP31o04xHj7Vn6HP4iG1VNTk0iGzuTsX/lnhNGgTC5izSecmqm5pAnK21DODGZGETPQ4Hc1NjNapKbOIgFNTBNIRzYdtf8p0ofV+/qlGGlkQXL0CM/rsz8UcMOl8S080I207ejjzw== X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 161ae54c-5d90-48bd-fd11-08d88f27642a X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2020 20:44:22.2169 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LZVMMkRKyWYFADaQb2blW2lPzdHWHhsJcmIDbfa2X9kPrxw2brcboVVC+C7VhBUyfrFwcoc7VenQUXR2Lwtwxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6270 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2020 20:44:25 -0000 On 11/18/2020 3:34 AM, Corinna Vinschen wrote: > On Nov 17 14:57, Ken Brown via Cygwin-developers wrote: >> On 11/9/2020 4:08 AM, Corinna Vinschen wrote: >>> The duplicated handle has to be closed at one point but otherwise >>> the approach makes sense. >> >> After wasting a ridiculous amount of time because of careless mistakes with >> handle duplication, I've finally gotten something working (currently for >> disk files only and with some limitations that have to removed). I've >> pushed it to the topic/af_unix branch in case you want to review it and/or >> test it. > > This is soooo fantastic! Apart from files, the nexst most interesting > case is sharing a socket, probably. We could activcate the 2nd half of > privilege separation in sshd then. I've pushed a first attempt to implement sending socket descriptors, but I haven't yet tested it. I'll try to find a small test program and then, if all goes well, take a look at sshd. >> If you do test it, the main limitation currently is that the sending process >> can't exit until the receiving process has received and processed the >> SCM_RIGHTS data. > > While this is strictly a flaw, that may not be much of a limitation. > It would be interesting to know how many applications send descriptors > just to exit immediately. Not so many, probably. I don't know, but I've reduced the effect of the limitation. Now the sending process waits up to about 100ms for an ack from the receiving process before closing the socket. I have no idea if 100ms is reasonable in the real world, but it's big enough for my test programs and small enough that I don't notice the delay when I run the programs interactively. Ken