bug#78879: Potential Out-of-Memory in coreutils od

2025-06-24 Thread Jaehoon Jang
I think your argument makes sense, and I now understand your perspective as well. But whatever arbitrary limits we impose, there could be problems with > people who need to go over those limits. I especially agree with this point, so it's reasonable not to address the issue related to -w with an

bug#78879: Potential Out-of-Memory in coreutils od

2025-06-24 Thread Paul Eggert
On 2025-06-23 01:21, Jaehoon Jang wrote: This happens because the parsed -w value is passed to bytes_per_block, which is then used in a call to xnmalloc, leading to potentially dangerous memory allocation. "Dangerous" in the sense that if you give "od" a large task it needs a lot of RAM? If so

bug#78879: Potential Out-of-Memory in coreutils od

2025-06-24 Thread Jaehoon Jang
> "Dangerous" in the sense that if you give "od" a large task it needs a > lot of RAM? If so, most nontrivial programs are "dangerous". While it’s true that many programs may allocate large memory for large inputs, well-designed software validates user input to prevent pathological or abusive case

bug#78879: Potential Out-of-Memory in coreutils od

2025-06-24 Thread Paul Eggert
On 2025-06-24 06:03, Jaehoon Jang wrote: The issue here is not that "od" performs a large task, but that it allows unbounded, unchecked memory allocation from a single user-supplied argument, with no upper bound or safety net, leading to potential denial-of-service. The memory allocation *is*

bug#78879: Potential Out-of-Memory in coreutils od

2025-06-24 Thread Pádraig Brady
On 24/06/2025 16:29, Philip Rowlands wrote: Small typo in + 'od -w foo' will now issue a diagnostic an exit. Cool, I'd already changed that locally to: 'od -w0' will now issue a diagnostic and exit gracefully. Marking this bug done. thanks! Padraig

bug#78879: Potential Out-of-Memory in coreutils od

2025-06-24 Thread Philip Rowlands
Small typo in + 'od -w foo' will now issue a diagnostic an exit. Cheers, Phil

bug#78879: Potential Out-of-Memory in coreutils od

2025-06-24 Thread Pádraig Brady
On 23/06/2025 09:21, Jaehoon Jang wrote: Potential Out-of-Memory Risk in coreutils od Due to Inadequate Argument Validation for -w Option *Description* ``` $ src/od -w0 /bin/ls Aborted ``` Well we shouldn't be aborting at least. The attached patch should avoid that. thanks, Padraig From 7778

bug#78879: Potential Out-of-Memory in coreutils od

2025-06-23 Thread Jaehoon Jang
Potential Out-of-Memory Risk in coreutils od Due to Inadequate Argument Validation for -w Option *Description* ``` $ src/od -w0 /bin/ls Aborted ``` ``` 1835if (s_err != LONGINT_OK || w_tmp <= 0) 1836xstrtol_fatal (s_err, oi, c, long_options, optarg); ``` We confirmed that when the arg