summaryrefslogtreecommitdiffstats
path: root/src/connection.c
Commit message (Collapse)AuthorAgeFilesLines
* connection: do not abort when dup(fd) failsManuel Stoeckl2019-07-091-2/+6
| | | | | | | | | | | | | Instead, cleanly exit wl_closure_marshal and let the caller handler the error. For wayland-client, the sole calling function will call wl_abort() anyway. For wayland-server, the calling function will cleanly shutdown the client. This change ensures that compositors run with low file descriptor limits or internal leaks need not crash suddenly (and sometimes far from the problem) when space runs out. Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
* connection: fix demarshal of invalid headerPekka Paalanen2019-03-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | The size argument to wl_connection_demarshal() is taken from the message by the caller wl_client_connection_data(), therefore 'size' is untrusted data controllable by a Wayland client. The size should always be at least the header size, otherwise the header is invalid. If the size is smaller than header size, it leads to reading past the end of allocated memory. Furthermore if size is zero, wl_closure_init() changes behaviour and leaves num_arrays uninitialized, leading to access of arbitrary memory. Check that 'size' fits at least the header. The space for arguments is already properly checked. This makes the request_bogus_size test free of errors under Valgrind. Fixes: https://gitlab.freedesktop.org/wayland/wayland/issues/52 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com> Reviewed-by: Simon Ser <contact@emersion.fr>
* Print NULL strings as "nil" in wl_closure_printSimon Ser2019-01-301-1/+4
| | | | | | | Calling printf("%s", NULL) is undefined behaviour. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* connection: Prevent pointer overflow from large lengths.Michal Srb2018-08-171-5/+7
| | | | | | | | | | | | If the remote side sends sufficiently large `length` field, it will overflow the `p` pointer. Technically it is undefined behavior, in practice it makes `p < end`, so the length check passes. Attempts to access the data later causes crashes. This issue manifests only on 32bit systems, but the behavior is undefined everywhere. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Derek Foreman <derek.foreman.samsung@gmail.com>
* connection: Prevent integer overflow in DIV_ROUNDUP.Michal Srb2018-08-171-9/+17
| | | | | | | | | | | | | | | | The DIV_ROUNDUP macro would overflow when trying to round values higher than MAX_UINT32 - (a - 1). The result is 0 after the division. This is potential security issue when demarshalling an array because the length check is performed with the overflowed value, but then the original huge value is stored for later use. The issue was present only on 32bit platforms. The use of size_t in the DIV_ROUNDUP macro already promoted everything to 64 bit size on 64 bit systems. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Derek Foreman <derek.foreman.samsung@gmail.com> Style changes by Derek Foreman
* connection: Fix broken log message when demarshalling short closureDerek Foreman2018-02-151-1/+2
| | | | | | | | | | | | Like the similar wl_log() message further into this function that was fixed in commit 2fc248dc2c877d02694db40aad52180d71373d5a this should be printing the sender_id saved earlier instead of *p. Since p is incremented during the loop it would not only print an incorrect object id, it could read past the end of the array. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* connection: Clear correct args when clearing fds to -1Derek Foreman2018-01-221-2/+5
| | | | | | | | | | | | | | | | commit 52609ddf79a96fee0465006e2c6339a3a5d23a87 was intended to set fds to -1 in the arg list, however it failed to account for version information at the start of signatures. Most noticably, this broke mesa's create_prime_buffer by setting width to -1 instead of the fd, as the width was the argument following the fd, and the version was one byte long. This should close https://bugs.kde.org/show_bug.cgi?id=389200 Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>
* client: Consume file descriptors destined for zombie proxiesDerek Foreman2018-01-091-0/+6
| | | | | | | | | | We need to close file descriptors sent to zombie proxies to avoid leaking them, and perhaps more importantly, to prevent them from being dispatched in events on other objects (since they would previously be left in the buffer and potentially fed to following events destined for live proxies) Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* client: Add WL_MAP_ENTRY_ZOMBIE flagDerek Foreman2017-12-281-2/+11
| | | | | | | | | | | | | | | | Add a new map entry flag to indicate that the object received is valid, but a zombie. Previously this relied on a fixed object pointer, but future patches in this series will have map entries returning either NULL, or a different structure type entirely, for zombie objects. wl_object_is_zombie() now solely uses the new flag to determine whether or not the object is a zombie. [daniels: Extracted from Derek's bespoke-zombie patch as an intermediate step.] Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* client: Add wl_object_is_zombie() helper functionDerek Foreman2017-12-281-1/+9
| | | | | | | | | | | Add a helper function which determines whether or not an object is a zombie. [daniels: Extracted from Derek's bespoke-zombie patch as an intermediate step.] Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* connection: Make wl_closure_destroy() close fds of undispatched closuresDerek Foreman2017-12-271-0/+21
| | | | | | | | | | | | | | When we have a closure that can't be dispatched for some reason, and it contains file descriptors, we must close those descriptors to prevent leaking them. Previous commits ensure that only FDs belonging to this invocation of the closure, i.e. not FDs provided by the client for marshalling, nor FDs which have already been dispatched to either client or server, will be left in the closure by destroy time. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* connection: Clear fds we shouldn't close to -1Derek Foreman2017-12-271-0/+24
| | | | | | | | | | | This initializes all the fd arguments in closures to -1 and clears them back to -1 when they've been dispatched or serialized. This means that any valid fd in a closure is currently libwayland's responsibility to close in the case of an error. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* connection: Refactor out closure allocationDerek Foreman2017-12-271-29/+42
| | | | | | | | | | Moves the common/similar bits into one place. This has a minor functional change - count and message are now initialized immediately, previously they'd only be set if (de)marshal was successful. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* connection: Don't declare a local variable just to takes its sizeDerek Foreman2017-12-271-2/+3
| | | | | | | | We can sizeof the struct type instead of declaring a pointer and taking the size of what it points to. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* connection: Use wl_buffer_size() for all buffer size calculationsDerek Foreman2017-12-041-2/+2
| | | | | | | There were two places where we did the same calculation manually. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* connection: close_fds() should only remove fds it closed from the bufferDerek Foreman2017-12-041-0/+1
| | | | | | | | | | | | All current callers close all fds, so this has gone unnoticed, but if we close less than all fds with close_fds() we leak all the unclosed ones and ruin further event demarshalling. A future patch will close less than the full buffer's worth of fds, so this is now noticed. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* tests: Test wl_message_count_arraysYong Bakos2016-11-101-1/+1
| | | | | | | | | | message-test.c did not cover wl_message_count_arrays, so add one test that specifically tests this method. Note that this exposes wl_message_count_arrays in a private header (wayland-private.h), and removes the `static` modifier of the implementation. Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* connection: Move wl_interface_equal to utilYong Bakos2016-05-111-13/+0
| | | | | | | | | | | | | Move the wl_interface_equal prototype to the top of wayland-private, where it is not buried in the middle of map, connection and closure functions. Move the implementation out of connection and into util. This is a utility function, not specific to connections, and has call sites within connection, wayland-client and wayland-server. Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* connection: remove redundant assignmentMarek Chalupa2016-04-231-1/+0
| | | | | | | | | | | | | | | | the code is something like: if (object == NULL && ...) { object = NULL; return; } first, the object is already NULL, second, the assignment has no effect since we return from the function right away Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* connection: Don't add uninitialized memory as 4 byte alignment paddingJonas Ådahl2016-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | When we are adding padding bytes making our wl_buffer buffer content 4 byte aligned, we are just moving the pointer. Since the buffer is allocated using plain malloc(), this means our padding bytes are effectively uninitialized data, which could be anything previously allocated in the server process. As we'll be sharing this buffer content with arbitrary clients, we are effectively sharing private memory with every client, and even though a well behaving client will discard any such memory, a malicious client may not. Therefor, to avoid any potential missuse of the uninitialized padding memory shared between the server and client, initialize the buffer content to 0, making the padding bytes always 0. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* server: Add an API to get the file descriptor for a clientSung-Jin Park2016-01-191-0/+6
| | | | | | | | | | | | | | | This adds an API to get the file descriptor for a client. The client file descriptor can be used for a wayland compositor to validate a request from a client if there are any additional information provided from the client's file descriptor. For instance, this will be helpful in some linux distributions, in which SELinux or SMACK is enabled. In those environments, each file (including socket) will have each security contexts in its inode as xattr member variable. A wayland compositor can validate a client request by getting the file descriptor of the client and by checking the security contexts associated with the file descriptor. Signed-off-by: Sung-Jin Park <input.hacker@gmail.com>
* server: Calculate remaining data size after a closure is processedJaeyoon Jung2016-01-121-1/+7
| | | | | | | | | | | When processing a closure, data in the connection can be consumed again if the closure itself invokes extra event dispatch. In that case the remaining data size is also altered, so the variable len should be updated after the closure is processed. Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* Use zalloc instead of malloc + memsetJonas Ådahl2016-01-121-2/+2
| | | | | | | Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* add wl_abort private functionMarek Chalupa2015-11-161-15/+7
| | | | | | | | | On many places in the code we use wl_log + abort or wl_log + assert(0). Replace these with one call to wl_abort, so that we don't mix abort(), assert(0) and we'll save few lines Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* src: Update boilerplate from MIT X11 license to MIT Expat licenseBryce Harrington2015-06-121-16/+19
| | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* connection: abort if a listener function is NULLRyo Munakata2014-11-121-0/+5
| | | | | Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* connection: Fix sendmsg() on FreeBSDPhilip Withnall2014-11-051-1/+1
| | | | | | | | | | | | It expects ((msg_controllen == 0) == (msg_control == NULL)), and returns EINVAL otherwise. It can't hurt to be tidy about things on other platforms either though. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=99356#c5 Signed-off-by: Philip Withnall <philip at tecnocode.co.uk> Signed-off-by: Karsten Otto <ottoka at posteo.de> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* connection: Leave fd open in wl_connection_destroyBenjamin Herr2014-11-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling close() on the same file descriptor that a previous call to close() already closed is wrong, and racy if another thread received that same file descriptor as a eg. new socket or actual file. There are two situations where wl_connection_destroy() would close its file descriptor and then another function up in the call chain would close the same file descriptor: * When wl_client_create() fails after calling wl_connection_create(), it will call wl_connection_destroy() before returning. However, its caller will always close the file descriptor if wl_client_create() fails. * wl_display_disconnect() unconditionally closes the display file descriptor and also calls wl_connection_destroy(). So these two seem to expect wl_connection_destroy() to leave the file descriptor open. The other caller of wl_connection_destroy(), wl_client_destroy(), does however expect wl_connection_destroy() to close its file descriptor, alas. This patch changes wl_connection_destroy() to indulge this majority of two callers by simply not closing the file descriptor. For the benefit of wl_client_destroy(), wl_connection_destroy() then returns the unclosed file descriptor so that wl_client_destroy() can close it itself. Since wl_connection_destroy() is a private function called from few places, changing its semantics seemed like the more expedient way to address the double-close() problem than shuffling around the logic in wl_client_create() to somehow enable it to always avoid calling wl_connection_destroy(). Signed-off-by: Benjamin Herr <ben@0x539.de> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* connection: remove unreached codeBoyan Ding2014-06-181-2/+0
|
* connection: fix a format string typo in error messageGiulio Camuffo2014-04-251-1/+1
|
* connection: Don't write past the end of the connection bufferAnder Conselvan de Oliveira2014-04-211-8/+17
| | | | | | | | | | | If a message was too big to fit in the connection buffer, the code in wl_buffer_put would just write past the end of it. I haven't seen any real world use case that would trigger this bug, but it was possible to trigger it by sending a long enough string to the wl_data_source.offer request. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69267
* connection: Use wl_log to report errorsJasper St. Pierre2014-02-181-18/+18
| | | | | | | In some cases, like Xwayland, stdout and stderr are redirected to /dev/null, losing us valuable information, while wl_log can be overridden, allowing us to send it to a log file instead. This can help debugging immensely.
* Fix buffer overflow when serializing a closure object1.3.92chi ding2014-01-091-8/+83
| | | | | | | | | Here is the JIRA page of this issue https://bugs.tizen.org/jira/browse/TIVI-1889 Change-Id: I773a6d2d8f6fd02ff10c92450db1fa8a69544219 Signed-off-by: Chi Ding <chi.ding@mobica.com> Closes: https://bugs.freedesktop.org/show_bug.cgi?id=65186
* connection: Error out if file descriptor was not receivedLubomir Rintel2013-11-211-0/+9
| | | | | | | | Otherwise the tail of fds_in buffer would just shift beyond the beginning. That confuses the actual request handler and results in a crash further on due to corrupted tail. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
* Add support for server-side language bindingsJason Ekstrand2013-08-191-1/+8
| | | | | | | | | | | | | | | | | | This commit adds support for server-side languages bindings. This is done in two ways: 1. Adding a wl_resource_set_dispatcher function that corresponds to wl_resource_set_interface. The only difference between the two functions is that the new version takes a dispatcher along with the implementation, data, and destructor. This allows for runtime calling of native language functions for callbacks instead of having to generate function pointers. 2. Adding versions of wl_resource_post_event and wl_resource_queue_event that take an array of wl_argument instead of a variable argument list. This allows for easier run-time argument conversion and removes the need for libffi-based calling of variadic functions. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* connection: Handle empty signature and signature with just a version.Mariusz Ceier2013-07-121-0/+1
| | | | | | | | | | | | Functions like wl_argument_from_va_list expect from get_next_argument, to initialize details->type but when the signature is empty or contains only version (like in desktop-shell-protocol.c in weston) it is left uninitialized. This patch fixes it, by initializing details->type with '\0' value, signaling end of arguments. Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
* Add version information to wl_message signatures.Jason Ekstrand2013-07-021-12/+43
| | | | | | | | | | | | This commit adds version information to wl_message signatures and a wl_message_get_since function to retrieve. The since version comes in the form of a (possible) integer at the begining of the message. If the message starts with an integer, then it specifies the "since" version of that message. Messages present in version one do not get this "since" information. In this way we can run-time detect the version information for a structure on a per-message basis. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* Add a wl_resource_instance_of functionJason Ekstrand2013-06-211-4/+4
| | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* client: Add wl_display_prepare_read() API to relax thread model assumptionsKristian Høgsberg2013-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current thread model assumes that the application or toolkit will have one thread that either polls the display fd and dispatches events or just dispatches in a loop. Only this main thread will read from the fd while all other threads will block on a pthread condition and expect the main thread to deliver events to them. This turns out to be too restrictive. We can't assume that there always will be a thread like that. Qt QML threaded rendering will block the main thread on a condition that's signaled by a rendering thread after it finishes rendering. This leads to a deadlock when the rendering threads blocks in eglSwapBuffers(), and the main thread is waiting on the condition. Another problematic use case is with games that has a rendering thread for a splash screen while the main thread is busy loading game data or compiling shaders. The main thread isn't responsive and ends up blocking eglSwapBuffers() in the rendering thread. We also can't assume that there will be only one thread polling on the file descriptor. A valid use case is a thread receiving data from a custom wayland interface as well as a device fd or network socket. The thread may want to wait on either events from the wayland interface or data from the fd, in which case it needs to poll on both the wayland display fd and the device/network fd. The solution seems pretty straightforward: just let all threads read from the fd. However, the main-thread restriction was introduced to avoid a race. Simplified, main loops will do something like this: wl_display_dispatch_pending(display); /* Race here if other thread reads from fd and places events * in main eent queue. We go to sleep in poll while sitting on * events that may stall the application if not dispatched. */ poll(fds, nfds, -1); /* Race here if other thread reads and doesn't queue any * events for main queue. wl_display_dispatch() below will block * trying to read from the fd, while other fds in the mainloop * are ignored. */ wl_display_dispatch(display); The restriction that only the main thread can read from the fd avoids these races, but has the problems described above. This patch introduces new API to solve both problems. We add int wl_display_prepare_read(struct wl_display *display); and int wl_display_read_events(struct wl_display *display); wl_display_prepare_read() registers the calling thread as a potential reader of events. Once data is available on the fd, all reader threads must call wl_display_read_events(), at which point one of the threads will read from the fd and distribute the events to event queues. When that is done, all threads return from wl_display_read_events(). From the point of view of a single thread, this ensures that between calling wl_display_prepare_read() and wl_display_read_events(), no other thread will read from the fd and queue events in its event queue. This avoids the race conditions described above, and we avoid relying on any one thread to be available to read events.
* Change wl_closure_invoke to take an opcode instead of an actual function pointerJason Ekstrand2013-03-181-2/+4
| | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* client: Invoke new_id closure arguments as pointers instead of integersJonas Ådahl2013-03-171-5/+11
| | | | | | | | | | | | | | | This commit adds a flags parameter to wl_closure_invoke(). The so far added flags are ment to specify if the invokation is client side or server side. When on the server side, closure arguments of type 'new_id' should be invoked as a integer id while on the client side they should be invoked as a pointer to a proxy object. This fixes a bug happening when the address of a client side 'new_id' proxy object did not fit in a 32 bit integer. krh: Squashed test suite compile fix from Jason Ekstrand. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
* Stylistic nitpickingKristian Høgsberg2013-02-261-5/+5
| | | | No space between '!' and its argument, prefer i++ over ++i.
* Clean up and refactor wl_closure and associated functionsJason Ekstrand2013-02-261-313/+360
| | | | | | | | | | | | | | | | | | | | | | | | | The primary purpose of this patch is to clean up wl_closure and separate closure storage, libffi, and the wire format. To that end, a number of changes have been made: - The maximum number of closure arguments has been changed from a magic number to a #define WL_CLOSURE_MAX_ARGS - A wl_argument union has been added for storing a generalized closure argument and wl_closure has been converted to use wl_argument instead of the combination of libffi, the wire format, and a dummy extra buffer. As of now, the "extra" field in wl_closure should be treated as bulk storage and never direclty referenced outside of wl_connection_demarshal. - Everything having to do with libffi has been moved into wl_closure_invoke and the convert_arguments_to_ffi helper function. - Everything having to do with the wire format has been restricted to wl_connection_demarshal and the new static serialize_closure function. The wl_closure_send and wl_closure_queue functions are now light wrappers around serialize_closure. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* connection.c: Align pointer extra storage correctlyKristian Høgsberg2013-02-041-4/+18
| | | | | | Most extra data are just pointers, but in case of fds we store an int in the extra space. That can cause un-aligned access to pointers on 64 bit architectures. Make sure we always align pointer storage correctly.
* connection: Dereference id completely for comparasion.John Kåre Alsaker2012-10-161-2/+2
|
* connection: Removed crashing code.John Kåre Alsaker2012-10-161-2/+0
|
* connection: Don't call memcpy with null pointer.John Kåre Alsaker2012-10-161-3/+3
|
* connection: return error on buffer-overflow during readKristian Høgsberg2012-10-151-0/+5
| | | | | | | | | | | | | | wl_connection_read() assumes that the caller dispatched all messages before calling it. wl_buffer_put_iov() does only provide enough room so we fill the buffer. So the only case when the buffer overflows, is when a previous read filled up the buffer but we couldn't parse a single message from it. In this case, the client sent a message bigger than our buffer and we should return an error and close the connection. krh: Edited from Davids original patch to just check that the buffer isn't full before we try reading into it. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
* connection: Use uin32_t for circular buffer indexesKristian Høgsberg2012-10-151-6/+6
| | | | | | We rely on well-defined unsigned overflow behaviour so let's make the index fields actually unsigned. Signed ints aren't guaranteed to have the behavior we want (could be either ones or twos complement).
* connection: fix leaking FDs on buffer-overflow during readDavid Herrmann2012-10-151-7/+26
| | | | | | | | If we read more FDs than we have room for, we currently leak FDs because we overwrite previous still pending FDs. Instead, we do now close incoming FDs if the buffer is full and return EOVERFLOW. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>