Random files in filesystem

Hi,

I am facing a strange issue on my router. There exist a number of random, empty files in "/" of my filesystem:

root@OpenWrt:/# ll
-rw-r--r--    1 root     root             0 Jan 13 12:23 %�%%
-rw-r--r--    1 root     root             0 Jan 18 09:39 --------------------------------------------------
-rw-r--r--    1 root     root             0 Jan 18 09:39 -----------------------------------------------------
drwxr-xr-x    1 root     root             0 Jan 18 09:40 ./
drwxr-xr-x    1 root     root             0 Jan 18 09:40 ../
-rw-r--r--    1 root     root             0 Jan 18 09:40 2
-rw-r--r--    1 root     root             0 Jan 18 09:39 ===
-rw-r--r--    1 root     root             0 Jan 13 11:18 @����h:
-rw-r--r--    1 root     root             0 Jan 18 09:39 OpenWrt-8devices
-rw-r--r--    1 root     root             0 Jan 18 09:39 Please
-rw-r--r--    1 root     root             0 Jan 18 09:39 There
-rw-r--r--    1 root     root             0 Jan 18 09:39 Use
-rw-r--r--    1 root     root             0 Jan 18 09:39 [
-rw-r--r--    1 root     root             0 Jan 18 09:39 _______
drwxr-xr-x    1 root     root             0 Jan 18 09:39 bin/
drwxr-xr-x    4 root     root          1960 Jan 12 15:03 dev/
drwxr-xr-x    1 root     root             0 Apr 23  2020 etc/
-rw-r--r--    1 root     root             0 Jan 18 09:39 in
drwxr-xr-x    1 root     root             0 Apr 23  2020 lib/
drwxr-xr-x    2 root     root             3 Apr 23  2020 mnt/
-rw-r--r--    1 root     root             0 Jan 14 14:22 not
drwxr-xr-x    5 root     root             0 Jan  1  1970 overlay/
dr-xr-xr-x   83 root     root             0 Jan  1  1970 proc/
drwxr-xr-x   16 root     root           235 Apr 23  2020 rom/
drwxr-xr-x    2 root     root             3 Apr 23  2020 root/
drwxrwxr-x    2 root     root           842 Apr 23  2020 sbin/
dr-xr-xr-x   11 root     root             0 Jan  1  1970 sys/
drwxrwxrwt   15 root     root           400 Jan 12 15:03 tmp/
drwxr-xr-x    1 root     root             0 Apr 23  2020 usr/
lrwxrwxrwx    1 root     root             3 Apr 23  2020 var -> tmp/
drwxr-xr-x    1 root     root             0 Apr 23  2020 www/
-rw-r--r--    1 root     root             0 Jan 13 11:16 yAyyAy^@^@^@^@^@^@^@^@^@^@^B^@^@^@^@^@^@^B�^A1^A9^A1^A9^Ay^Aq^AQ^Ap^A^P^@^P^A^
-rw-r--r--    1 root     root             0 Jan 15 16:38 �z���Q4
-rw-r--r--    1 root     root             0 Jan 14 14:22 �
-rw-r--r--    1 root     root             0 Jan 14 14:22 �͡遹C:Խ���{=�������^^��^]�_I�N^H�N^H��^H�N8��
-rw-r--r--    1 root     root             0 Jan 14 14:22 ��
-rw-r--r--    1 root     root             0 Jan 18 09:39 �4089]
-rw-r--r--    1 root     root             0 Jan 18 09:32 �
-rw-r--r--    1 root     root             0 Jan 13 13:02 �
-rw-r--r--    1 root     root             0 Jan 14 14:22 ��͡適C
-rw-r--r--    1 root     root             0 Jan 13 12:23 �
-rw-r--r--    1 root     root             0 Jan 13 12:23 ���
-rw-r--r--    1 root     root             0 Jan 13 12:23 ���bB
-rw-r--r--    1 root     root             0 Jan 13 12:23 ���b��
-rw-r--r--    1 root     root             0 Jan 15 15:05 �����8��~C
root@OpenWrt:/# 

The number of such files is growing.

This happened on more than one device now. Has anyone seen this before? Also, on the devices where this happened I was using also a serial connection to the device sometimes, so there might be a relation.

At some point, the router refused to boot at all with this:

[   12.148054] procd: - early -
[   12.148194] procd: - watchdog -
[   12.804445] procd: - watchdog -
[   12.809308] procd: - ubus -
[   12.870984] urandom_read: 5 callbacks suppressed
[   12.870994] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.862271] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.863327] procd: - init -
Please press Enter to activate this console.
[   14.910849] random: crng init done

Failed to execute /usr/libexec/login enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
Please press Enter to activate this console.

Failed to execute /usr/libexec/login.sh
Please press Enter to activate this console.

This might have been caused by the weirdness in the filesystem.

I am using this device:

Any ideas what this could be?

Thanks a lot!

corrupted storage ?

in my case that kind of garbage can happen if I accidently run a command and the paste buffer contains something else than I was expecting :slight_smile:

suddenly mkdir abc becomes mkdir Hello my name is Jürgen . I am from from Greenland ..
and I now have at least 10 unwanted dirs.

3 Likes

That's kind of funny :smiley:

Well, it's clearly not me typing/pasting this stuff and then wondering where it comes from. Some of the characters are non ASCII, so I wonder how I could potentially type them. Looks more like leaked file contents. They seem to be created in "bursts" at specific timestamps, e.g. see Jan 12:23. When I use the router I am not even creating files - mostly just inspecting or altering existing files.

Also, I use serial consoles and command line interfaces professionally since quite some time and this has never happened to me. And now it only happens on this router - it is very unlikely that it is me accidentally typing/pasting weird stuff constantly over several days :wink:

Try reflashing from scratch to completely overwrite your filesystem. If that solves it great. If it doesn't solve it then ...

Such random files could be caused by a single instance of pasting in garbage, perhaps when you didn't realize a terminal window was active and were trying to paste into the OpenWrt forum or into another document? It happens...

1 Like

I already re-flashed a couple of times and files of that sort start to appear again after a while - on two different devices. Also, looking at the timestamps the files are not created just once.

Is your serial cable good. If you have bad serial transmission or random short shoering of TX an RX you might end up wit a stream of commands that could generate files. (It's quite easy to generate a file on. All that has to happen is that you get a '>', some random characters and a newline in the input. (even if what comes before is not a valid command, the file redirection will still work and create an empty file.)

If it happens when you have been using a serial connection, maybe it shorts when you disconnect it, creating these files.

1 Like

Looks to me like a redirect > went wrong.

I would first check if there is anything misconfigured in /etc/rc.local and /root/.profile and any other custom startup script or cron job.

FYI, this turned out to be some hardware induced coupling of TX and RX. When the board was booting, the bootloader output would come back through the RX line to create files.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.