coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

tail Obsolete -0 Crashes

Open sylvestre opened this issue 10 months ago • 3 comments

Component

tail

Description

uutils accepts obsolete tail -0 FILE (NUM=0) and later hits an internal assertion in the “read backwards” path, causing a panic/crash; GNU treats -0 as “print nothing” and exits normally.

Test / Reproduction Steps

seq 1 10000 > file.txt
./target/release/coreutils tail -0 file.txt
  • GNU: prints nothing.
  • uutils: thread 'main' (2925945) panicked at src/uu/tail/src/tail.rs:393:17: assertion left == right failed left: 1 right: 0 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Impact

Reliable local DoS (crash) and GNU-incompatible behavior triggered by obsolete -NUM syntax with NUM=0.

sylvestre avatar Jan 11 '26 21:01 sylvestre

Hi, @sylvestre could I be assigned this issue if that's okay? I'll follow the contribution guidelines and reach out in this thread if I have questions.

dhr412 avatar Jan 12 '26 06:01 dhr412

@dhr412 seems someone got it first :(

anastygnome avatar Jan 13 '26 06:01 anastygnome

it is this pr: https://github.com/uutils/coreutils/pull/10209

sylvestre avatar Jan 18 '26 17:01 sylvestre