Bug 15211 - Segmentation fault in ls -l
Summary: Segmentation fault in ls -l
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 1.35.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-25 13:42 UTC by Dominique Liberda
Modified: 2022-12-25 13:42 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominique Liberda 2022-12-25 13:42:49 UTC
In case of an abnormally high date stored on the fs, busybox's ls -la crashes on trying to display it. I have experienced this when interfacing with an NTFS3 filesystem which has invalid dates stored in some of the file metadata.

```
(gdb) r -la
Starting program: /bin/ls -la
total 2102692
drwxrwxrwx    1 root     root       5804032 Dec 25 12:57 .
drwxr-xr-x    6 root     root          4096 Dec 25 11:17 ..
-rwxr-xr-x    1 root     root             0 Dec 25 00:39 AUTOEXEC.BAT
-rwxr-xr-x    1 root     root             0 Dec 25 00:39 CONFIG.SYS
-r-xr-xr-x    1 root     root             0 Dec 25 00:39 IO.SYS
-rw-r--r--    1 domi     domi        523500 Dec 25 13:31 LegacyUpdate-1.3.exe

Program received signal SIGSEGV, Segmentation fault.
__asctime_r (tm=0x7ffff7ffd4c0 <tm>, buf=0x7ffff7ffdd40 <buf> "Wed May  8 04:52:15 23697") at src/time/asctime_r.c:23
23	src/time/asctime_r.c: No such file or directory.
(gdb) bt
#0  __asctime_r (tm=0x7ffff7ffd4c0 <tm>, 
    buf=0x7ffff7ffdd40 <buf> "Wed May  8 04:52:15 23697")
    at src/time/asctime_r.c:23
#1  0x00005555555d12c1 in ?? ()
#2  0x00007fffffffe898 in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) 
```