<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="https://forum.yubico.com/feed.php?f=23&amp;t=1111" />

<title>Yubico Forum</title>
<subtitle>...visit our web-store at</subtitle>
<link href="https://forum.yubico.com/index.php" />
<updated>2013-07-17T20:09:46+01:00</updated>

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=23&amp;t=1111</id>
<entry>
<author><name><![CDATA[coventry]]></name></author>
<updated>2013-07-17T20:09:46+01:00</updated>
<published>2013-07-17T20:09:46+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=1111&amp;p=4140#p4140</id>
<link href="https://forum.yubico.com/viewtopic.php?t=1111&amp;p=4140#p4140"/>
<title type="html"><![CDATA[Multiple udev events triggered by (un)plugging yubikey]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=1111&amp;p=4140#p4140"><![CDATA[
On Ubuntu 13.04, when I plug or unplug my yubikey, &quot;udevadm monitor --udev&quot; reports multiple interleaved add and remove events.  Is there a way to tell linux/udev not to trigger so many spurious events?  As a result of this behavior, I couldn't directly use a rolling challenge-response to verify my yubikey when deciding whether or not to unlock the screensaver.   (There is <a href="http://forum.yubico.com/viewtopic.php?f=8&amp;t=246" class="postlink">another</a> thread about making the screensaver unlock based on udev events, but the solution posted there does no authentication of the yubikey.)  Using udev to trigger a ykchalresp query to the yubikey on every yubikey &quot;add&quot; results in rapid bursts of many queries, which seems to confuse the yubikey, or some component involved in communicating with it: the challenge-response feature stops working altogether until I turn off the udev trigger and reinsert the yubikey.  I have worked around this by starting a script which attempts a ykchalresp twice a second for as long as the screensaver is locked, and unlocks it when the ykchalresp succeeds.  This works, but is an ugly hack.  Another way would be probably be to do the ykchalresp in a separate service with a rate-limited queue.  But the best way would be to understand why udev triggers so many spurious events, and figure out how to stop it from doing so.<br /><br />For instance, here is the output of udevadm from a single removal and insertion of my yubikey:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">lap% !1244<br />udevadm monitor --udev<br />monitor will print the received events for:<br />UDEV - the event which udev sends out after rule processing<br /> <br />UDEV  &#91;4915.052657&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0006/hidraw/hidraw5 (hidraw)           <br />UDEV  &#91;4915.052960&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0006 (hid)<br />UDEV  &#91;4915.061067&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input13/event13 (input)<br />UDEV  &#91;4915.071103&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input13 (input)<br />UDEV  &#91;4915.071991&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0 (usb)<br />UDEV  &#91;4915.092941&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3 (usb)<br />UDEV  &#91;4918.171340&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3 (usb)<br />UDEV  &#91;4918.174313&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0 (usb)<br />UDEV  &#91;4918.175183&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0007 (hid)<br />UDEV  &#91;4918.176050&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0007/hidraw/hidraw5 (hidraw)<br />UDEV  &#91;4918.177417&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input14 (input)<br />UDEV  &#91;4918.178818&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input14/event13 (input)<br />UDEV  &#91;4918.204409&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0007/hidraw/hidraw5 (hidraw)<br />UDEV  &#91;4918.204989&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0007 (hid)<br />UDEV  &#91;4918.210123&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input14/event13 (input)<br />UDEV  &#91;4918.218750&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input14 (input)<br />UDEV  &#91;4918.297440&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0008 (hid)<br />UDEV  &#91;4918.298128&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0008/hidraw/hidraw5 (hidraw)<br />UDEV  &#91;4918.301475&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input15 (input)<br />UDEV  &#91;4918.303005&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input15/event13 (input)<br />UDEV  &#91;4918.316655&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0008/hidraw/hidraw5 (hidraw)<br />UDEV  &#91;4918.317053&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0008 (hid)<br />UDEV  &#91;4918.317297&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input15/event13 (input)<br />UDEV  &#91;4918.328491&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input15 (input)<br />UDEV  &#91;4918.410927&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0009 (hid)<br />UDEV  &#91;4918.411046&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0009/hidraw/hidraw5 (hidraw)<br />UDEV  &#91;4918.412472&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input16 (input)<br />UDEV  &#91;4918.413134&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input16/event13 (input)<br />UDEV  &#91;4918.432443&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0009/hidraw/hidraw5 (hidraw)<br />UDEV  &#91;4918.432808&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.0009 (hid)<br />UDEV  &#91;4918.436918&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input16/event13 (input)<br />UDEV  &#91;4918.449524&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input16 (input)<br />UDEV  &#91;4918.527890&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.000A (hid)<br />UDEV  &#91;4918.529229&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.000A/hidraw/hidraw5 (hidraw)<br />UDEV  &#91;4918.530323&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input17 (input)<br />UDEV  &#91;4918.532078&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input17/event13 (input)<br />UDEV  &#91;4918.540864&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.000A/hidraw/hidraw5 (hidraw)<br />UDEV  &#91;4918.541241&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.000A (hid)<br />UDEV  &#91;4918.546256&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input17/event13 (input)<br />UDEV  &#91;4918.557313&#93; remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input17 (input)<br />UDEV  &#91;4918.634341&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.000B (hid)<br />UDEV  &#91;4918.635311&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1050:0010.000B/hidraw/hidraw5 (hidraw)<br />UDEV  &#91;4918.636870&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input18 (input)<br />UDEV  &#91;4918.638293&#93; add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/input/input18/event13 (input)</div><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=2348">coventry</a> — Wed Jul 17, 2013 8:09 pm</p><hr />
]]></content>
</entry>
</feed>