Re: [PATCH] Mdmonitor: Fix segfault and improve logging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Paul,


I've tried to reproduce it with mdadm 4.1 and mdadm 4.2 and both apps exit with

segmentation fault. This patch is not a fix, it adds checking if device is md array.

It hasn't been checked before in mdmonitor, so segmentation fault should appear.


Regards,

Kinga


On 3/23/2022 11:31 AM, Paul Menzel wrote:
Dear Kinga,


Am 23.03.22 um 10:02 schrieb Tanska, Kinga:

I will send splitted patches in next messages.

Thank you.

There are steps to reproduce:

1. Stop mdmonitor instance e.g.

# systemctl stop mdmonitor

2. Run mdmonitor for non-md device e.g.

# mdadm --monitor /dev/nvme1n1


Call trace:

#0  0x00007ffff7617518 in __strcpy_sse2_unaligned () from /usr/lib64/libc.so.6
#1  0x000000000042bc9e in check_array ()
#2  0x000000000042c7af in Monitor ()
#3  0x0000000000406edc in main ()

I am unable to reproduce it with mdadm 4.1:

    $ sudo strace mdadm --monitor /dev/sda
    execve("/usr/bin/mdadm", ["mdadm", "--monitor", "/dev/sda"], 0x7ffc8b00e880 /* 14 vars */) = 0
    […]
    openat(AT_FDCWD, "/dev/sda", O_RDONLY)  = 3
fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(0x8, 0), ...}) = 0
readlink("/sys/dev/block/8:0", "../../devices/pci0000:00/0000:00"..., 199) = 91
    close(3)                                = 0
    pselect6(1, NULL, NULL, [], {tv_sec=1000, tv_nsec=0}, NULL) = ? ERESTARTNOHAND (To be restarted if no handler)
    --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
    pselect6(1, NULL, NULL, [], {tv_sec=999, tv_nsec=568020697}, NULL) = ? ERESTARTNOHAND (To be restarted if no handler)
    --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
pselect6(1, NULL, NULL, [], {tv_sec=999, tv_nsec=521836826}, NULL

Did a specific commit introduce the problem? If so, it’d be great if you added a Fixes line.

[…]


Kind regards,

Paul



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux