tgt on arm64 and USE_SIGNALFD

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

 



Hi,

is USE_SIGNALFD meant to be supported on arm64? The check in
bs/util.h[1] is looking for __NR_signalfd, but arm64 only has the
newer __NR_signalfd4[2]:

#if defined(__NR_signalfd) && defined(USE_SIGNALFD)
...
#else
#define __signalfd(fd, mask, flags) (-1)
struct signalfd_siginfo {
};
#endif

Since that #ifdef fails, the signalfd_siginfo struct gets redefined to
be empty, and this is tripping a gcc check later on in usr/bs.c[3]
when gcc thinks something is being written into siginfo which is now
zero bytes long:

struct signalfd_siginfo siginfo[16];
...
ret = read(fd, (char *)siginfo, sizeof(siginfo));

Build:
bs.c: In function ‘bs_sig_request_done’:
bs.c:196:15: error: ‘read’ writing 1 byte into a region of size 0
overflows the destination [-Werror=stringop-overflow=]
  196 |         ret = read(fd, (char *)siginfo, sizeof(siginfo));
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bs.c:193:33: note: destination object ‘siginfo’ of size 0
  193 |         struct signalfd_siginfo siginfo[16];
      |                                 ^~~~~~~

This error happens with -D_FORTIFY_SOURCE=3 and -O of 1 or higher, and
looks like a gcc bug, and a few similar to this have been filed
already[4].


1. https://github.com/fujita/tgt/blob/master/usr/util.h#L106
2. https://github.com/bminor/glibc/blob/f9ac84f92f151e07586c55e14ed628d493a5929d/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h#L255
3. https://github.com/fujita/tgt/blob/master/usr/bs.c#L196
4. https://gcc.gnu.org/bugzilla/buglist.cgi?quicksearch=writing%201%20byte%20into%20a%20region%20of%20size%200





[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux