Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1319162rda; Mon, 23 Oct 2023 09:01:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoQjbWBTJZPL3YW97RYJufpomlkLcGtlZuNZqYsqoKTJNnckzWHzIiO7dfawuG0KUfpSqB X-Received: by 2002:a05:6a20:a183:b0:17e:8960:659b with SMTP id r3-20020a056a20a18300b0017e8960659bmr14785pzk.26.1698076876819; Mon, 23 Oct 2023 09:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698076876; cv=none; d=google.com; s=arc-20160816; b=nBBi9Yvq+DgBveerQ38QccGDcjmDDA+pzzj1LmDBne1TPHLp3Qzor4PVh4FYuIwtzk A44eS26UpFucFYSrLwSJQY3ugOuvoHXk4JHONWqYIS1J2PHRIfUOoeM0MpbBk4tNGffh hAC129ezsxHexOu5nAlW2AaJxEZxwSiii2YMRfe+UTosAarUTm+57wDZTFsnheC7d1lH 66ZsgY3lfitiOD4x6O3uZI0L9L1wGFfvXeDSSsObsjztQVt+1Eyp++y5RPZ012XV4yBs RfG/+GUXOPrf7Gs+B4HijLqm/9hXF021UZybNYg0qRDZ5/HhFTq2bROm/dzoLeZ3OI4C OpLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QOfatJKrq6+BLMthfVau2bTp9TOG1cZedQEaR0E3QfU=; fh=1bEKxMIFfMErIUyk/xDmdUqg39e5cbQG0kNq4/kiohc=; b=ORg9cyH7iPpF5iFxBIM+2WJk+2XN6b+vQtejBAYUu5DiV+7/ZMHap2Cj15M27swIDl nTJMuYw/r6ig+9zhZ252gAAUMcHZpmaBaM0059gTIdGLz8JewNaQ15U9y9nAfG4W8IJ3 lMpMVKQfTLZjR5pAjs9NQJWymC1NFkh3v8fGxBq1VgmzLluREm1fxB99qivmaPXSKVqr ndD2TY4VDXe3AaDAm05pCEUoTxtNRgNo8hDU+Gwm8RIOV9408oJOO+j/hobGbwxxOrLH OwO3L+4pPGKDFO4iFKIumLEsu6bxMI3NyetatRuO0vxyO5HHi6SmYiFvCHPwmLNvsLAn kWJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=darkboxed.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id f21-20020a63f115000000b005b8549f737dsi6690671pgi.708.2023.10.23.09.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 09:01:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=darkboxed.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 38462807750D; Mon, 23 Oct 2023 09:00:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229714AbjJWQAL (ORCPT + 99 others); Mon, 23 Oct 2023 12:00:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjJWQAK (ORCPT ); Mon, 23 Oct 2023 12:00:10 -0400 Received: from janet.servers.dxld.at (mail.servers.dxld.at [IPv6:2001:678:4d8:200::1a57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E47FDE9; Mon, 23 Oct 2023 09:00:06 -0700 (PDT) Received: janet.servers.dxld.at; Mon, 23 Oct 2023 17:59:56 +0200 Date: Mon, 23 Oct 2023 17:59:50 +0200 From: Daniel =?utf-8?Q?Gr=C3=B6ber?= To: "Jason A. Donenfeld" Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , wireguard@lists.zx2c4.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] wireguard: Fix leaking sockets in wg_socket_init error paths Message-ID: <20231023155950.oyl2olisob6dnvwo@House.clients.dxld.at> References: <20231023130609.595122-1-dxld@darkboxed.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 09:00:25 -0700 (PDT) Hi Jason, On Mon, Oct 23, 2023 at 04:04:13PM +0200, Jason A. Donenfeld wrote: > The signed-off-by is missing and the subject does not match the format > of any other wireguard commits. Ah, I don't usually send kernel patches. Forgot to do format.signOff=true. > On Mon, Oct 23, 2023 at 03:06:09PM +0200, Daniel Gröber wrote: > > This doesn't seem to be reachable normally, but while working on a patch > > "Normally" as in what? At all? Or? I committed this while working on my address/ifindex binding patch[1] (which I will also resend shortly), at the time I thought this fix makes sense in isolation but apparently not. [1]: https://lists.zx2c4.com/pipermail/wireguard/2023-August/008148.html, > > for the address binding code I ended up triggering this leak and had to > > reboot to get rid of the leaking wg sockets. > > This commit message doesn't describe any rationale for this patch. Can > you describe the bug? It's been a while since I wrote this patch. Unfortunately you didn't respond to my initial mail in Aug, so some context has already been lost to time. I may have been under the mistaken impression that udp_sock_create can return <0 while leaving *sockp!=NULL, but as I recall it I did re-test with this patch and it fixed the bug, that I wish I remembered how to trigger now. Unsatisfying. --Daniel