You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"ufs-utils list_bsg" crashes on 32-bit platforms. e.g. x86, arm.
On x86 platform:
root@qemux86:~# ufs-utils list_bsg
free(): invalid pointer
Aborted
On arm platform:
root@qemuarm:~# ufs-utils list_bsg
Directory cannot be opened!: No such file or directory
Directory cannot be opened!: No such file or directory
corrupted size vs. prev_size
Aborted
There is no such issue on x86-64 platform:
root@qemux86-64:~# ufs-utils list_bsg
Didn't found UFS BSG device
After some investigation I found that the crash occurs in the find_bsg_device() function in ufs_cmds.c.
I put this function into a test file, compiled and ran it, and had the same issue. Please see the attached test.c.
On x86 platform:
root@qemux86:# gcc -o test test.c
root@qemux86:# ./test
/dev/cpu
/dev/cpu/0
/dev/cpu/1
/dev/cpu/2
/dev/cpu/3
/dev/dri
/dev/dri/by-path
/dev/bus
/dev/bus/usb
/dev/bus/usb/001
free(): invalid pointer
Aborted
root@qemux86:~#
On arm platform:
root@qemuarm:# gcc -o test test.c
root@qemuarm:# ./test
/dev/dri
/dev/dri/by-path
/dev/bus
/dev/bus/usb
/dev/bus/usb)�/001
Directory cannot be opened!: No such file or directory
/dev/bus/usb)�/002
Directory cannot be opened!: No such file or directory
/dev/mapper
/dev/input
/dev/input/by-id
/dev/input/by-path
/dev/pts
/dev/shm
/dev/char
/dev/block
/dev/disk
/dev/disk/by-diskseq
corrupted size vs. prev_size
Aborted
ufs-utils version: 4.13.5 and latest git rev
"ufs-utils list_bsg" crashes on 32-bit platforms. e.g. x86, arm.
On x86 platform:
root@qemux86:~# ufs-utils list_bsg
free(): invalid pointer
Aborted
On arm platform:
root@qemuarm:~# ufs-utils list_bsg
Directory cannot be opened!: No such file or directory
Directory cannot be opened!: No such file or directory
corrupted size vs. prev_size
Aborted
There is no such issue on x86-64 platform:
root@qemux86-64:~# ufs-utils list_bsg
Didn't found UFS BSG device
After some investigation I found that the crash occurs in the find_bsg_device() function in ufs_cmds.c.
I put this function into a test file, compiled and ran it, and had the same issue. Please see the attached test.c.
On x86 platform:
root@qemux86:
# gcc -o test test.c# ./testroot@qemux86:
/dev/cpu
/dev/cpu/0
/dev/cpu/1
/dev/cpu/2
/dev/cpu/3
/dev/dri
/dev/dri/by-path
/dev/bus
/dev/bus/usb
/dev/bus/usb/001
free(): invalid pointer
Aborted
root@qemux86:~#
On arm platform:
root@qemuarm:
# gcc -o test test.c# ./testroot@qemuarm:
/dev/dri
/dev/dri/by-path
/dev/bus
/dev/bus/usb
/dev/bus/usb)�/001
Directory cannot be opened!: No such file or directory
/dev/bus/usb)�/002
Directory cannot be opened!: No such file or directory
/dev/mapper
/dev/input
/dev/input/by-id
/dev/input/by-path
/dev/pts
/dev/shm
/dev/char
/dev/block
/dev/disk
/dev/disk/by-diskseq
corrupted size vs. prev_size
Aborted
test.c
The text was updated successfully, but these errors were encountered: