From patchwork Tue Nov 28 10:43:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3486 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:693c:368c:b0:fb:b703:d903 with SMTP id sp12csp2468051dyc; Tue, 28 Nov 2023 02:44:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsERtB3gg7hLH+ylnDwqsWUgc5TUf3fuO1tg6X7VOYFkL0ortzYDBfkfQaBQSCTjH9Wlzg X-Received: by 2002:a17:903:4cf:b0:1cc:394e:102a with SMTP id jm15-20020a17090304cf00b001cc394e102amr16958808plb.0.1701168278685; Tue, 28 Nov 2023 02:44:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701168278; cv=none; d=google.com; s=arc-20160816; b=S47NRPwtDsVo9E2dg4hMWfvgk4iSr+ZuCyBBhClu/i9jbigIuuzcJXbqytst35IQTT ysZZwaBbbMxZ5MNCXNFEtaJbvlIZer6RsxSOsi7FoXC5TgIFcUPSiVp5hV8k9qA0ZBSV vvUkLDGBllaimyhFBDVKi6Hr4BI+WcQaWRr1W7DnY9VrkImtVqp9pwEeqWQkcBsxUG3u FncEMHqx1/INCVXgqWcO5c8NHvXr1HQXq6sYZDEhlDPmvlRy1oqchypmIp8ctM58Siy5 gjaa8DwU656hDae6MWvtTrfqBZDbDwKpqzxNlH0RsTxhfAgAzPzaoq8k6+wGjb2yy4uz LJ8g== 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:dkim-signature; bh=9UvQ3NVzRepigxeYO5Bmkazb4l+G56RimFoRNoEV+S0=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=LtB1H+OXghVCLrdBHo82Hv85sY9gaWC3pIPcWc3bBOxaUdoPzd2J5CQz18rloFlEKy 2LJE4ayWPwfuFWCm8y15VBZE3P862R4ZDi78OPXBkRXhxABDfMW6oSY6UAvCgFd7maJv VF9IvInqBD8JIAFmSl+zQUEC6w6d6d2LGcW4TySGuTTwWpped5MqxXF9Sp5l2r1gmseD r3T9vrK0VmMDPKNXgFMVyRRVF0hol0EXltOlkwd+aD/j7bpEvjs+TavInnqzIfxHEl+w 80+iFyVST08CmF1q8ypi06mFbZXwuoZk7LHma58pvwvS842/j+pZMuhYSTUjMDnO6n/+ KUXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="gOX/tokK"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=hIc9YdO7; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=FiULuAkz; 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 jw10-20020a170903278a00b001bc434b9d95si11192058plb.156.2023.11.28.02.44.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Nov 2023 02:44:38 -0800 (PST) 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="gOX/tokK"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=hIc9YdO7; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=FiULuAkz; 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-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1r7vZn-0001m5-QA; Tue, 28 Nov 2023 10:44:22 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r7vZl-0001lx-EA for openvpn-devel@lists.sourceforge.net; Tue, 28 Nov 2023 10:44:21 +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:Cc:To:From:Sender:Reply-To: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=ysUBLuZ2OVihcJcgk8GgFzZsONPgOjhtZce+GH12H74=; b=gOX/tokKCiZjPjDUvod6bQQLPC pmTUsKvtD05oZJvrWaRwbmes72Dsa/a8oNqBA9wb/114BAt1d7HHzc6dZLlIB+gg0oV8vE0u2rADp bYD23oYZoP1lS/tTqaZALvqHTi7GaJoCxrdi9RHVqtAJmOhW1SuGHjREsKEdHTHiQ/dU=; 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:Cc:To:From:Sender:Reply-To: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=ysUBLuZ2OVihcJcgk8GgFzZsONPgOjhtZce+GH12H74=; b=hIc9YdO7YLSqCFDpX8pNC/tMiU pa5S09M1B9zi753OLNovGeMSMlP83fAlgwuisNTWAqy6YRra4haXPjwTK+s1SYQFt+tQ5Bcoy4qS/ 6dVLyfsfBp9jwImBmnDQlaOArqYWOk57uCW3iutBVVzspoTa4VFlDIqn8TmvKuCMTGn8=; Received: from mout-p-201.mailbox.org ([80.241.56.171]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1r7vZh-0005Lu-LH for openvpn-devel@lists.sourceforge.net; Tue, 28 Nov 2023 10:44:20 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (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) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4SffFr6LLYz9sQY; Tue, 28 Nov 2023 11:44:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1701168240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ysUBLuZ2OVihcJcgk8GgFzZsONPgOjhtZce+GH12H74=; b=FiULuAkzm4q5gmvh3QtIy1oxlV31/Ohyz6KhWqLP37s11ULoRe1gy1TXYL6b3IXZIMujTB rzX1NjBjCXkH8HXE1MbPUZK6wcnqa2K7Hfv5UO1ygiHWWzyZstk5BKlTuTsFBXl7apctDs DMWTJEMTxDdqJrODtelgthGqvfNUhmA1Eze8cnhJ9KuL30+M6xGeS9iGUpCqjwEv+T5zgR W58uYtwCmzqe4COf564JSs/AkoFYb8FYwfN3FOMALnImgrp8xaJYa+c8RzLXOOWNhe2Thr tlaoH2gdi4ekuKrllk8/BHddHkBoYNVbu2YTRVMS2dkEiqOJAOpP4XY/B02qWg== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Tue, 28 Nov 2023 11:43:59 +0100 Message-Id: <20231128104359.62967-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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: From: Arne Schwabe The inner loop used i instead of j when iterating through the buffers. Since i is always between 0 and 2 and ks->send_reliable->size is (when it is defined) always 6 (TLS_RELIABLE_N_SEND_BUFFERS) this [...] Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.171 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1r7vZh-0005Lu-LH Subject: [Openvpn-devel] [PATCH v1] Fix check_session_buf_not_used using wrong index 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?1783804229236489860?= X-GMAIL-MSGID: =?utf-8?q?1783804229236489860?= From: Arne Schwabe The inner loop used i instead of j when iterating through the buffers. Since i is always between 0 and 2 and ks->send_reliable->size is (when it is defined) always 6 (TLS_RELIABLE_N_SEND_BUFFERS) this does not cause an index of out bounds. So while the check is not doing anything really useful with i instead of j, it at least is not crashing or anything similar. Noticed-By: Jon Williams (braindead-bf) on Github issue #449 Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/459 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 400230c..b5d24b5 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -3207,7 +3207,7 @@ for (int j = 0; j < ks->send_reliable->size; j++) { - if (ks->send_reliable->array[i].buf.data == dataptr) + if (ks->send_reliable->array[j].buf.data == dataptr) { msg(M_INFO, "Warning buffer of freed TLS session is still in" " use (session->key[%d].send_reliable->array[%d])",