From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 08 Aug 2024 15:01:22 +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 1sc2le-007UyD-2U for lore@lore.pengutronix.de; Thu, 08 Aug 2024 15:01:22 +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 1sc2le-0000Io-03; Thu, 08 Aug 2024 15:01:22 +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 1sc2lb-0000IK-DB; Thu, 08 Aug 2024 15:01:19 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.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 1sc2lb-005Qkc-0P; Thu, 08 Aug 2024 15:01:19 +0200 Received: from rhi by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sc2la-008rZw-2x; Thu, 08 Aug 2024 15:01:18 +0200 Date: Thu, 8 Aug 2024 15:01:18 +0200 From: Roland Hieber To: Ahmad Fatoum Message-ID: <20240808130118.nrb66wdjtsgfykdg@pengutronix.de> References: <20240801113819.3981009-1-a.fatoum@pengutronix.de> <20240801113819.3981009-6-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240801113819.3981009-6-a.fatoum@pengutronix.de> Subject: Re: [DistroKit] [PATCH 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: distrokit@pengutronix.de 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 On Thu, Aug 01, 2024 at 01:38:19PM +0200, Ahmad Fatoum wrote: > 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))} I guess we should really divide this script up into re-usable parts so that we don't have to fix all bugs three times… but the patches in this series look good to me. - Roland > > # check if vde is available for networking > if [ -z "${VDE_SOCKET}" ]; then > -- > 2.39.2 > > > -- Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |