From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.88.254] (unknown [36.73.79.120]) by gnuweeb.org (Postfix) with ESMTPSA id 5EDE77ED7E; Mon, 6 Jun 2022 02:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1654482531; bh=2J1Ios6Q16+kPbcGq4877TwguzHsVgNAoD49TefG41U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Y52gear2tLbWk3xuRs4rgQkZVmQRGebrrvppFsGwslISz/R9cnHFQxc91mC74caG8 iVyofpJXiXDGvnvZb8WsnxmS4kVQluS8qBvAMdsIx/Lh0C8s9BO92usn3KS8xiVSwa Sq0KBcA77C2LxIYHqodigWUi6pHnkux3syGf05sOEMFh+MDfI2f0ccqSYB1JkTLkuG tTuAkwYcqOPNlix3ngYUUYc0x5M1BAKyhdz3m8WbKdCo+mC08SxzyKegHcBLtnA0RD GOzhYJAm/jwdBpXg+MB4s5MPj3i4O7v7NfQVAew34WTR38kVJhTHPsnFloD4l+QByy FzbSuvfN57QCg== Message-ID: Date: Mon, 6 Jun 2022 09:28:45 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] slc: Fix file descriptor leak Content-Language: en-US To: Arthur Lapz Cc: GNU/Weeb Mailing List References: <20220606022747.316158-1-ammarfaizi2@gnuweeb.org> From: Ammar Faizi In-Reply-To: <20220606022747.316158-1-ammarfaizi2@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 6/6/22 9:27 AM, Ammar Faizi wrote: > Arthur Lapz reported that he is seeing a blocking socket from the > public client side after the app side has closed the connection. > > This turned out that we haven't closed the SLC socket file descriptor: > > ``` > Isolated Server > -------- ------ > > fd_app -- -- fd_public_client > |----[ SLC circuit ]----| > fd_circuit -- -- fd_circuit > > ``` > After the app in the isolated client has closed its fd, we didn't close > the fd_app and fd_circuit. That's why the server is still sleeping, > waiting for any response from the isolated area. > > This was just a typo in if statements that caused the close() paths were > not taken. Simply fix the typo. Change "==" to "!=". > > Link: https://t.me/lostcontrol_s1/16737 > Link: https://t.me/lostcontrol_s1/16739 # Reproducer > Fixes: 04a86adffa415e8365d27929bbb826028e00bfd3 ("Initial commit") > Reported-by: Arthur Lapz > Signed-off-by: Ammar Faizi > --- @rlapz, can you test this patch and see if it's a cure? -- Ammar Faizi