From nobody Tue Jul 12 16:43:46 2022 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B9D0D17F85AC for ; Tue, 12 Jul 2022 16:43:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lj65Z4MWXz3SV2 for ; Tue, 12 Jul 2022 16:43:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Lj65Z3S1pzr1Z for ; Tue, 12 Jul 2022 16:43:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 26CGhkhb051770 for ; Tue, 12 Jul 2022 16:43:46 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 26CGhksD051769 for net@FreeBSD.org; Tue, 12 Jul 2022 16:43:46 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 265154] tcp: syncache_expand() potential race Date: Tue, 12 Jul 2022 16:43:46 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: glebius@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: glebius@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657644226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CbeIvqsrD+RJYnvjopT00Too/wjyVrMA8c2loYNgNzg=; b=gqsjrtGBqWZ635POfnh8t9/OOqyrTHL2cr4gNn1bzdNWvjZbudmcuka809niyxvnA7ZNLr Q7k2gVPkUALNS2HwZB7Z5luYIyz58yRMgGYQCJT61SmZfbgyoAJxzKQoYQJT1c75kN9vqn imKwpcrhft0LGwW6cdDK01LqU50lmVPMgD5/qjKAXoFO6bE6QQBoSzLWHZTsn+1fnH7AQi ujy4erFYPHIDV4c30Jei42ApZGj9cjFLAYh7bD86hVnQImNOJmUvRTvm3vKsPAfJQl+JxA GkFlITFEL7mk8c1kuncSC1LOLd13ebhmEv2/jZ7+JXzbUz4R3L+cd2dmkzMkxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657644226; a=rsa-sha256; cv=none; b=QPC7MU5FWE4BtqPlZLYEiyFR18UXXaBmA/kB9K6LmGHnVhFiMFosqD7xd4Zd3u+Fc7fKv+ G6a1mw3voI9dXtOuITT85ahMhc9HOUXKt212nfoOSKeuQD/LdSPDNCtu2jrUAu3NGn0bFk fGF8FqLv558eBgFa4b6gXMeVpsQUY5mPpchW/i1wRdCpXRuPYN+cN3EDBFN451nxu685Jn caoD32f0+knuiwW+rjmo6sjQVBJgs5XGlPlNm0iGpCS8Czo88khLlJZSQ9yzipCw/++6jF bhrpd1PaY7rQ7hCFTa0eNQKkuE8MS8F/WF8Hwvd+tz6aByPR3kFvnXl2LBW6Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265154 Gleb Smirnoff changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|net@FreeBSD.org |glebius@FreeBSD.org Status|New |Open --- Comment #4 from Gleb Smirnoff --- There are two more problems around this place. 1) There is a problem I recently introduced. If syncache_socket() fails to = do PCB insertion, it will call soabort(). This soabort() will release last reference (that belongs to listen queue) and will go with sofree() of a soc= ket that is still on listening queue. Note that all other non-TCP consumers of sonewconn() do not have this problem, as they just set so_error instead of = call to soabort(). 2) The 6f3caa6d8159 very likely needs to be reverted. With modern synchronization in the network stack (epoch + SMR) it is very likely not an optimization. I think all 3 problems can be nailed with a single patch, that will introdu= ce pr_newconn() to be executed instead of pr_attach() for sonewconn(). It will have slightly different semantic than pr_attach(). I'm going to work on that in August, as today I'm leaving for a vacation. I think all listed problems aren't critical and can be left as as for a few weeks. --=20 You are receiving this mail because: You are the assignee for the bug.=