From patchwork Tue Mar 14 14:48:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 3130 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:2310:b0:9f:bfa4:120f with SMTP id r16csp2332823dye; Tue, 14 Mar 2023 07:49:55 -0700 (PDT) X-Google-Smtp-Source: AK7set9BFjV+2xw2KhHFQs6xseNrNzjxxjX2Xr5b0rYp64RGOcKYAH1kS6/fVsKSHJNbFJFRFeIu X-Received: by 2002:a17:902:e550:b0:1a0:42c0:b2a5 with SMTP id n16-20020a170902e55000b001a042c0b2a5mr9824465plf.24.1678805395413; Tue, 14 Mar 2023 07:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678805395; cv=none; d=google.com; s=arc-20160816; b=zHcPCy1FtOqDl6O4RNlMKZ9YA+w/d+PY1DO3Uf6QG4bwAu5QES23/Axcuunt313gGh qlwtQbzjy+tPS0Fkg4yHHWrfIzAqMSGPRPQ6bNb6j6Qnf7Xs2Z1liJB9uEAG4n69Cdzm jLP7sNd35aVeToLG9mce7zUm5lsdBaUZI0xaG3elnPuINYd6lBJdCXK4VvNckK5JxVn5 gZ7Up2r9Ju5dX0Vcw10u81g8mRTP4LeO7t2IgHWLy28z4uLpkcHGSCbI79gW7PgVvPY/ 3PQ65GU6D/blZjLmq0RnSGMh58CNNSyVQpPmX93L831C3XrIhHmPUrbUPsZIW4QWSfyX SQDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=9KCKX05j0FNN9mCJaFRh30RHnCM0fR8GvSkYH/J3vGo=; b=ICT9PNe9PWvdRBAl/zAonOAuC12D1mPt5TlTAt1IeUJQ7jqPx/j917u6BByY72/b38 3uVtn2qXsjTP0THTtf7dinTDhkOMwYkeCOueBv4MCCIiziZxiIh5eR57aZvEwgjCTJ/0 CrAohMvshCk0bjPXNoDk2GqbqqkldWfFLxuq/oqSRu18uQep4Xs/sbR9/UTFLAZOVdtX lYnTB1cNfB9YbqMgSbnsvwk6M7U44L9L5BkXUnP8stR7LC+chL8U0zwvEaUIW5ql8A8L S3RGrXTv7ZoCzCY97sh6EBpR7QtL1uHLpLB77XBS1Fr8zGUtwK4YIKQMq11At6Vd827f qZQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=m4YkxATG; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="Frc/l2M7"; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id kr16-20020a170903081000b0019cdf4ef3b9si2561060plb.321.2023.03.14.07.49.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Mar 2023 07:49:55 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=m4YkxATG; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="Frc/l2M7"; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pc5xd-0005jn-UW; Tue, 14 Mar 2023 14:49:10 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pc5xc-0005jQ-34 for openvpn-devel@lists.sourceforge.net; Tue, 14 Mar 2023 14:49:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q7LeJmwq0my5/EywLCgets9KkL3WNS/jeX/HFS99mIM=; b=m4YkxATGul1HQr9QtayfLyyiOh uJtcDYDkD92bQ7/v4+A4+ENjACWhgF2ovTGCyUZbAQYklxt5CByCrvh8ksbKPtRUhadvBa9+T0H+j HU4erBzZ0FLxrOVuQnwxDnbs24Qu9p5Ut5g+UTQ3y6gI5PacVSKMoAv0ll2tIbfS6lP0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Q7LeJmwq0my5/EywLCgets9KkL3WNS/jeX/HFS99mIM=; b=Frc/l2M75Qsecx8rBv7FaVyPTd LNrQPbloQemRE0oJAYQZDPe9G7Oat4CdwuW2Mr/Iok8zBSaReF1t1fbjhoiT+aNt9ketxBtJjcjeE tz1ymDr9Dlxa+JoDJQj1yL7D3MU8iSSlM7D70h9o/ROY9b9ywTkIxZVEBGp64JumzFtc=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pc5xa-008TYT-JT for openvpn-devel@lists.sourceforge.net; Tue, 14 Mar 2023 14:49:08 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1pc5xO-000EdE-Mt for openvpn-devel@lists.sourceforge.net; Tue, 14 Mar 2023 15:48:54 +0100 Received: (nullmailer pid 182161 invoked by uid 10006); Tue, 14 Mar 2023 14:48:54 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Tue, 14 Mar 2023 15:48:54 +0100 Message-Id: <20230314144854.182110-2-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230314144854.182110-1-arne@rfc2549.org> References: <20230314144854.182110-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Score: 0.3 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The open_tun_dco_generic already allocates the actual_name string, this shadows the allocation in the FreeBSD/Linux specific methods. Found-By: clang with asan Change-Id: I51f5fcfff4e5f8203fdb9aec0245cfccd17043cc Signed-off-by: Arne Schwabe --- src/openvpn/dco_freebsd.c | 1 - src/openvpn/dco_linux.c | 1 - 2 files [...] Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1pc5xa-008TYT-JT Subject: [Openvpn-devel] [PATCH 2/2] Fix memory leaks in dco open tun X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1760355046335835824?= X-GMAIL-MSGID: =?utf-8?q?1760355046335835824?= The open_tun_dco_generic already allocates the actual_name string, this shadows the allocation in the FreeBSD/Linux specific methods. Found-By: clang with asan Change-Id: I51f5fcfff4e5f8203fdb9aec0245cfccd17043cc Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- src/openvpn/dco_freebsd.c | 1 - src/openvpn/dco_linux.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index ecca2a076..225b3cf88 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -232,7 +232,6 @@ create_interface(struct tuntap *tt, const char *dev) } snprintf(tt->dco.ifname, IFNAMSIZ, "%s", ifr.ifr_data); - tt->actual_name = string_alloc(tt->dco.ifname, NULL); /* see "Interface Flags" in ifnet(9) */ int i = IFF_POINTOPOINT | IFF_MULTICAST; diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index b2fdbf53f..e5cea3c71 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -457,7 +457,6 @@ open_tun_dco(struct tuntap *tt, openvpn_net_ctx_t *ctx, const char *dev) msg(M_FATAL, "DCO: cannot retrieve ifindex for interface %s", dev); } - tt->actual_name = string_alloc(dev, NULL); tt->dco.dco_message_peer_id = -1; ovpn_dco_register(&tt->dco);