* [DistroKit] [PATCH] v7a: run: really constrain the forwarded SSH port to <= 64000
@ 2021-11-15 10:14 Roland Hieber
2021-11-24 14:57 ` Robert Schwebel
0 siblings, 1 reply; 4+ messages in thread
From: Roland Hieber @ 2021-11-15 10:14 UTC (permalink / raw)
To: distrokit; +Cc: Jürgen Borleis, Roland Hieber
The variable expansion braces should have been arithmetic evaluation
parentheses.
Fixes: d975eb8b04087f8606d8 (2021-04-26, "v7a: run: make the SSH forwarding port multiprocess-compatible")
Reported-by: Jürgen Borleis <jbe@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
configs/platform-v7a/run | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index 8af190f11eb4..d76c0969aa02 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -39,7 +39,7 @@ fi
# the port to which an sshd would connect (in the emulated sysem)
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.30.2
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [DistroKit] [PATCH] v7a: run: really constrain the forwarded SSH port to <= 64000
2021-11-15 10:14 [DistroKit] [PATCH] v7a: run: really constrain the forwarded SSH port to <= 64000 Roland Hieber
@ 2021-11-24 14:57 ` Robert Schwebel
2021-11-25 15:22 ` [DistroKit] [PATCH v2] " Roland Hieber
0 siblings, 1 reply; 4+ messages in thread
From: Robert Schwebel @ 2021-11-24 14:57 UTC (permalink / raw)
To: Roland Hieber; +Cc: distrokit, Jürgen Borleis
On Mon, Nov 15, 2021 at 11:14:50AM +0100, Roland Hieber wrote:
> The variable expansion braces should have been arithmetic evaluation
> parentheses.
>
> Fixes: d975eb8b04087f8606d8 (2021-04-26, "v7a: run: make the SSH forwarding port multiprocess-compatible")
> Reported-by: Jürgen Borleis <jbe@pengutronix.de>
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
> configs/platform-v7a/run | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
> index 8af190f11eb4..d76c0969aa02 100755
> --- a/configs/platform-v7a/run
> +++ b/configs/platform-v7a/run
> @@ -39,7 +39,7 @@ fi
> # the port to which an sshd would connect (in the emulated sysem)
> 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
Could you re-spin? This patch doesn't apply.
rsc
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* [DistroKit] [PATCH v2] v7a: run: really constrain the forwarded SSH port to <= 64000
2021-11-24 14:57 ` Robert Schwebel
@ 2021-11-25 15:22 ` Roland Hieber
2021-11-25 16:14 ` Robert Schwebel
0 siblings, 1 reply; 4+ messages in thread
From: Roland Hieber @ 2021-11-25 15:22 UTC (permalink / raw)
To: distrokit; +Cc: Jürgen Borleis, Roland Hieber
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).
Fixes: d975eb8b04087f8606d8 (2021-04-26, "v7a: run: make the SSH forwarding port multiprocess-compatible")
Reported-by: Jürgen Borleis <jbe@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
v2: rebase after Holger's typo fix, improve log message
---
configs/platform-v7a/run | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index c1297bbf5537..8de9c13ee8fc 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -39,7 +39,7 @@ fi
# 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.30.2
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [DistroKit] [PATCH v2] v7a: run: really constrain the forwarded SSH port to <= 64000
2021-11-25 15:22 ` [DistroKit] [PATCH v2] " Roland Hieber
@ 2021-11-25 16:14 ` Robert Schwebel
0 siblings, 0 replies; 4+ messages in thread
From: Robert Schwebel @ 2021-11-25 16:14 UTC (permalink / raw)
To: Roland Hieber; +Cc: distrokit, Jürgen Borleis
On Thu, Nov 25, 2021 at 04:22:19PM +0100, Roland Hieber 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).
>
> Fixes: d975eb8b04087f8606d8 (2021-04-26, "v7a: run: make the SSH forwarding port multiprocess-compatible")
> Reported-by: Jürgen Borleis <jbe@pengutronix.de>
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
> v2: rebase after Holger's typo fix, improve log message
> ---
> configs/platform-v7a/run | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
> index c1297bbf5537..8de9c13ee8fc 100755
> --- a/configs/platform-v7a/run
> +++ b/configs/platform-v7a/run
> @@ -39,7 +39,7 @@ fi
> # 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.30.2
Thanks, applied for next.
rsc
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-11-25 16:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 10:14 [DistroKit] [PATCH] v7a: run: really constrain the forwarded SSH port to <= 64000 Roland Hieber
2021-11-24 14:57 ` Robert Schwebel
2021-11-25 15:22 ` [DistroKit] [PATCH v2] " Roland Hieber
2021-11-25 16:14 ` Robert Schwebel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox