Re: Bash regexp parsing would benefit from safe recursion limit

2022-04-08 Thread Dale R. Worley
willi1337 bald writes: > A deeply nested and incorrect regex expression can cause exhaustion of > stack resources, which crashes the bash process. Further, you could construct a deeply nested regex that is correct but would still crash the process. It's hard to define what should happen in a

Re: Bash regexp parsing would benefit from safe recursion limit

2022-03-31 Thread Chet Ramey
On 3/30/22 7:48 PM, Steffen Nurpmeso wrote: Chet Ramey wrote in : |On 3/30/22 11:16 AM, willi1337 bald wrote: |> Bash Version: 5.1 |> Patch Level: 16 |> Release Status: release |> |> Description: |> |> A deeply nested and incorrect regex expression can cause exhaustion of |>

Re: Bash regexp parsing would benefit from safe recursion limit

2022-03-30 Thread Steffen Nurpmeso
Chet Ramey wrote in : |On 3/30/22 11:16 AM, willi1337 bald wrote: |> Bash Version: 5.1 |> Patch Level: 16 |> Release Status: release |> |> Description: |> |> A deeply nested and incorrect regex expression can cause exhaustion of |> stack resources, which crashes the bash process. |

Re: Bash regexp parsing would benefit from safe recursion limit

2022-03-30 Thread Chet Ramey
On 3/30/22 11:16 AM, willi1337 bald wrote: > Bash Version: 5.1 > Patch Level: 16 > Release Status: release > > Description: > > A deeply nested and incorrect regex expression can cause exhaustion of > stack resources, which crashes the bash process. Bash doesn't use it's own regexp engine; it

Re: Bash regexp parsing would benefit from safe recursion limit

2022-03-30 Thread Alex fxmbsw7 Ratchev
On Wed, Mar 30, 2022 at 7:47 PM Martin Schulte wrote: > Hello Willi! > > > Fix: > > Count the stack frames during recursive parsing and emit error before > stack > > resources are entirely consumed. > > What exactly should happen and what is the benefit of this solution? > i guess it wont

Re: Bash regexp parsing would benefit from safe recursion limit

2022-03-30 Thread Martin Schulte
Hello Willi! > Fix: > Count the stack frames during recursive parsing and emit error before stack > resources are entirely consumed. What exactly should happen and what is the benefit of this solution? BTW: I tried trap 'echo "Ohohoh..."; exit 1;' SIGSEGV but the signal wasn't caught (which

Bash regexp parsing would benefit from safe recursion limit

2022-03-30 Thread willi1337 bald
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security uname output: Linux DESKTOP-0TQV3NS 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64