From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 14 Aug 2024 11:33:08 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1seANQ-009UXP-2m for lore@lore.pengutronix.de; Wed, 14 Aug 2024 11:33:08 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1seANQ-0000VR-DY; Wed, 14 Aug 2024 11:33:08 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1seANF-0000F1-JA; Wed, 14 Aug 2024 11:32:57 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seANF-000KON-41; Wed, 14 Aug 2024 11:32:57 +0200 Received: from rhi by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1seANF-002Yqh-0D; Wed, 14 Aug 2024 11:32:57 +0200 From: Roland Hieber To: distrokit@pengutronix.de Date: Wed, 14 Aug 2024 11:32:09 +0200 Message-Id: <20240814093207.606528-7-rhi@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814093207.606528-1-rhi@pengutronix.de> References: <20240814093207.606528-1-rhi@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [RESEND][PATCH v1 6/6] v7a_noneon: run: really constrain the forwarded SSH port to <= 64000 X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ahmad Fatoum Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false From: Ahmad Fatoum The variable expansion braces should have been arithmetic evaluation parentheses, which had the effect that the PPID was always used as a port number (which incidentally works fine for PPIDs < 65535). This was fixed in configs/platform-v7a/run by commit fb3e1645e6b5 ("v7a: run: really constrain the forwarded SSH port to <= 64000"), so apply the same fix here. Fixes: 5d2b3d23b2da ("platform-v7a_noneon: sama5: platform w/out NEON extension") Signed-off-by: Ahmad Fatoum --- configs/platform-v7a_noneon/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/platform-v7a_noneon/run b/configs/platform-v7a_noneon/run index ccdcdb91c767..0307e982a334 100755 --- a/configs/platform-v7a_noneon/run +++ b/configs/platform-v7a_noneon/run @@ -31,10 +31,10 @@ if [ ! -e "${QEMU_EXEC}" ]; then exit 1 fi -# the port to which an sshd would connect (in the emulated sysem) +# the port to which an sshd would connect (in the emulated system) SSH_INTERNAL_PORT=22 # the port which QEMU opens at the host side to give access to the ${SSH_INTERNAL_PORT} -SSH_EXTERNAL_PORT=${QEMU_SSH_PORT:-${PPID%64000+1025}} +SSH_EXTERNAL_PORT=${QEMU_SSH_PORT:-$((PPID%64000+1025))} # check if vde is available for networking if [ -z "${VDE_SOCKET}" ]; then -- 2.39.2