<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - libinput context refcounting frees memory early"
href="https://bugs.freedesktop.org/show_bug.cgi?id=91872">91872</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>libinput context refcounting frees memory early
</td>
</tr>
<tr>
<th>Product</th>
<td>Wayland
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>ASSIGNED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>libinput
</td>
</tr>
<tr>
<th>Assignee</th>
<td>wayland-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>peter.hutterer@who-t.net
</td>
</tr></table>
<p>
<div>
<pre>The refcounting on the context itself does not take client-held references in
the child structs into account.
Pseudocode example:
li = libinput_path_create_context(&interface, NULL);
device = libinput_path_add_device(li, "/dev/input/event0");
libinput_device_ref(device);
libinput_unref(li); <--- resources are cleaned up
The device has a refcount of at least 1 on cleanup, the client has access to
the struct and could, in the future, try to call libinput_device_get_context().
However, the libinput context is cleaned up and all devices are removed. The
device the client has a ref to points to a freed memory.
This also affects libinput_device_groups if the device is removed with a ref to
the group still handling. It does not affect seats, since the context always
has a ref to the seat and the bug simply isn't triggered.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>