<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 - Tablet tools without ABS_Z cause a crash when updating rotation"
href="https://bugs.freedesktop.org/show_bug.cgi?id=104939">104939</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Tablet tools without ABS_Z cause a crash when updating rotation
</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>This affects tablets that are not listed in libwacom, specifically, tablets
where libwacom does not provide the stylus axis information.
On tablet init, we check the event codes. A tablet may have ABS_Z and thus have
rotation. Or it has BTN_TOOL_MOUSE + ABS_TILT_X/Y and thus have rotation. On
init, all axes are marked as 'changed' to ensure we send the data in the first
event. For non-libwacom tablets, the tool has the same bits set as the tablet
provides, so if mouse+tilt is there, we have rotation on all tools. But the
code itself relies on ABS_Z for rotation on all the styli (except mouse/lense).
In the case of Aiptek tablets we do have mouse+tilt but we *don't* have ABS_Z.
If the first tool that comes into proximity is *not* the mouse/lens tool [1],
we try to update the rotation by accessing ABS_Z. This leads to a null-pointer
dereference in tablet_update_artpen_rotation() on the very first event.
See <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1535755">https://bugzilla.redhat.com/show_bug.cgi?id=1535755</a>.
It doesn't matter that the tool never sends the actual events - because all
axes are marked as 'changed' on proximity in, we always access the axis on the
first event and crash.
[1] see also <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Fake BTN_TOOL_PEN on tablets that don't send it"
href="show_bug.cgi?id=104911">Bug 104911</a></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>