sway/swaybar
Tobias Stoeckmann edcdb5552d common: handle invalid IPC messages
The size of IPC data is stored in an unsigned 32 bit data type within
the IPC message header. In order to terminate the received data with a
nul byte, one additional byte is allocated.

It is not checked if the transmitted size is 2^32 - 1. Adding one more
byte would overflow and lead to 0 byte allocation.

On 64 bit systems, the recv call with 2^32 - 1 does not fail instantly
but reads data from the server into unallocated memory.

Prevent override of unallocated memory by aborting communication.

Proof of Concept Python server (use 64 bit address sanitized client):
```
import os
import socket

os.remove('/tmp/sway-poc.socket')
server = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
server.bind('/tmp/sway-poc.socket')
server.listen(1)
print('waiting for client')
(client, address) = server.accept()
client.send(b'\x69\x33\x2D\x69\x70\x63\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF')
input('sent reply, press enter')
client.close()
```
2021-05-07 21:10:03 +02:00
..
tray swaybar: silence missing IconThemePath message 2021-03-17 09:49:04 +01:00
bar.c Make Wayland request listeners static const when possible 2021-02-04 09:49:06 +01:00
config.c Add support for workspace_min_width bar option. 2020-10-11 19:12:42 +02:00
i3bar.c swaybar: fix i3bar relative coordinates when scaling is used 2020-02-10 18:58:09 +01:00
input.c swaybar: Use position from wl_pointer.enter 2021-03-20 11:56:13 +01:00
ipc.c common: handle invalid IPC messages 2021-05-07 21:10:03 +02:00
main.c Make command line option lists const 2021-02-04 09:49:06 +01:00
meson.build build: introduce sd-bus-provider option 2020-12-09 17:39:20 -05:00
render.c swaybar: use text subpixel antialias only where it would look good 2021-03-07 19:18:53 -05:00
status_line.c swaybar: allow status line cleanup to proceed when hidden 2020-07-22 09:40:37 +02:00
swaybar-protocol.7.scd man: update maintainer 2021-01-08 09:33:51 +01:00