1. 16 May, 2022 1 commit
    • Derek Foreman's avatar
      util: Limit size of wl_map · b19488c7
      Derek Foreman authored
      Since server IDs are basically indistinguishable from really big client
      IDs at many points in the source, it's theoretically possible to overflow
      a map and either overflow server IDs into the client ID space, or grow
      client IDs into the server ID space. This would currently take a massive
      amount of RAM, but the definition of massive changes yearly.
      Prevent this by placing a ridiculous but arbitrary upper bound on the
      number of items we can put in a map: 0xF00000, somewhere over 15 million.
      This should satisfy pathological clients without restriction, but stays
      well clear of the 0xFF000000 transition point between server and client
      IDs. It will still take an improbable amount of RAM to hit this, and a
      client could still exhaust all RAM in this way, but our goal is to prevent
      overflow and undefined behaviour.
      Fixes #224
      Signed-off-by: Derek Foreman's avatarDerek Foreman <derek.foreman@collabora.com>
  2. 11 May, 2022 1 commit
  3. 10 May, 2022 1 commit
  4. 06 May, 2022 1 commit
  5. 05 May, 2022 1 commit
  6. 11 Apr, 2022 2 commits
  7. 05 Apr, 2022 1 commit
    • Olivier Fourdan's avatar
      shm: Close file descriptors not needed · 6c424e9d
      Olivier Fourdan authored and Pekka Paalanen's avatar Pekka Paalanen committed
      Commit 5a981ee8 implemented a fallback path for platforms which do not
      support mremap() such as FreeBSD.
      To do so, the file descriptor for the mmap() is not closed immediately
      but instead kept as long as the pool exists.
      That induces more file descriptors kept open for longer, which in turn
      may cause problems as wl_shm may be using a lot of file descriptors,
      especially with Xwayland which can create a lot of pixmaps on behalf of
      its X11 clients.
      For platforms where mremap() is available, keeping those file
      descriptors opened is a bit of a waste and may cause exhaustion of file
      descriptors sooner that before commit 5a981ee8
      Only keep the mmap() file descriptor open on platforms which do not
      implement mremap()  and close it immediately as before on others.
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Closes: xorg/xserver#1283
  8. 03 Apr, 2022 2 commits
    • Sigrid Solveig Haflínudóttir's avatar
      connection: change clen type in build_cmsg to size_t · 2bcc27ff
      Sigrid Solveig Haflínudóttir authored and Simon Ser's avatar Simon Ser committed
      To avoid implicit conversion since msg_control's type is size_t.
      Signed-off-by: Sigrid Solveig Haflínudóttir's avatarSigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
    • Sigrid Solveig Haflínudóttir's avatar
      connection: fix asan report on sendmsg call · d066c4bd
      Sigrid Solveig Haflínudóttir authored and Simon Ser's avatar Simon Ser committed
      Initialiaze the entire msghdr struct to 0 before use.
      Example of the report fixed with this change:
      ==20035==ERROR: AddressSanitizer: SEGV on unknown address 0x2dad4dbffffa0d (pc 0x0055555c7488 bp 0x007fffffc760 sp 0x007fffffc760 T0)
      ==20035==The signal is caused by a READ memory access.
          #0 0x55555c7488 in read_msghdr(void*, __sanitizer::__sanitizer_msghdr*, long) (/home/ftrvx/w/_/uxn/bin/uxnemu+0x77488)
          #1 0x55555c810c in sendmsg (/home/ftrvx/w/_/uxn/bin/uxnemu+0x7810c)
          #2 0x7ff7f2db20 in wl_connection_flush /home/ftrvx/q/wayland/build/../src/connection.c:315:10
          #3 0x7ff7f2d014 in wl_display_flush /home/ftrvx/q/wayland/build/../src/wayland-client.c:2154:9
          #4 0x7ff7e80bc0  (/lib/libSDL2-2.0.so.0+0x104bc0)
          #5 0x7ff7e523b0  (/lib/libSDL2-2.0.so.0+0xd63b0)
          #6 0x7ff7e534e4  (/lib/libSDL2-2.0.so.0+0xd74e4)
          #7 0x7ff7e535e8  (/lib/libSDL2-2.0.so.0+0xd75e8)
          #8 0x7ff7daad54  (/lib/libSDL2-2.0.so.0+0x2ed54)
          #9 0x7ff7dab130  (/lib/libSDL2-2.0.so.0+0x2f130)
          #10 0x555565bb40 in main /home/ftrvx/w/_/uxn/src/uxnemu.c:519:2
       0x7ff7f62484 in libc_start_main_stage2 /builddir/musl-1.1.24/src/env/__libc_start_main.c:94:2
      AddressSanitizer can not provide additional info.
      SUMMARY: AddressSanitizer: SEGV (/home/ftrvx/w/_/uxn/bin/uxnemu+0x77488) in read_msghdr(void*, __sanitizer::__sanitizer_msghdr*, long)
      Signed-off-by: Sigrid Solveig Haflínudóttir's avatarSigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
  9. 02 Apr, 2022 1 commit
  10. 28 Mar, 2022 2 commits
  11. 25 Mar, 2022 7 commits
  12. 08 Mar, 2022 1 commit
  13. 21 Feb, 2022 1 commit
  14. 05 Feb, 2022 6 commits
  15. 02 Feb, 2022 1 commit
  16. 31 Jan, 2022 1 commit
  17. 10 Jan, 2022 6 commits
  18. 07 Jan, 2022 1 commit
  19. 18 Dec, 2021 1 commit
  20. 12 Dec, 2021 1 commit
  21. 09 Dec, 2021 1 commit