{"id":6675,"date":"2015-02-22T15:44:50","date_gmt":"2015-02-22T20:44:50","guid":{"rendered":"http:\/\/esr.ibiblio.org\/?p=6675"},"modified":"2015-02-23T00:16:45","modified_gmt":"2015-02-23T05:16:45","slug":"gpsd-3-12-has-shipped-bulletproofed-from-below","status":"publish","type":"post","link":"http:\/\/esr.ibiblio.org\/?p=6675","title":{"rendered":"GPSD 3.12 has shipped &#8211; bulletproofed from below"},"content":{"rendered":"<p>I&#8217;ve been radio silent the last couple of weeks mainly because I&#8217;ve been concentrating furiously on getting a GPSD release out the door. This one is a little more noteworthy than usual because it may actually have fixed a well-hidden flaw or vulnerability of some significance.  <\/p>\n<p>Regular readers may recall from back in 2013 that I published a heads-up titled <a href=\"http:\/\/esr.ibiblio.org\/?p=4886\">No, GPSD is not the battery-killer on your Android!<\/a> addressing a power-drain bug reported from a handful of Android phones.<\/p>\n<p>I believed at the time that the proximate cause of the bug was in the kernel serial device-drivers somewhere specific to particular hardware on those phones.  I still believe that, because if it had been a purely GPSD problem the error would likely have been much more widespread and I&#8217;d have been flooded with complaints.<\/p>\n<p>However, I&#8217;ve been concerned ever since that GPSD might not have been doing everything it could to armor itself against bugginess in the layers below it.  And a couple of weeks ago I found a problem&#8230;<\/p>\n<p><!--more--><\/p>\n<p>The problem was that the particular combination of options I was using led tty input to be presented to the select loop a character at a time.  Oops!  This is perfect for minimum fix latency but not so good for avoiding power drain &#8211; it means that in the normal course of things the main loop could spin pretty fast.  <\/p>\n<p>I had CPU-usage measurements indicating this hadn&#8217;t been a problem, including on low-power ARM processors like they put in phones. On the other hand, there were those scattered reports of excess power usage.<\/p>\n<p>So I set out to change this, going to blocking I\/O in which data from the device would be accumulated in the kernel tty layer and released to GPSD&#8217;s main loop in bursts, meaning it wouldn&#8217;t spin as often.<\/p>\n<p>That change in itself was not difficult, but it produced some problems in my regression-test framework that took a while to iron out. Nothing difficult, but a lot of fussy detail work.<\/p>\n<p>Result: 3.12 works, it&#8217;s testable, and I think I may have removed the vulnerability that made the battery-eater bug possible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been radio silent the last couple of weeks mainly because I&#8217;ve been concentrating furiously on getting a GPSD release out the door. This one is a little more noteworthy than usual because it may actually have fixed a well-hidden flaw or vulnerability of some significance. Regular readers may recall from back in 2013 that&hellip; <a class=\"more-link\" href=\"http:\/\/esr.ibiblio.org\/?p=6675\">Continue reading <span class=\"screen-reader-text\">GPSD 3.12 has shipped &#8211; bulletproofed from below<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[32],"class_list":["post-6675","post","type-post","status-publish","format-standard","hentry","category-software","tag-gpsd","entry"],"_links":{"self":[{"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/posts\/6675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6675"}],"version-history":[{"count":2,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/posts\/6675\/revisions"}],"predecessor-version":[{"id":6677,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/posts\/6675\/revisions\/6677"}],"wp:attachment":[{"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6675"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}