<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Observations from Uppsala &#187; security</title>
	<atom:link href="http://jakob.engbloms.se/archives/category/security/feed" rel="self" type="application/rss+xml" />
	<link>http://jakob.engbloms.se</link>
	<description>Computer Technology: Simulation, Virtualization, Virtual Platforms, Embedded, Multicore and Multiprocessing (by Jakob Engblom)</description>
	<lastBuildDate>Sun, 29 Jan 2012 19:45:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<image>
    <title>Observations from Uppsala</title>
    <url>http://jakob.engbloms.se/favicon.png</url>
    <link>http://jakob.engbloms.se</link>
    <width>32</width>
    <height>32</height>
    <description>Observations from Uppsala - http://jakob.engbloms.se</description>
    </image>		<item>
		<title>SecurityNow on Randomness</title>
		<link>http://jakob.engbloms.se/archives/1424?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1424#comments</comments>
		<pubDate>Wed, 25 May 2011 20:20:23 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[computer architecture]]></category>
		<category><![CDATA[multicore computer architecture]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[random number generation]]></category>
		<category><![CDATA[SecurityNow]]></category>
		<category><![CDATA[Steve Gibson]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1424</guid>
		<description><![CDATA[Episodes 299 and 301 of the SecurityNow podcast deal with the problem of how to get randomness out of a computer. As usual, Steve Gibson does a good job of explaining things, but I felt that there was some more that needed to be said about computers and randomness, as well as the related ideas [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2011/02/dice.png"><img class="alignleft size-full wp-image-1371" title="dice" src="http://jakob.engbloms.se/wp-content/uploads/2011/02/dice.png" alt="" width="86" height="88" /></a>Episodes <a href="http://twit.tv/sn299">299 </a>and <a href="http://twit.tv/sn301">301 </a>of the SecurityNow podcast deal with the problem of how to get randomness out of a computer. As usual, Steve Gibson does a good job of explaining things, but I felt that there was some more that needed to be said about computers and randomness, as well as the related ideas of predictability, observability, repeatability, and determinism. I have worked and wrangled with these concepts for almost 15 years now, from my research into timing prediction for embedded processors to my current work with the repeatable and reversible Simics simulator.</p>
<p><span id="more-1424"></span>Let&#8217;s start from the top.</p>
<p>When Steve said that computers are deterministic, I jumped. To me, a computer is anything but deterministic. The idea that rerunning a program does the same thing is an ideal state that you can rarely reach, and having an infrastructure like Simics that <a href="http://blogs.windriver.com/engblom/2010/09/deterministic-but-unpredictable.html">helps you achieve this </a>is huge win for debugging.</p>
<p>Listening closely, what I think Steve <em>really </em>said is that an algorithm like a random number generator is deterministic. If you know its initial state, it will always compute the same result. That is indeed true for code that just converts an input into an output, and does no communication and is not dependent on time or timing. My experience in random and nondeterministic behavior comes from programs that feature multiple threads and often multiple processes, and plenty of asynchronous activity going on. So, same word, different contexts.</p>
<p>However, Steve also several times talk about computers as being deterministic predictable machines. I think that characterizing today&#8217;s computers as being deterministic is untrue. I would rather say that with multiple cores and multiple chips and timing variations all over the place, a computer has become fundamentally <em>nondeterministic </em>and non-repeatable, since there are so many little things going on where a nanosecond difference in time can cause behavior to diverge incredibly quickly. There is a nice paper from 2003 about the divergent behavior from minor differences, &#8220;<a href="http://portal.acm.org/citation.cfm?id=822813">Variability in Architectural Simulations of Multi-threaded Workloads</a>&#8220;, by Alaa R. Alameldeen and David A. Wood.</p>
<p>The <a href="http://jakob.engbloms.se/archives/1374">HAVEGE program I wrote about a while back </a>is essentially an attempt to harness the fundamental unpredictability of modern hardware timing. Nice idea, which at least in theory fulfills the more important property for security of being <em>unobservable</em>. Security doesn&#8217;t really need &#8220;real&#8221; randomness, all you need is something that an attacker cannot predict or observe. The classic <a href="http://www.cs.berkeley.edu/~daw/papers/ddj-netscape.html">Netscape SSL lack-of-randomness in the random seed</a> issue from 1996 is the best illustration of this. Certain things about a target can be inferred or observed, but the low-level hardware timing is not one of them, at least not for an x86 or high-end ARM class machine.</p>
<p>The solution that Steve prefers are the Yarrow and <a href="http://en.wikipedia.org/wiki/Fortuna_%28PRNG%29">Fortuna </a>algorithms that collect randomness from the environment of a computer and uses that as a seed to a normal random number generator, creating lots of useful random data from a fairly small seed. This is the same idea as HAVEGE, but with a different entropy source. In both cases the basic idea seems sound and reasonable, but I kind of hoped that Steve would know of some way to evaluate the quality of the entropy pool generated from hardware events.</p>
<p><a href="http://www.grc.com/sn/sn-301.htm">Steve mentioned </a>the NIST randomness test that was used to test HAVEGE. It is certainly an aggressive test, but <a href="http://jakob.engbloms.se/archives/1374">as my testing showed</a>,  it only demonstrates that a random number generator is random in the data  produced. It does not show that it is unpredictable, and it does not measure the benefit gained from using  unobservable local events in hardware as the source of entropy. You need something  else, like comparing repeated collections of randomness over time from  the same system, to build confidence in unobservable and unpredictable  randomness.</p>
<p>With a computer, you do have such a thing as repeatable,  deterministic, and thus predictable randomness. In a modern desktop or server computer, you also have tons of totally unpredictable non-repeatable non-usefully-observable randomness in the low-level hardware timing and concurrent behavior of independent hardware units. Too bad it seems hard to prove this by measurement.</p>
<p>For yet more randomness discussion, especially randomness in embedded systems, I recommend the <a href="http://secworks.se/2011/03/om-slumptal-och-entropikallan-haveged/">blog post </a>by Joachim Strömbergsson. (it is in Swedish).</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1424"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1424" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1424" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1424/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Evaluating HAVEGE Randomness</title>
		<link>http://jakob.engbloms.se/archives/1374?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1374#comments</comments>
		<pubDate>Thu, 17 Feb 2011 21:33:14 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[computer architecture]]></category>
		<category><![CDATA[computer simulation technology]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[evaluation methodology]]></category>
		<category><![CDATA[HAVEGE]]></category>
		<category><![CDATA[random number generation]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1374</guid>
		<description><![CDATA[I previously blogged about the HAVEGE algorithm that is billed as extracting randomness from microarchitectural variations in modern processors. Since it was supposed to rely on hardware timing variations, I wondered what would happen if I ran it on Simics that does not model the processor pipeline, caches, and branch predictor. Wouldn&#8217;t that make the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2011/02/dice.png"><img class="alignleft size-full wp-image-1371" title="dice" src="http://jakob.engbloms.se/wp-content/uploads/2011/02/dice.png" alt="" width="86" height="88" /></a>I previously blogged about the <a href="http://jakob.engbloms.se/archives/1370">HAVEGE algorithm </a>that is billed as extracting randomness from microarchitectural variations in modern processors. Since it was supposed to rely on hardware timing variations, I wondered what would happen if I ran it on Simics that does not model the processor pipeline, caches, and branch predictor. Wouldn&#8217;t that make the randomness of HAVEGE go away?</p>
<p><span id="more-1374"></span>I got HAVEGE up on a Simics x86 target model with Linux pretty quickly, and ran the two provided tests. <em>Ent</em>, which is a quick entropy test, and <em>nist</em> which supposedly much more thorough.</p>
<p>To my surprise, they both said the randomness we got was totally acceptable. This would seem to invalidate the fundamental assumption of HAVEGE &#8211; that it needs to collect randomness from hardware in order to produce good-quality randomness. To try to understand a bit more of what was going on, I took at look at the execution using <a href="http://blogs.windriver.com/engblom/2010/05/analyzed.html">Simics Analyzer</a> (the dredd.motherboard.processor lines are the processors, and the orange part is the HAVEGE program, yellow is the kernel):</p>
<p><a href="http://jakob.engbloms.se/wp-content/uploads/2011/02/OS-scheduler-messing-with-haveged.png"><img class="aligncenter size-medium wp-image-1377" title="OS scheduler messing with haveged" src="http://jakob.engbloms.se/wp-content/uploads/2011/02/OS-scheduler-messing-with-haveged-300x128.png" alt="" width="300" height="128" /></a></p>
<p>Zooming in a bit:</p>
<p><a href="http://jakob.engbloms.se/wp-content/uploads/2011/02/OS-scheduler-messing-with-haveged-closer-look.png"><img class="aligncenter size-medium wp-image-1378" title="OS scheduler messing with haveged closer look" src="http://jakob.engbloms.se/wp-content/uploads/2011/02/OS-scheduler-messing-with-haveged-closer-look-300x128.png" alt="" width="300" height="128" /></a>We can see that the program is regularly interrupted by the OS, which could be  a reason for random timing variations. The instructions run by the OS should vary in count, which would disturb the time stamp counter values read by the HAVEGE program. That could be sufficient to cause random variations, essentially showing that HAVEGE really works well just from OS noise &#8211; even in an otherwise idle machine.</p>
<p>However, at this point I started to have my doubts. Something did not feel right.</p>
<p>So I tried to remove all variations from the HAVEGE program. I replaced the &#8220;HARDTICKS&#8221; macro in HAVEGE with the constant 0 (zero) rather than reading the time stamp counter of the processor. This immediately failed the randomness test.</p>
<p>However, when I used the constant 1 (one) instead, the <em>ent </em>test passed. And even <em>nist </em>almost passed with only a single missed test out of the 426 tests executed.</p>
<p>Thus, the conclusion is that we do not know how well HAVEGE &#8216;s collection of hardware randomness works, since the evaluation software is too weak. In essence, we do not know if the collection of hardware randomness matters or not, as the proposed measurement hides the randomness behind a pretty good PRNG algorithm.</p>
<p>Ideally, we would need a measurement that would evaluate the predictability of the randomness generated. Or at least one that can correctly estimate the impact of the variation of low-level hardware timing on the quality of the final random numbers. Unfortunately, that is not the case here, throwing the entire idea into doubt.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1374"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1374" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1374" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1374/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Execution Time is Random, How Useful</title>
		<link>http://jakob.engbloms.se/archives/1370?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1370#comments</comments>
		<pubDate>Sun, 13 Feb 2011 21:49:18 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[computer architecture]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Andre Szenec]]></category>
		<category><![CDATA[HAVEG]]></category>
		<category><![CDATA[HAVEGE]]></category>
		<category><![CDATA[random number generation]]></category>
		<category><![CDATA[wcet]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1370</guid>
		<description><![CDATA[When I was working on my PhD in WCET &#8211; Worst-Case Execution Time analysis - our goal was to utterly precisely predict the precise number of cycles that a processor would take to execute a certain piece of code.  We and other groups designed analyses for caches, pipelines, even branch predictors, and ways to take [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2011/02/dice.png"><img class="alignleft size-full wp-image-1371" title="dice" src="http://jakob.engbloms.se/wp-content/uploads/2011/02/dice.png" alt="" width="86" height="88" /></a>When I was working on my <a href="http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-1832">PhD in WCET &#8211; Worst-Case Execution Time analysis </a>- our goal was to utterly precisely predict the precise number of cycles that a processor would take to execute a certain piece of code.  We and other groups designed analyses for caches, pipelines, even branch predictors, and ways to take into account information about program flow and variable values.</p>
<p>The complexity of modern processors &#8211; even a decade ago &#8211; was such that predictability was very difficult to achieve in practice. We used to joke that a complex enough processor would be like a random number generator.</p>
<p>Funnily enough, it turns out that someone has been using processors just like that.  Guess that proves the point, in some way.</p>
<p><span id="more-1370"></span>I was recently introduced to the concept of the <a href="http://www.irisa.fr/caps/projects/hipsor/">HAVEGE project &#8211; HArdware Volatile Entropy Gathering and Expansion</a>, run at IRISA in Rennes in France from what seems to be around 2002 to 2006.  The main author, Andre Seznec, has also published in the WCET field. Today, the same idea is found nicely packaged in the HAVEGED code base for Linux, found at <a href="http://www.issihosts.com/haveged">http://www.issihosts.com/haveged</a>.</p>
<p>The idea behind HAVEGE is to run a piece of code that is designed to incur cache misses, confuse branch predictors, and generally strain the prediction mechanisms of a processor. In this way, the timing of the code will fluctuate even though it is basically straight-line code with no decision-making. These timing variations can be captured by reading a high-resolution timer such as the x86 processor&#8217;s <a href="http://en.wikipedia.org/wiki/Rdtsc">TSC (Time Stamp Counter), </a>or some other source that can report the execution time of a piece of code.</p>
<p>The key advantage of such a source of randomness is that it is easy to quickly acquire lots of randomness (or <a href="http://en.wikipedia.org/wiki/Entropy_%28computing%29">entropy in crypto language</a>), and it is also impossible to predict the results. For cryptographic applications, this unpredictability from the perspective of an outside observer is very important, as it makes random numbers generated based on this much stronger in the face of an attack.</p>
<p>I think HAVEGE offers a good example of how to make lemonade from lemons.  If we conclude that processor timing cannot be predicted, consider that fact as a feature for cryptography rather than as a problem for WCET.</p>
<p>The first paper on HAVEGE is called &#8220;<a href="http://www.irisa.fr/caps/projects/hipsor/publications/havege-rr.pdf ">Hardware Volatile Entropy Gathering and Expansion: Generating unpredictable random numbers at user level</a>&#8220;, IRISA internal report 1492, October 2002. It presents the core idea a little differently from later papers.  In it, they measure the cache and TLB effects on randomness, assuming the key to randomness being the effects of interrupts where OS code affect the cache and TLB entries used by the program.  An underlying assumption is that if you just run a program in isolation, the caching and speculation mechanism will converge to a good state for the program, with no or little timing variation as a result.</p>
<p>I wonder if that is still true on a modern machine. Their measurements were performed on a mid-1990s UltraSPARC II, which is in-order and much simpler than current Intel Core processors. Even an ARM Cortex-class processor is much more complex.  I would really like to see measurements about the inherent randomness in today&#8217;s processors, without any recourse to interrupts and hardware actions to disturb the picture.  I wonder if you would still see variations in the execution time of a body of code due to the different periods of various hardware mechanisms, or if it all converges to maximum throughput and minimal hardware latencies for all parts of the pipeline. For some reason, I have my doubts that the hardware would be that ideal in practice.</p>
<p>What makes the randomness of the actual hardware hard to evalutate  is that the available codebase is the HAVEGE code, which is an &#8220;expansion&#8221; of the basic HAVEG idea. The expansion being to couple a PRNG to the collection of entropy from the hardware, in order to produce much more random noise (in terms of random bits per second) than just the hardware would provide. While very practical, this also serves to obscure the fundamental randomness of the hardware from direct measurement.</p>
<p>Essentially, HAVEGE generates a ton of random data that appears to be of high quality in the tests provided.  But that data mixes three factors into a single measurement:</p>
<ul>
<li>Hardware low-level random fluctuations (cache, pipeline, branch predictor)</li>
<li>Hardware coarse-grained variation (interrupt timing, the time taken<br />
to perform OS actions in response to interrupts)</li>
<li>The effectiveness of the PRNG code</li>
</ul>
<p>Picking these three apart would be interesting, and it is a shame that there seems to be no recent evaluation of HAVEGE.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1370"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1370" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1370" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1370/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>S4D 2010</title>
		<link>http://jakob.engbloms.se/archives/1251?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1251#comments</comments>
		<pubDate>Wed, 15 Sep 2010 08:02:42 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[appearances]]></category>
		<category><![CDATA[computer simulation technology]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[EDA]]></category>
		<category><![CDATA[multicore debug]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[ESCUG]]></category>
		<category><![CDATA[FDL]]></category>
		<category><![CDATA[Infineon]]></category>
		<category><![CDATA[Intel]]></category>
		<category><![CDATA[John Aynsley]]></category>
		<category><![CDATA[Pat Brouillette]]></category>
		<category><![CDATA[S4D]]></category>
		<category><![CDATA[Simon Davidmann]]></category>
		<category><![CDATA[Southampton]]></category>
		<category><![CDATA[ST]]></category>
		<category><![CDATA[SystemC]]></category>
		<category><![CDATA[Thorsten Grötker]]></category>
		<category><![CDATA[TrustZone]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1251</guid>
		<description><![CDATA[Looks like S4D (and the co-located FDL) is becoming my most regular conference. S4D is a very interactive event. With some 20 to 30 people in the room, many of them also presenting papers at the conference, it turns into a workshop at its best. There were plenty of discussion going on during sessions and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2009/09/S4D1.jpg"><img class="alignleft size-full wp-image-941" title="S4D" src="http://jakob.engbloms.se/wp-content/uploads/2009/09/S4D1.jpg" alt="" width="143" height="62" /></a>Looks like S4D (and the co-located FDL) is becoming my most regular conference. S4D is a very interactive event. With some 20 to 30 people in the room, many of them also presenting papers at the conference, it turns into a workshop at its best. There were plenty of discussion going on during sessions and the breaks, and I think we all got new insights and ideas.</p>
<p><span id="more-1251"></span></p>
<h2><a href="../wp-content/uploads/2010/09/P1140077.jpg"><img class="aligncenter size-full wp-image-1276" title="P1140077" src="../wp-content/uploads/2010/09/P1140077.jpg" alt="" width="400" height="258" /></a></h2>
<h2>S4D Talks, Themes, and Topics</h2>
<p>More is available in &#8220;<a href="http://jakob.engbloms.se/archives/1280">S4D part 2</a>&#8220;.</p>
<h3>Tracing and Instrumentation</h3>
<p>The papers presented covered a wide variety of topics from a variety of angles. Still, everybody felt that two topics kept coming back in various forms in a majority of the papers and discussions: <em>tracing</em> and <em>instrumentation</em>.</p>
<p>Code instrumentation is not a dirty word anymore. The traditional judgment that inserting probes into your software is plain bad does not apply anymore, at least not in the minds of the people at S4D. Instrumentation was applied to drivers, OS kernels, and regular user-level software. I think the key insight is that there is clear value in having the developers that write a piece of software also mark points of interest in the code. When analyzing a trace of an execution, that means that the information in the trace becomes meaningful to the software developers, as it is on the right level of abstraction. Instrumentation naturally produces traces, which can be fed out using  shared memory, networks, special-purpose hardware, and more.</p>
<p>One of the instrumentation trace solutions presented (the SVEN system from Intel Digital Home presented by Pat Brouillette), actually leaves the instrumentation in place in the shipping customer systems. In this way, you cannot really claim that instrumentation is intrusive &#8211; it is just part of the software, always. Customers can even activate the tracing in deployed systems, and ship the traces back to the developers for analysis of bugs found in the field. It is another approach to <a href="http://jakob.engbloms.se/archives/1231">record and replay</a> that touches on my paper on transporting bugs with checkpoints.</p>
<p>The increased interest in instrumentation probably has something to do with the nature of the systems that are being addressed. For systems using shared memory multicore hardware and general-purpose operating systems, the cost of instrumentation is easier to take than for very small constrained embedded systems. Essentially, as systems get more complex, instrumentation becomes more tractable.</p>
<p>Instrumentation can interact with hardware trace and debug functions is a neat way to build a system which is more powerful than a hardware or software system would be on its own. Especially for software stacks involving hypervisors and multiple complex operating systems, that is likely necessary.</p>
<p>Once we have a trace, just <a href="../archives/942">like last year</a>, we need to have tools for analyzing the tons of data you get from tracing a modern system. ST talked about a tracing system that generated 100s of gigabytes of data.</p>
<p>One trace aspect that kept coming up was the need for <em>time stamps </em>on trace data. To reconcile multiple traces and understand how different concurrent units talk to each other, a global time stamping mechanism is crucial. There seems to be work on hardware to support this.</p>
<h3>Security, Secrecy, and Debug</h3>
<p>I moderated a panel on hardware support for debug, and posed the question on how to balance security and the need to debug. This generated a number of interesting answers from the panel and the audience.</p>
<p>The conflict between debuggability and secrecy is there. Even from the same customer you first get &#8220;you have to make the internal state of the controller inaccessible and hidden to avoid customers modifying their engines&#8221;&#8230; and then when a problem appears in the field, they ask for a way to analyze and trace that very same system. Hard to support both requirements in a reasonable way.</p>
<p>A sophisticated solution to debug security from companies like ARM, Infineon, and ST is debug that can be enabled using key exchange. The chips are built with a &#8220;locked door&#8221; in place, but the keys to the door are kept well-guarded. In this way the same chip can be used in development and in the field.</p>
<p>To support debug of systems involving secure modes like ARM TrustZone, ARM has defined several levels of access in their CoreSight hardware modules. This makes it possible for a debugger to be restricted to just debugging user-level code, just OS and user-level code, or all of the software stack. To me, this sounds like it could allow mobile phone manufacturers to &#8220;securely&#8221; let their application developers use hardware-based debug, without compromising operating systems or secure boot modes.</p>
<p>The classic technique of using fuses to turn off functions is also relevant, at least for systems with moderate levels of security. This can certainly be overcome using special tools to peel off the top of chips and reconnect the fuses, but the panel seemed to think that that level of attack was in general not worth protecting against. However, the audience pointed out that  this was actually being done to automotive engine controllers and there are people making a good living from such antics.</p>
<h3>ESCUG Meeting</h3>
<p>The ESCUG meeting was a mix of fairly slick commercial presentations from OVP/IMperas chief Simon Davidmann and SystemC guru John Aynsley, and research presentations of varying quality.</p>
<p>One thing that struck me was that the academics spent a significant time in all presentations about how their approaches were compatible with the existing SystemC structure, where they host their open-source efforts, etc. I guess that is good in that they show a certain concern for reality &#8211; but it is also a bit sad that they did not get time to actually talk that much about the core ideas they were bringing forward. I am personally much more interested in new ideas than infrastructure and project management. It does not bode well for European research if this is what people are forced to produce, in lieu of real innovation.</p>
<h3>Thorsten Grötker&#8217;s Keynote</h3>
<p>On Wednesday morning, Thorsten from Synopsys did a look back over the history of SystemC, free from product pitching. He only mentioned Synopsys in his introduction, where the high-level message was that the embedded software is really the key problem for industry today. I cannot disagree with that.</p>
<p>During the SystemC parts of his talk he did say a few things that I did not quite agree with&#8230; in particular that TLM was unknown prior to 1999. It was not called that, but it certainly existed in the field of full-system simulation. The main problem is that Thorsten only sees the EDA history of modeling, not the computer architecture and software-driven work that did simulations as far back as 1950 (the famous Gill paper), and fast simulation since at <a href="http://jakob.engbloms.se/archives/130">least 1967</a>.</p>
<p>He also claims that with SystemC you have a single language for both detailed and TLM models. That is true&#8230; but you still need multiple models, one at each level of abstraction. So yes, one language, multiple models. However, that gluability really comes with a performance and complexity cost. It makes it too easy to slip into bad modeling even in TLM.</p>
<p>An interesting theme that Thorsten picked up from John&#8217;s talk at ESCUG is the use of SystemC to model software and RTOS, using the upcoming process control extensions. If you stretch that into the area of software synthesis, it means that SystemC is going to collide with the field of model-driven software development. Will you use SystemC, coming from the hardware world, or UML/MATLAB/Domain-specific languages coming from the software world?  Thorsten makes the interesting point that in order to integrate with that world, SystemC will require some concepts from that world (like pins and clocks enable interaction with RTL). I am not sure that is true, necessarily, I think you can just as well create point adaptors to the same effect.</p>
<h2>Getting to Southampton</h2>
<p>The <a href="http://www.soton.ac.uk/">University of Southampton </a>hosted the event, and it took place in the university lecture halls.  That means that we got free very fast WiFi (unlike any commercial conference venue I have ever seen).  The university campus was full of services (unlike the desolate place that last year&#8217;s FDL/S4D choose).  Housing in the <a href="http://www.soton.ac.uk/accommodation/halls/gleneyre/index.html">Glen Eyre residential halls </a>was a bit spartan but functional. Felt like being back in my days as a student living in student housing.</p>
<p>The instructions from the conference about how to get to the conference was a bit confusing and incomplete. In practice, it is very easy to get to Southampton from both Gatwick (direct train) and Heathrow (NationalExpess bus 203).  At Heathrow, I had a bit of luck with the bus to Southampton. The instructions from the NationalExpress website had me believe that I had to get from Terminal 5 where we landed to the central bus station and then catch the bus at 15.00. As we landed 40 minutes late (14.40), this looked very hopeless&#8230; until I found the NationalExpress counter in the arrivals hall at Terminal 5 and they told me the bus would leave at 15.30. Nice, no stress. The bus to Southampton even had free Wifi on board!</p>
<p><a href="http://jakob.engbloms.se/wp-content/uploads/2010/09/P1140062.jpg"></a><a href="http://jakob.engbloms.se/wp-content/uploads/2010/09/P1140062-1.jpg"><img class="aligncenter size-full wp-image-1275" title="P1140062-1" src="http://jakob.engbloms.se/wp-content/uploads/2010/09/P1140062-1.jpg" alt="" width="400" height="246" /></a></p>
<p>Once in Southampton, you then had to take the bus U1A out to the university campus, and finding a bus stop for that was the most difficult part of the journey, actually. Some of the buses from Heathrow stop at Southampton university.</p>
<p>See also &#8220;<a href="http://jakob.engbloms.se/archives/1280">S4D Part 2</a>&#8221; for a few more tidbits from S4D.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1251"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1251" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1251" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1251/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Worm Attacking Industrial Control Systems</title>
		<link>http://jakob.engbloms.se/archives/1200?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1200#comments</comments>
		<pubDate>Wed, 21 Jul 2010 19:18:13 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SCADA]]></category>
		<category><![CDATA[Siemens]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[worm]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1200</guid>
		<description><![CDATA[There is a very interesting worm going around the world right now which is specifically targeting industrial control systems. According to Business Week, the worm is targeting a Siemens plant control system, probably with the intent to steal production secrets and maybe even information useful to create counterfeit products. This is the first instance I [...]]]></description>
			<content:encoded><![CDATA[<p>There is a very interesting worm going around the world right now which is specifically targeting industrial control systems. According to <a href="http://www.businessweek.com/idg/2010-07-17/new-virus-targets-industrial-secrets.html">Business Week, </a>the worm is targeting a <a href="http://en.wikipedia.org/wiki/SCADA">Siemens plant control system</a>, probably with the intent to steal production secrets and maybe even information useful to create counterfeit products. This is the first instance I have seen of malware targeting the area of embedded systems. However, the actual systems targeted are not really embedded systems, but rather regular PCs running supervision and control software.</p>
<p><span id="more-1200"></span>There are two important aspects to this worm, as I see it.</p>
<p>First, it only works due to the fact that the software in question is running on regular Windows PCs.  An  attack on a real embedded OS like Wind River VxWorks or Enea OSE would  be more interesting, and much scarier since that would mean a much more devoted enemy. In this case, the attackers are opportunistic, using the window of vulnerability of a <a href="http://www.microsoft.com/technet/security/advisory/2286198.mspx">new Windows flaw </a>to attack Windows-based plant control systems. They also use <a href="http://blogs.technet.com/b/mmpc/archive/2010/07/16/the-stuxnet-sting.aspx">signed Windows drivers</a>, which is apparently a new development in malware. All quite interesting in its own right, and worth reading about for those interested in security.</p>
<p>Second, the malware spreads using physical movement of USB memory sticks rather than attacks over the Internet or other networks. This makes the very important point that even if systems are not connected to the Internet, they can still be attacked if something crosses the &#8220;<a href="http://en.wikipedia.org/wiki/Air_gap_%28computing%29">air gap</a>&#8221; that separates them from the outside world. In this case, a plant would be infected by using <a href="http://technet.microsoft.com/en-us/magazine/2008.01.securitywatch.aspx">social engineering to make some employee carry an infected USB stick </a>into the plant and putting it into some internal PC. Once the infection is inside the plant, it might spread over networks or by USB sticks moving around inside the presumably protected perimeter.</p>
<p>The lesson I think we can draw from this is that using general-purpose desktop operating systems for critical systems is a bad idea. Using a more obscure real-time OS (or even Linux) would probably reduce the number of vulnerabilities &#8211; but more importantly, it would make it much more difficult to make an infection hop from computer to computer until it reaches its target.</p>
<p>In this particular case, all Windows machines are potential bearers and spreaders of the infection. An attacker can rely on that fact to seed the Windows ecosystems at some place, hoping to get the infection hopping from machine to machine until it reaches something interesting. There is no real need to seed the infection directly into the target plant. If the target systems had been running a different OS, the attackers would have had to get really close to the target, making them easier to stop.</p>
<p>Overall, embedded systems security is something that we need to take much more seriously going forward. As we rely on embedded control systems to run much of the modern infrastructure and economy, we really need to be concerned about how to secure these systems. Security needs to be part of the architecture of embedded systems, including their operating systems (please make them as robust as possible), application designs, and networking systems. Unfortunately, current embedded technology tends to be designed to work, with little care for how they could be broken by an intentional attack. One scary example of this was provided in the <a href="http://www.grc.com/sn/sn-251.htm">SecurityNow podcast episode #251</a>, where a listener shows how easy it could be to take remote control over a car due to carelessly designed fleet management units.</p>
<p><em>Updated information</em></p>
<p>I found some more in-depth information on the issue at <a href="http://www.infoworld.com/d/security-central/siemens-warns-users-dont-change-passwords-after-worm-attack-915?page=0,0&amp;source=rss_security_central">Infoworld</a>. It notes that the software that is attacked is vulnerable since all installations use the same password to login &#8211; changing it is likely to break it. That is totally ridiculous as a security solution, period.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1200"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1200" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1200" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1200/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wind River Blog: True Concurrency is Different</title>
		<link>http://jakob.engbloms.se/archives/1151?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1151#comments</comments>
		<pubDate>Fri, 18 Jun 2010 20:24:04 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[multicore computer architecture]]></category>
		<category><![CDATA[multicore debug]]></category>
		<category><![CDATA[multicore software]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Wind River Blog]]></category>
		<category><![CDATA[Simics]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1151</guid>
		<description><![CDATA[I have another blog up at Wind River. This one is about multicore bugs that cannot happen on multithreaded systems, and is called True Concurrency is Truly Different (Again). It bounces from a recent interesting Windows security flaw into how Simics works with multicore systems. Tweet]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png"><img class="alignleft size-full wp-image-1122" style="margin: 5px 10px;" title="button-quicklink-blogs" src="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png" alt="" width="46" height="46" /></a>I have another blog up at Wind River. This one is about multicore bugs that cannot happen on multithreaded systems, and is called <a href="http://blogs.windriver.com/engblom/2010/06/true-concurrency-is-truly-different-again.html#more">True Concurrency is Truly Different (Again). </a>It bounces from a recent interesting Windows security flaw into how Simics works with multicore systems.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1151"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1151" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1151" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1151/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C in Danger &#8211; and thus Higher-Level Languages (?)</title>
		<link>http://jakob.engbloms.se/archives/1131?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1131#comments</comments>
		<pubDate>Sun, 09 May 2010 20:00:20 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Nokia]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Windows phone]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1131</guid>
		<description><![CDATA[Some recent developments among development environments for mobile phones have made me consider the hereto unthinkable: that C might be on a decline as the universal programming language. Indeed, maybe there is even a chance that we will not have a universal low-level language in the future at all. What is happening is that the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2010/05/C-dino.png"><img class="alignleft size-full wp-image-1132" title="C dino" src="http://jakob.engbloms.se/wp-content/uploads/2010/05/C-dino.png" alt="" width="105" height="94" /></a>Some recent developments among development environments for mobile phones have made me consider the hereto unthinkable: that C might be on a decline as the universal programming language. Indeed, maybe there is even a chance that we will not have a universal low-level language in the future at all. What is happening is that the hitherto &#8220;given&#8221; role of C as the base language for a platform is being questioned. The reason appears to be security, which cannot be said to be a bad thing. However, a large-scale move away from C might hurt many of today&#8217;s higher-level languages and even model-based engineering.<br />
<span id="more-1131"></span><br />
So what is going on? For the past decade or two, and even longer back than that on Unix platforms, it has been a truth that a (well-written) C program can be made to run on any platform. All platforms have had C compilers available (even Windows), and C programs with a dash of platform-dependent code in file operations could be easily made portable.  This has been used by common cross-platform application programs like Firefox, the Gimp, MySQL, and Wireshark, as well as by technical products like MatLab, the Diab and IAR C compilers (which I once worked on), and Simics (which I currently work on). It is a way of creating software that in my experience works very well. Especially since pretty much anything higher-level can be made to link with a basic C code base.</p>
<p>Ever since Unix became the role model for operating systems, C has been the &#8220;base&#8221; language. In desktop operating systems like Windows and Linux the platform API is expressed as C function calls, and the ABI (the binary calling conventions) for linking code from different compilation units and binary distribution units is also expressed in terms of the code that a C compiler would generate. A C compiler is the first thing you need to get the platform going, and C is a language that allows arbitrary applications to be developed and run on the platform. The semantics of dynamically loadable and shared objects are expressed in C, not C++, as the C++ ABI is too variable.</p>
<p>This ubiquitousness of C has also proven to  be a key enabler for higher-level languages. C is the language of choice to implement the basic virtual machines used by languages and programming systems like Perl, Python, Erlang, and Java. C (or C++) is also used as the target language of many modeling tools with code generation, such as MatLab/Simulink, Rational Rose, Rhapsody, and Labview. A single generator of C code can be reused to target many platforms. Sometimes C++ is the generated language (in particular for UML-based object-oriented tools), but C++ essentially falls back on the ubiquitousness of C to be able to call platform APIs and connect to other tools.</p>
<p>That is the state of things as we know them today. What seems to be happening is that this is slowly being deprecated&#8230; platforms are coming out where user code might not be possible to write in C at all, or where C programs cannot access the real platform API. For these platforms, it is quite difficult  port in an existing C/C++ portable program.</p>
<p>The first example is Google&#8217;s mobile phone operating system Android,where  Java was the only supported language at launch. Google have since made it possible to use C and C++ for some parts of an application, <a href="http://arstechnica.com/open-source/news/2009/06/android-goes-beyond-java-gains-native-cc-dev-kit.ars ">but it does not seem to be a full platform API allowing a whole program to be written only in C or C++: </a></p>
<blockquote><p>&#8220;The NDK will not benefit most applications. As a developer, you will need to balance its benefits against its drawbacks; notably, using native code does not result in an automatic performance increase, but does always increase application complexity,&#8221; the documentation says. &#8220;Typical good candidates for the NDK are self-contained, CPU-intensive operations that don&#8217;t allocate much memory, such as signal processing, physics simulation, and so on.&#8221;</p></blockquote>
<p>To port an application written in C/C++ such as Firefox to the Android platform, the app has to be modified to work as a backend to the Java interface.  <a href="http://arstechnica.com/open-source/reviews/2010/02/hands-on-and-under-the-hood-ars-tests-firefox-on-android.ars  ">ArsTechnica has a write-up on how Firefox was brought to Android through just such a modification</a>. Note that this does mean that ports are not as straight-forward as they would be to other platforms with a directly accesible C API. Interestingly, the Android approach essentially inverts the traditional relationship between C and other languages, where it was common to have a C adapter layer around other languages (like Java) in order to access the platform.</p>
<p>Note that the NDK quote does not mention language run-times. One of my favorite languages, Python, has had to be completely reimplented to run on Android. <a href="http://stackoverflow.com/questions/101754/is-there-any-way-to-run-python-on-android">Either using a &#8220;Jython&#8221; approach of compiling Python to Java byte codes, or using the Android Scripting Environment</a>.</p>
<p>Other languages that you would ordinarily just port using a simple recompile of the its C code base are not helped by this at all. One interesting example is the <a href="http://erlang.2086793.n4.nabble.com/Running-Erlang-on-Android-td2107544.html#a2107544">Erlang runtime</a>, which is basis for CouchDB. According to an interview on <a href="http://twit.tv/floss99">FLOSS weekly show 99, about Ubuntu One</a>, this fact prevents Ubuntu One from synching data from your desktop to your phone.  This demonstrates that the assumption that you can run a C program on &#8220;any Unix-like system&#8221; is no longer true for a large numbers of smartphones&#8230; and that is already affecting how you have to develop products.</p>
<p>Microsoft is also moving in the &#8220;no C for you&#8221; direction with Windows Mobile 7, where C# is the default language. This also prevents easy reuse of existing C programs on smartphones. <a href="http://arstechnica.com/microsoft/news/2010/03/winphones-first-big-native-code-casualty-firefox-on-winmob.ars">Ars Technica notes how this killed Firefox on Microsoft-based mobiles</a>.</p>
<p>Finally, we have Apples downright weird approach to languages and programming. Their recent banning of <a href="http://arstechnica.com/apple/news/2010/04/apple-takes-aim-at-adobe-or-android.ars">anything except Objective C and their own compilers </a>for iPhones (and iPods and iPads) is downright bizarre. They explicitly forbid code-generating tools to be used with their platform, as well as kicking out any alternative language runtimes (which is a move aimed at Adobe Flash that also hits Erlang, Python, et al.). This might make some sense from a security perspective, as it prevents programs from loading executable code at run-time on the phone&#8230; but it also makes for a much more restricted set of programming tools.</p>
<p>The only mobile platform that seems honest to old traditions is really Nokia&#8217;s Maemo. And Symbian. Suddenly, what used to be considered &#8220;closed&#8221; platforms have become the most open and most desktop-like of all the mobile operating systems. Really, that is a very important reason to get a Nokia N900 rather than an Android or Apple device.</p>
<p>I think this points to a somewhat more complicated future, where mobile applications will cannot be cross-platform, as you have to use Android-Java, Windows-C#, iPhone-ObjC, and Maemo-C/C++/anything to code. It could also point to a move even in the desktop and server space away from C and to more sandboxed, controlled, and not-as-common programming platforms. That would be really bad from a programmer productivity and language innovation perspective, as so much of the innovations today are actually based on the ubiquitousness of C and the use of C as a good implementation language and code-generation target language.</p>
<h3>Updates and clarifications</h3>
<p>Given the comments below, it seems that I need to make some things clearer&#8230;</p>
<p>First, the iPhone. It is really a special case, in that you do have C/objective-C access to the API. So in principle, you could port any C program including language virtual machines to the iPhone. Firefox, for example, would work. However, Apple for commercial (and maybe security) reasons does not allow programs that implement virtual machines to be distributed across their controlled application store. That you can implement a VM there does not really help you, as it is the first openly programmable platform that I have seen where a control body actually forbids certain classes of programs. The Apple approach is apparently even more idiotic than I first believed.  According to some more reports I read and heard, they do not enforce a technical limitation on the final program (such as running in a JVM or .net VM), but rather require all software to be originally and directly written in C, C#, or C++.  All just a swipe at Adobe and flash&#8230; so even Flash compiled to native code is disallowed.  And with it goes all other higher-level languages.</p>
<p>Second, on security. I do think that running programs on top of a VM like done with Java and .net does have security benefits. It gives you a level of indirection which can be used to check what applications does. Obviously not perfect since there will always be bugs and mistakes, but still it is a better architecture than raw access to the underlying machine. The  iPhone controlled mode of distribution could also be beneficial here. The <a href="http://www.twit.tv/sn245">SecurityNow podcast episode 245 </a>discusses this topic.</p>
<p>Third, on appropriate programming languages for different tasks. I totally agree with some comments that C is not a very nice language for GUI programming. No doubt about that. However, that was not really the point I was trying to make. I want to use higher level languages! But not having C available might make that harder and with limited choice&#8230; leading up to point four.</p>
<p>Fourth, my core point. <strong>Having platform-level access in C is a basic technology used today to implement the higher-level environments</strong>. Languages like Python, Perl, Erlang, Lua, and even the basic Java and .net virtual machines, all depend on having C available to bootstrap the process of getting the core virtual machine going. If we take this away, we limit choice in language and might stifle innovation, as well as the attractiveness of cross-platform environments.</p>
<p>Fifth, I agree with the comments C is definitely not going anywhere in terms of being used to develop operating systems and embedded systems (that&#8217;s where I spend most of my time, by the way). My observation is about what is happening to user-level programming for certain systems, not the systems programming which is intentionally made separate from user-level programming.</p>
<p><strong>Another Update:</strong></p>
<p>The Inquirer just pointed out that <a href="http://www.theregister.co.uk/2010/06/11/steve_jobs_lifts_interpreted_code_ban_for_chosen_few/">Apple is explicitly forbidding interpreters </a>to run on their phones, unless it is an interpreter they created or one explicitly allowed. That&#8217;s making the above very clear, Apple is consciously denying iPhone users all modern programming languages. And that&#8217;s just to make sure Adobe can&#8217;t weasel Flash in there. Politics sometimes make no sense at all. The Inq quote is worth quoting:</p>
<blockquote><p><em>Famously, when Apple released its iPhone SDK in spring of 2008, the  end user licensing agreement barred applications from downloading and  running any interpreted code. &#8220;No interpreted code may be downloaded or  used in an Application except for code that is interpreted and run by  Apple’s Documented APIs and built-in interpreter(s),&#8221; it said.</em></p></blockquote>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1131"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1131" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1131" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1131/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>500K Spam</title>
		<link>http://jakob.engbloms.se/archives/1076?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1076#comments</comments>
		<pubDate>Wed, 03 Feb 2010 20:11:39 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1076</guid>
		<description><![CDATA[We recently had a malfunction in our spam filters at work, so I had to go back and review the catch for possible false positives. I sort things into two bins using spamassassin, one for most likely spam, and one for probable spam.  When things started to go bad, the most likely folder had reached [...]]]></description>
			<content:encoded><![CDATA[<p>We recently had a malfunction in our spam filters at work, so I had to go back and review the catch for possible false positives. I sort things into two bins using spamassassin, one for most likely spam, and one for probable spam.  When things started to go bad, the most likely folder had reached more than 2 GB, and the probable some 500 MB.</p>
<p><span id="more-1076"></span>As you can see from the webmail screenshot below, the probable folder contained almost 100 thousand spam email. These were collected since May of 2008, or in a space of roughly 21 months.</p>
<p><img class="aligncenter size-full wp-image-1077" title="spamassassin 98322 messages caught" src="http://jakob.engbloms.se/wp-content/uploads/2010/02/spamassassin-98322-messages-caught.png" alt="spamassassin 98322 messages caught" width="715" height="400" /></p>
<p>If I guesstimate that the other folder has about the same average size, that adds in another 400 thousand spam. Bringing the total caught by these filters to about half a million overall. If you divide it down to days, it is &#8220;only&#8221; about 630 per day, plus some more that secondary spam filters catch, plus the ones that get through and I manually have to delete. But these other ones won&#8217;t add up to much more than a few tens of thousands in the same time spa<del datetime="2010-02-03T20:02:13+00:00">m</del>n.</p>
<p>It is amazing just how voluminous this infestation is&#8230;</p>
<p>Legit business emails can&#8217;t be much more than fifty per day, plus various general mailing lists. Still, that means that probably no more than 75% of all email I receive is spam. Maybe I should consider myself lucky, I have seen analysis talking about 99% of all email on the Internet being spam&#8230;</p>
<p>Interesting it was.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1076"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1076" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1076" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1076/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yubikey Follow-Up</title>
		<link>http://jakob.engbloms.se/archives/678?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/678#comments</comments>
		<pubDate>Sat, 07 Mar 2009 21:11:37 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[gadgets]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ICA]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[online banking]]></category>
		<category><![CDATA[Yubikey]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=678</guid>
		<description><![CDATA[Now I have had my yubikey for about a week, and I have put it on my keychain. It really works extremely well! The only small issue is that I tend not to have my keys immediately within reach while at home in the house or on travel, so there is a step of &#8220;go [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-670" style="margin: 5px;" title="yubico-image" src="http://jakob.engbloms.se/wp-content/uploads/2009/02/yubico-image.jpg" alt="yubico-image" width="98" height="98" />Now I have had my yubikey for about a week, and I have put it on my keychain. It really works extremely well! The only small issue is that I tend not to have my keys immediately within reach while at home in the house or on travel, so there is a step of &#8220;go retrieve the keys&#8221; before I can use it for login.</p>
<p><span id="more-678"></span><img class="alignleft size-full wp-image-679" style="margin: 5px;" title="keys" src="http://jakob.engbloms.se/wp-content/uploads/2009/03/keys.png" alt="keys" width="61" height="63" />However, that small inconvenience is not really something to be bothered by. Any hardware-based login solution will have that, and the yubikey&#8217;s fitting into something you have anyway for getting in to places (you keys) makes it very logical. What could have made it even better had been if you would have activated it using a key-like turn rather than the somewhat bland keypress that does not produce any kind of haptic feedback. But I can understand that a twisting design like that would be an order of magnitude more expensive to produce, and probably another order of magnitude less durable&#8230;</p>
<p>It is also striking how well this system works compared the incredibly clunky login and signing facilities used by ICA Banken. There, you have a piece of hardware which is way larger than a key, into which you slide your credit card. Then, to log into the bank and effect a payment of a bill, you do:</p>
<ul>
<li>Type in customer number</li>
<li>Type in PIN code</li>
<li>Put your card into the signing device</li>
<li>Press &#8220;login&#8221;</li>
<li>Copy 8 digit code from web page to device</li>
<li>Type card PIN code into device</li>
<li>Copy 9 digit code from device to web page</li>
<li>&#8230; enter data for bills &#8230;</li>
<li>Bring out the signing device again</li>
<li>Insert card</li>
<li>Press &#8220;sign&#8221;</li>
<li>Copy 8 digit code from web page to device</li>
<li>Type card PIN code into device</li>
<li>Copy 9 digit code from device to web page</li>
</ul>
<p>I really think the &#8220;sign&#8221; step adds no security in practice, and most other bank systems I use seem to agree with this: once past login, no need for additional confirmation. I think that makes sense, and that the sign stage is here more as a warm fuzzy feeling kind of thing.</p>
<p>If it wasn&#8217;t for the possible constraint that the ICA solution has to work on public computers where you have no access to USB ports, I think a yubikey-based solution would make all of the above so much easier. The genius of the yubikey is really that it removes the &#8220;type in numbers from hardware device&#8221; from the login steps, which really is something that there is little value to having each user do every time they effect some kind of secure operation. If all banks used a yubikey, I think the world would save many thousands of people hours that could be used to have fun, be with the family, and other more beneficial uses.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/678"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/678" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/678" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/678/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Got a Yubikey!</title>
		<link>http://jakob.engbloms.se/archives/669?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/669#comments</comments>
		<pubDate>Fri, 27 Feb 2009 09:13:09 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[gadgets]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ICA]]></category>
		<category><![CDATA[SecurityNow]]></category>
		<category><![CDATA[Yubico]]></category>
		<category><![CDATA[Yubikey]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=669</guid>
		<description><![CDATA[I been listening to the SecurityNow! podcast raving about the coolness of the Yubikey, created by Swedish startup Yubico. It seems like the device has captured the imagination of quite a few people, and I have been kind of curious about it. So I was quite pleasantly surprised when I got one a few days [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-670" style="margin: 5px;" title="yubico-image" src="http://jakob.engbloms.se/wp-content/uploads/2009/02/yubico-image.jpg" alt="yubico-image" width="98" height="98" />I been listening to the <a href="http://www.twit.tv/sn">SecurityNow! podcast </a>raving about the coolness of the <a href="http://www.yubico.com/products/yubikey/">Yubikey</a>, created by Swedish startup <a href="http://www.yubico.com/home/index/">Yubico</a>. It seems like the device has captured the imagination of quite a few people, and I have been kind of curious about it. So I was quite pleasantly surprised when I got one a few days ago, since we are testing it as a new way to authenticate to our VPN at work.</p>
<p><span id="more-669"></span>The immediate impression is that is impressively small!  Compared to a standard USB memory stick, it is significantly smaller, and most importantly, very thin. This means that they can be sent in a regular envelope in the mail, since it is about as think as some folded papers. It also helps when you put it on your key chain, I guess. I don&#8217;t know if I dare do that yet, since my pocket tends to be fairly crowded with heavy sharp keys that could well scratch the innocent little  Yubikey. Here is a picture of the key along side a Sandisk Cruzer USB memory stick:</p>
<p><img class="aligncenter size-full wp-image-671" title="yubuj_1" src="http://jakob.engbloms.se/wp-content/uploads/2009/02/yubuj_1.jpg" alt="yubuj_1" width="400" height="239" /></p>
<p>When it is attached to a computer, the little button ring lights up. When the computer is asleep, it pulsates nicely too.</p>
<p><img class="aligncenter size-full wp-image-672" title="yubikey-connected_1" src="http://jakob.engbloms.se/wp-content/uploads/2009/02/yubikey-connected_1.jpg" alt="yubikey-connected_1" width="400" height="350" /></p>
<p>Driver installation was automatic on my Vista machine, showing up as a human-interface device with no particular characteristics. That is the very idea of the Yubikey: it is a USB keyboard as far as the computer is concerned, which is amazingly simple and clever. Here is what Vista says about it:</p>
<p><img class="aligncenter size-full wp-image-674" title="yubikey-driver" src="http://jakob.engbloms.se/wp-content/uploads/2009/02/yubikey-driver.png" alt="yubikey-driver" width="536" height="245" /></p>
<p>In use, the Yubikey is still a bit of challenge to me, for one simple reason: the button feels hard to get pressed in the right way. It seems that I have to push pretty hard and for a long time to activate, and then I want to hold the key with my other hand too so that I do not break it at the point where it is connected to the computer.</p>
<p>Apart from that, it is a beautiful device, and compared to the security solutions I have with my various internet-based banks, it is much easier to use. No codes to type in, no 9-digit numbers to type into online forms (that is what ICA Banken currently requires you to do, <a href="http://www.ica.se/FrontServlet?s=ikk&amp;state=ikk_dynamic&amp;viewid=1131912">copy a nine-digit number from a security device into which you insert your bank card&#8230;</a>).</p>
<p>So overall, I really like the Yubikey, and it will be interesting to see how it lasts, physically, as I start taking it with me everywhere.</p>
<p><em>Update: </em>The Yubikey does work to have on a key chain, I have started doing that and so far it works in the sense that it does not affect the physical size of the chain much. There is also some logic to the use mode of inserting the key from the key chain into my computer to &#8220;unlock&#8221; secure functions.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/669"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/669" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/669" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/669/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cool Obscure Hardware: Sun SCC and Software License Protection</title>
		<link>http://jakob.engbloms.se/archives/619?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/619#comments</comments>
		<pubDate>Wed, 28 Jan 2009 20:12:27 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[business issues]]></category>
		<category><![CDATA[computer architecture]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SCC]]></category>
		<category><![CDATA[smart card]]></category>
		<category><![CDATA[software licensing]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[System Configuration Card]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=619</guid>
		<description><![CDATA[In a very roundabout way, I recently got to hear about a cool Sun server feature introduced sometime back in 2003 or 2004: the SCC System Configuration Card. This is a smart card that stores the system hostid and Ethernet MACs, along with other info, and which can be transferred from one server to another. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-620" style="margin: 5px;" title="sunlogo" src="http://jakob.engbloms.se/wp-content/uploads/2009/01/sunlogo.png" alt="sunlogo" width="97" height="60" />In a very roundabout way, I recently got to hear about a cool Sun server feature introduced sometime back in 2003 or 2004: the SCC System Configuration Card. This is a smart card that stores the system hostid and Ethernet MACs, along with other info, and which can be transferred from one server to another.</p>
<p><span id="more-619"></span></p>
<p>Finding information on this card was very hard, and here is the best that I could find:</p>
<blockquote><p>With front and back LEDs and a removable system configuration card, the Sun Fire V120 server maximizes system availability by allowing system administrators to concentrate on scheduled service through easy installation and management. The removable system configuration card allows you to store a system&#8217;s host ID, MAC address, and NVRAM settings to another server while you perform routine maintenance. As a result, system downtime is minimized.</p></blockquote>
<p>Why I find this interesting is that it is also a nod to commercial software companies relying on hostids for licensing. In this way, you can maintain the same hostid even when a server has issues, and without compromising the integrity of licensing. Sun&#8217;s hostids are unusually safe and reliable, unlike the common x86 anchors like Ethernet MAC addresses (which are easy to change) and disk IDs (which are not available on Linux typically).</p>
<p>Making the ID physical in this way is usually the best way to handle identity in general. A GSM/UMTS SIM card is another example of a physically represented identity, which is way preferable to virtual identies that are just software. Much easier to handle, and safer for all involved.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/619"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/619" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/619" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/619/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Off-topic: Crime Medicine</title>
		<link>http://jakob.engbloms.se/archives/327?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/327#comments</comments>
		<pubDate>Sat, 01 Nov 2008 13:21:17 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[business issues]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[websites]]></category>
		<category><![CDATA[fraud]]></category>
		<category><![CDATA[medicine]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=327</guid>
		<description><![CDATA[The Swedish national medical products agency is running a very cleverly marketed campaign right now to inform people about the perils of buying medicine over the Internet. They are running fake advertisement spots on television, mimicking the typical medical adverts found in the US (and the few other countries where such advertising is allowed for [...]]]></description>
			<content:encoded><![CDATA[<p>The Swedish national medical products agency is running a very cleverly marketed campaign right now to inform people about the perils of buying medicine over the Internet. They are running fake advertisement spots on television, mimicking the typical medical adverts found in the US (and the few other countries where such advertising is allowed for prescription medicine), with a trustworthy doctor talking about the benefits of this and that&#8230; and slowly going into weird land about how the products might not be want you think and maybe don&#8217;t contain the right stuff, etc.Finally, you are pointed to <a href="http://www.crimemedicine.com/">www.crimemedicine.com</a>, a site setup for this campaign. All very clever. In fact, so clever that some people reported the spots to the consumer watchdog as being illegal advertisements&#8230; brilliant!</p>
<p><span id="more-327"></span></p>
<p>It is mostly in Swedish, though, but they have some English-language information at <a href="http://www.crimemedicine.com/lib/html/english.html">http://www.crimemedicine.com/lib/html/english.html</a>.</p>
<p>I think this is pretty important stuff, way too many people are buying counterfeit and illegal and usually dangerous medical stuff over the Internet. That is not how you deal with your health: if you have a problem, go to a doctor or at least a physical pharmacy and talk to someone with proper credentials. Never ever self-medicate with stuff you find of the net. Or even sometimes buy in physical pharmacy in less well-policied countries. Real medications can be expensive &#8212; but most of the time, you are getting what you pay for. As always.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/327"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/327" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/327" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/327/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SiCS Multicore Days: The Debate Points</title>
		<link>http://jakob.engbloms.se/archives/283?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/283#comments</comments>
		<pubDate>Fri, 19 Sep 2008 20:14:24 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[multicore computer architecture]]></category>
		<category><![CDATA[multicore software]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[heterogeneous]]></category>
		<category><![CDATA[homogeneous]]></category>
		<category><![CDATA[memory bandwidth]]></category>
		<category><![CDATA[multicore]]></category>
		<category><![CDATA[panel discussion]]></category>
		<category><![CDATA[SiCS Multicore days]]></category>
		<category><![CDATA[software tools]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=283</guid>
		<description><![CDATA[It is a week ago now, and sometimes it is good to let impressions sink in and get processed a bit before writing about an event like the SiCS Multicore Days. Overall, the event was serious fun, and I found the speakers very insightful and the panel discussion and audience questions added even more information. [...]]]></description>
			<content:encoded><![CDATA[<p>It is a week ago now, and sometimes it is good to let impressions sink in and get processed a bit before writing about an event like the SiCS Multicore Days. Overall, the event was serious fun, and I found the speakers very insightful and the panel discussion and audience questions added even more information.</p>
<p><span id="more-283"></span></p>
<p>What was quite striking this year was the greater difference of opinion between the speakers. I guess that in 2007, most of the discussion was on the level of &#8220;ouch, here comes multicore and what are we going to do about it&#8221;. This year, we got a bit deeper and with one more year of experience and massive research work, the collective world of multicore have made some progress and gained insights. And that&#8217;s when the differences start to show up; the fact that we have differences of opinion tells us that we are starting to dig into details and turning up different answers due to different viewpoints and user experiences.</p>
<p>So where were the differences this time?</p>
<ul>
<li>Heterogeneous vs homogeneous cores (on a single chip). Kunle Olukotun clearly supported the heterogeneous style (which is what you with Sun&#8217;s Niagara that he designed the basis for). Erik Hagersten was more interested in the difference between thin and fat cores of the same basic ISA, and Anant Agarwal was strongly in favor of completely homogeneous systems (which is what they build at Tilera). In my biased view, I think the argument for heterogeneous in pure energy efficiency is always going to prevail. See some of my previous blog posts on this topic, for some background:
<ul>
<li><a href="http://jakob.engbloms.se/archives/222">DNS Hardware Acceleration</a>.</li>
<li><a href="http://jakob.engbloms.se/archives/157">Interview with Kunle Olukotun at the Register</a>.</li>
<li><a href="http://jakob.engbloms.se/archives/44">Homogeneous vs heterogenous</a>.</li>
<li><a href="http://jakob.engbloms.se/archives/90">Homogeneous vs heterogeneous, continued</a>.</li>
<li><a href="http://jakob.engbloms.se/archives/80">IBM Z6 accelerators</a>.</li>
<li><a href="http://jakob.engbloms.se/archives/77">Montalvo and heterogeneous x86</a>.</li>
</ul>
</li>
<li>Domain-specific vs general-purpose programming languages. The same sides here, with Kunle advocating domain-specific languages, and Anant and David Padua more in the general-purpose camp. I like domain-specific better, it seems to rhyme more with what I see people actually doing today to increase programming productivity overall.</li>
<li>Memory bottleneck or not? The most interesting discussion came when memory bandwidth and cache sizes were discussed. One quite common school of thought over the past few years teach that caches per core will shrink, and bandwidth to get data into and out of a chip is going to be a severe restriction on what can be done. Not all in the panel agreed with this, there was the idea (mostly from Kunle) that in some way the massive bandwidths and low latencies achievable within a chip (compared to between chip in a classic discrete-processors multiprocessor) could make this less of a problem. Personally, I think this is going to be some kind of problem, but maybe not as much as passing data around faster might reduce the need to store it temporarily. Despite the need for more bandwidth, nobody really agreed with Erik&#8217;s thought that maybe it makes sense to build chips that do not max out on the number of cores they contain, but rather try to balance core count with achievable IO bandwidth. That idea has some merit.</li>
<li>Core counts. Moore&#8217;s law tells us there are going to be thousands of cores on a chip fairly soon&#8230; but if we do not manage to make good use of them, maybe the growth in core counts will slow soon. Putting four or six or eight cores into a general-purpose system makes sense today, but more than that might turn out to be a waste for the vast majority of users that do not have problems to solve and programs to run that can make of more than that. In the same sense, maybe it is better with slightly fewer more powerful cores than a maximum amount of minimalistic cores, considering the state of software available today. So it sounds like a fairly divergent future here.</li>
<li>Shared memory or local memories? Most of the seemed to be in the camp proposing that shared memory is too convenient not to have, even when it really is bad for you. Several bad jokes comparing shared memory to alcohol, and the moderator of the panel suggesting that a good way to avoid the hangover of shared memory is to stay drunk&#8230; whatever that means in practice.</li>
</ul>
<p>Somethings were generally agreed upon, though.</p>
<ul>
<li>Programming is an issue, shared-memory or local-memory or whatever. the idea for the solution varied, however, as discussed above.</li>
<li>Cores will still be plentiful and that operating-systems focusing on sharing time on a single very valuable core is an idea of the past. The keyword for the future is spatial sharing and reducing the overhead of management (I have some previous blog posts on this topic, especially on the <a href="http://jakob.engbloms.se/archives/58">subject of IMA</a> and <a href="http://jakob.engbloms.se/archives/123">real-time control when cores are free</a>).</li>
<li>Virtualization and isolating partitions of a multicore chip from each are necessary mechanisms. Running multiple different operating systems on a single chip will be quite normal, probably under the control of some global hypervisor.</li>
</ul>
<p>Any comments on this from my small audience? I think the topics under discussion are quite fascinating and the kind of issues on which the success of major chip design projects will be decided. A good architecture with a good programming model has a great chance of success (as long as it looks like a continuation of something existing <img src='http://jakob.engbloms.se/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/283"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/283" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/283" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/283/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Google Chrome and Parallel Browsing</title>
		<link>http://jakob.engbloms.se/archives/258?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/258#comments</comments>
		<pubDate>Fri, 12 Sep 2008 07:54:54 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[desktop software]]></category>
		<category><![CDATA[multicore software]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[Google chrome]]></category>
		<category><![CDATA[Internet explorer]]></category>
		<category><![CDATA[web browsing]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=258</guid>
		<description><![CDATA[Everybody seems to think the launch of the Google Chrome browser is very important and cool. Probably because Google itself is considered important and cool. I am a bit more skeptical about the whole Google thing, they seem to building themselves into a pretty dangerous monopoly company&#8230; but there are some interesting architectural and parallel [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-259" style="margin: 10px 5px;" title="gglchrome" src="http://jakob.engbloms.se/wp-content/uploads/2008/09/gglchrome.jpg" alt="" width="103" height="98" /> Everybody seems to think the launch of the <a href="http://www.google.com/googlebooks/chrome/">Google Chrome browser </a>is very important and cool. Probably because Google itself is considered important and cool. I am a bit more skeptical about the whole Google thing, they seem to building themselves into a pretty dangerous monopoly company&#8230; but there are some interesting architectural and parallel computing aspects to Chrome &#8212; and Internet Explorer 8, it turns out.</p>
<p><span id="more-258"></span></p>
<p>Both IE8 and Chrome have taken to running each tab of a multi-tab browser as its own protected process, to make it both parallel processing and to increase robustness. I think that is a very good idea, and I am waiting for Firefox to catch up.</p>
<p>Why does running a browser as a parallel program make sense? If you look at the tradition, when the web started, you would load a page, render it, and read it for a long time. With multiple tabs and windows, each such display was really also just a set of static prints of pages that you flipped between. No point in being parallel there. However, in recent years, the web page model is changing. Pages are becoming far more active, starting a long time ago with Java applets, Active-X controls, and similar, and today the main drivers seem to be Javascript/AJAX/Web 2.0 pages and media players like Flash and Silverlight.</p>
<p>Basically, we see another example of a domain change enabling parallel processing to be applied. The domain of web pages has changed from single-shot renderings of single pages at a time, which is essentially serial, to lots of active programs running at the same time.</p>
<p>I think we are going to see more of parallel processing being used to enable richer user experience. This is one way that the world is making use of the increase in computing power and communications bandwidth, just because it is there. It gives us a nice sea of threads to run in parallel &#8212; the only issue probably being IO bandwidth and cache restrictions of single chips.</p>
<p>The use of processes for robustness is kind of an application-level virutalization. The OS provides isolation between processes, just like virtualization provide isolation between operating systems.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/258"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/258" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/258" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/258/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DNS: Hardware Accelerator Time!</title>
		<link>http://jakob.engbloms.se/archives/222?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/222#comments</comments>
		<pubDate>Sat, 16 Aug 2008 21:21:50 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[computer architecture]]></category>
		<category><![CDATA[multicore computer architecture]]></category>
		<category><![CDATA[multicore software]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[podcast commentary]]></category>
		<category><![CDATA[SecurityNow]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=222</guid>
		<description><![CDATA[In Episode 157 of Security Now,Steve Gibson and Leo Laporte discuss the recently discovered security issues with DNS. In particular, the cost of making a good fix in terms of bandwidth and computation capacity. Fundamentally, according to Steve, today&#8217;s DNS servers are running at a fairly high load, and there is no room to improve [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.twit.tv/sn157"><img class="size-medium wp-image-225 alignleft" style="margin: 5px 10px;" title="Security Now smaller" src="http://jakob.engbloms.se/wp-content/uploads/2008/08/podcast_2_31.jpg" alt="" width="70" height="70" /></a> In <a href="http://www.twit.tv/sn157">Episode 157 of Security Now</a>,Steve Gibson and Leo Laporte discuss the recently discovered security issues with DNS. In particular, the cost of making a good fix in terms of bandwidth and computation capacity. Fundamentally, according to Steve, today&#8217;s DNS servers are running at a fairly high load, and there is no room to improve the security of DNS updates by for example sending extra UDP packets or switching to TCP/IP. As this theoretically means a doubling or tripling of the number of packets per query, I can believe that. The &#8220;real solutions&#8221; to DNS problems should lie in the adoption of a truly secured protocol like <a href="http://en.wikipedia.org/wiki/DNSSEC">DNSSEC</a>. As this uses public key crypto (PKC), it would add a processing load to the servers that would kill the DNS servers on the CPU side instead&#8230;</p>
<p><span id="more-222"></span></p>
<p>Since Steve is a general PC guy, he seems to have a hard time acknowledging that you need anything but an x86 processor (or a few). However, in this episode he did note that this would greatly benefit from special-purpose acceleration hardware for PKC. So here is a clear-cut case where the addition of specialized accelerators make sense even in what is considered &#8220;general&#8221; computing. This is a favorite theme of mine, see previous blog posts like the <a href="http://jakob.engbloms.se/archives/157">Kunle Olukotun Interview</a>, <a href="http://jakob.engbloms.se/archives/80">IBM z10 accelerators</a>, and my <a href="http://jakob.engbloms.se/archives/44">Niagara 2 writeup</a>.</p>
<p>So here we have it: special-purpose acceleration will save the Internet, and the only architecture missing processors with good crypto accelerators seems to be x86. SPARC, Power Arch, and zSeries all have chips with accelerators on them. One would presume that either AMD or Intel &#8212; maybe more likely AMD who are now working hard on integrating things like GPUs on their chips &#8212; will soon release an x86 with this kind of support. It is also a case where general multicore use does not really make much sense, as using an additional general-purpose core is going to have much worse performance per energy or per area than a dedicated accelerator.</p>
<p>The future is heterogeneous and full of accelerators, I still believe that is the case.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/222"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/222" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/222" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/222/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMM Detection Myths and Realities from a Simics and Embedded Perspective</title>
		<link>http://jakob.engbloms.se/archives/97?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/97#comments</comments>
		<pubDate>Sun, 20 Apr 2008 00:02:21 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[computer simulation technology]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virtual machines]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[Andrew Warfield]]></category>
		<category><![CDATA[HOTOS]]></category>
		<category><![CDATA[Jason Franklin]]></category>
		<category><![CDATA[Keith Adams]]></category>
		<category><![CDATA[Simics]]></category>
		<category><![CDATA[Tal Garfinkel]]></category>
		<category><![CDATA[Temporal decoupling]]></category>
		<category><![CDATA[Timing attack]]></category>
		<category><![CDATA[Virtual machine detection]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=97</guid>
		<description><![CDATA[It must have been Google Alerts that send me a link to the HOTOS 2007 (Hot Topics in Operating Systems) paper by Tal Garfinkel, Keith Adams, Andrew Warfield, and Jason Franklin called Compatibility is not Transparency: VMM Detection Myths and Realities. This paper is slightly less than a year old today, so it is old [...]]]></description>
			<content:encoded><![CDATA[<p>It must have been Google Alerts that send me a link to the <a href="http://www.usenix.org/events/hotos07/">HOTOS 2007</a> (Hot Topics in Operating Systems) paper by Tal Garfinkel, Keith Adams, Andrew Warfield, and Jason Franklin called <a href="http://www.usenix.org/events/hotos07/tech/full_papers/garfinkel/garfinkel_html/">Compatibility is not Transparency: VMM Detection Myths and Realities</a>. This paper is slightly less than a year old today, so it is old by blog standards and quite recent by research paper standards. It deals with the interesting problem of whether a virtual machine can be made undetectable by software running on it &#8212; and software that is trying to detect it. Their conclusion is that it is not feasible, and I agree with that. The reason WHY that is the case can use some more discussion, though&#8230; and here is my take on that issue from a Simics/embedded systems virtualization perspective.</p>
<p><span id="more-97"></span></p>
<p>Their main important assumption is that the VMM cannot be tailored to avoid detection by any particular piece of software, but has to be sufficiently like the real thing to fool something the first time it appears. They discuss from the perspective of virtualization solutions like VmWare that aim at high performance before all else. The virtual PCs generated by VmWare, Parallels, KQemu, and others are all compatible with physical PCs &#8212; run the same software &#8212; but are not at all identical in detail. So they are not transparent in the words of the paper. This means that they are quite easy to spot.</p>
<p>There are some holes in functional differences that VMMs can quite easily plug. The paper shows how you can get a different-sized TLB (compared to the physical hardware), for example, from interference from the VMM. This can obviously be fixed in the VMM, at a cost in performance. The reason such differences are there is that VMMs are optimized for performance at almost any cost. As long as the requisite operating systems run as they should, the VMM is fine even if it is does actually correspond to any particular existing physical machine. This is a testament to the tolerance of modern operating systems towards their hardware. Basically, any OS that probes hardware and discovers what is there will work fine as long as the (virtual) hardware exposes devices that it can recognize. This is quite different from the 1970s or 1980s where an OS would definitely expect a very particular hardware setup with very peculiar timing to run at all. Thus, making a VMM totally identical to some physical machine is a waste of effort and performance.</p>
<p>Paravirtual approaches like Xen and what Sun has with Niagara and IBM on their Power servers, where the OS is rewritten by having drivers for a purely virtual hardware/software interface is an obvious generalization from the VmWare compatibility approach. Compatible versus transparent/invisible  virtualization is really only an issue in the x86 PC world, since all other datacenter architectures are virtual by definition and all operating systems work towards a standard virtual layer. In such an environment, I have hard time seeing that the question posed in the paper does even make sense. You are always virtualized, period.</p>
<p><strong>Embedded Virtual Platforms</strong></p>
<p>Anyhow, back to the main thread. There is still a large set of targets where transparency and compatibility are of interest. x86 PCs is one such target, it is an interesting question for older architectures (Alpha, Vax, Sun and IBM in older generations). In particular,  it is an important topic for embedded systems where you want to use virtual or simulated approaches to develop and test software. As part of that software development process on a virtual machine, you could potentially be examining malware of various kinds. A good not-too-hypothetical example are mobile phone viruses.</p>
<p>If we look at embedded system virtual platforms, the functionality of the simulator is usually more complete and more like a particular physical machine than what a VmWare-style datacenter VMM. This is partially due to embedded software stacks tending to be a bit pickier about what they run on, and partially due to the simple fact that the goal really IS to expose the hardware/software interface of a particular piece of hardware as closely as possible. Also, since this is usually cross-targets (Power Arch on x86, for example), there is no performance gain from using features of the host directly. So items like TLB counts, memory layout, memory content, flash memory programming, etc. are all going to be functionally identical to the physical machine.</p>
<p><strong>Timing is Key</strong></p>
<p>Thus, just like for a patched VmWare-style VMM as discussed in the article, the main attack vector remains <em>timing</em>.</p>
<p>The best way, according to the authors, to spot a VMM is to look for timing differences compared to the behavior on normal hardware. Despite the inherent variability of typical hardware, there are cases where VMMs by necessity vary detectable amounts. I would say this means a factor five or more over many tests of a case.</p>
<p>The authors discuss whether tools like Virtutech Simics could be used to overcome this problem in the context of x86 PCs.  I think the main argument for something like Simics for this purpose is that by simulating the entire hardware platform and providing all timing measurements from a strong virtual time base, you do not see the types of time differences that can be used to detect a &#8220;normal&#8221; VMM. However, since the paper considers Simics and SimNow (from AMD) to be about ten times slower than native hardware, you can always detect them using a non-local time source. That is likely true. But it less obviously true for an embedded target where the simulator running on a fast PC might well be just as fast as the target.</p>
<p><strong>The Multicore Timing Attack</strong></p>
<p>A more intriguing aspect of embedded virtual platforms that could be used to detect virtual platforms is how simulation of multicore machines is handled. For performance reasons, simulators use <em>temporal decoupling</em>,  where each virtual processors is run for a &#8220;long&#8221; time slice before switching to the next. We discussed the effect of this in a recent presentation at the multicore expo (<a href="http://jakob.engbloms.se/archives/89">link to previous blog post</a>), and some of that data is worth repeating.</p>
<p>Here is a slide explaining how temporal decoupling works:</p>
<p><img class="aligncenter size-full wp-image-105" style="vertical-align: middle;" title="temporaldecoupling-what-it-is" src="http://jakob.engbloms.se/wp-content/uploads/2008/04/temporaldecoupling-what-it-is.png" alt="Illustration of temporal decoupling" width="500" height="375" /></p>
<p>So what does this mean in practice for detecting that you are running in a virtual machine?</p>
<p>It means that the communication latency between parallel threads is proportional to the size of the time slicing. If you have two threads progressing in parallel doing spinlocks, on a real machine they will be stealing the lock from each other all the time. On a temporally decoupled simulator, you will rather see a behavior where you can take the lock and then recapture it a few times before missing it. This effect was captured by a simple test program that we wrote, and the data is shown in the slide below:</p>
<p><img class="aligncenter size-full wp-image-106" title="temporaldecoupling-visible-disturbance" src="http://jakob.engbloms.se/wp-content/uploads/2008/04/temporaldecoupling-visible-disturbance.png" alt="Visible disturbance from temporal decoupling" width="500" height="375" /></p>
<p>The program here is running two threads in parallel, updating a shared variable, with three types of locking for the accesses:</p>
<ul>
<li>No locking at all</li>
<li>A local lock to each thread being used (&#8220;fake locking&#8221;)</li>
<li>A proper lock</li>
</ul>
<p>The interesting behavior is the execution time of the program for each of these locking styles. Obviously, running with no lock is the fastest, and with proper locking the slowest. The relative speed of these is the factor to consider. On real hardware, this program observes a very steep increase in execution time when using proper locking. On the simulator, as seen above, the difference in execution time between fake locking and proper locking is significantly smaller when using a long time slice compared to when using a short time slice. The behavior on physical machines is much more like that observed at time slice lengths of ten than that at time slices of 10000.</p>
<p>Normally, a multiprocessor simulator with any ambition to be fast has to use a time slice of 1000 or more. Thus, detecting that you are running inside a simulator is quite simple. If the outside world time seems right, check if you can see strange timing behavior when using locks. Since high speed requires a long time slice, you cannot have both correct real-world timing and a large performance difference. And on the other hand, if the behavior with locking seems reasonable, you should check the real-world time &#8212; as a simulator with a short time slice will be way slower than the real world.</p>
<p>The paper authors note a similar aspect in desktop/server x86 VMM detection. They discuss &#8220;performance cliffs&#8221; that appear when doing &#8220;unusual&#8221; things. For example, VmWare is engineered assuming a minimum use of self-modifying code. Performance is much worse if you use it extensively, and this can be used to detect VmWare quite effectively. This effect is quite similar to the time slice effect in embedded virtual platforms.</p>
<p>Hope you enjoyed this fairly long rant. And we have not even begun exhausting the contents of this topic&#8230; luckily, these discrepancies only very rarely impact the usefulness of virtual platforms. Since most software even on an embedded system does not care about detailed timing like this. In the example above, we still see the lock contention. So we know that we are getting an increase in execution time from the lock. Only not a complete picture of what it means in absolute terms. We will still find missing locks and overused locks.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/97"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/97" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/97" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/97/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>BBC Documentary: On the Trail of Spammers</title>
		<link>http://jakob.engbloms.se/archives/69?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/69#comments</comments>
		<pubDate>Sun, 20 Jan 2008 21:00:50 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[business issues]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[podcast commentary]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/archives/69</guid>
		<description><![CDATA[If you are looking for a good popular introduction to what spam is and how it works, the BBC World Service Documentary Podcast has a very good documentary up right now. I cannot find a direct link, but go to the overview page and then download &#8220;Doc: Assignment &#8211; On the trail of spammers 17 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bbc.co.uk/radio/podcasts/docarchive/assets/_170x170.jpg" align="left" height="100" hspace="10" width="100" />If you are looking for a good popular introduction to what spam is and how it works, the <a href="http://www.bbc.co.uk/radio/podcasts/docarchive/">BBC World Service Documentary Podcas</a>t has a very good documentary up right now. I cannot find a direct link, but go to the overview page and then download &#8220;Doc: Assignment &#8211; On the trail of spammers 17 Jan 2007&#8243;. Enjoy!</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/69"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/69" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/69" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/69/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Customer is not always Right</title>
		<link>http://jakob.engbloms.se/archives/6?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/6#comments</comments>
		<pubDate>Tue, 07 Aug 2007 08:58:42 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[business issues]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[customer service]]></category>
		<category><![CDATA[Leo Laporte]]></category>
		<category><![CDATA[online banking]]></category>
		<category><![CDATA[SecurityNow]]></category>
		<category><![CDATA[Steve Gibson]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/archives/6</guid>
		<description><![CDATA[I just listened to Episode 103 of the Security Now podcast, where Leo Laporte and Steve Gibson talk to the head of security at PayPal. PayPal is doing the right thing right now, issuing their customers with RSA security keys. Which gives them two-factor authentication (password and security key passnumber). But for some reason, they [...]]]></description>
			<content:encoded><![CDATA[<p>I just listened to <a href="http://www.twit.tv/sn103">Episode 103 of the Security Now podcast</a>, where Leo Laporte and Steve Gibson talk to the head of security at PayPal. PayPal is doing the right thing right now, issuing their customers with <a href="https://www.paypal.com/securitykey">RSA security keys</a>. Which gives them two-factor authentication (password and security key passnumber).</p>
<p>But for some reason, they do not enforce the use of security keys on their customers. Even when you have obtained a security key (which is optional, weirdly enough) and said you are using it, you can still login without it doing some additional security questions. For the reason of convenience! Which basically reduces the security added to nothing, since you can still login in a traditional fashion.</p>
<p><span id="more-6"></span>I am all for listening to the needs of customers, but sometimes you have to assume that you know better than your customer. And security for financial  institutions is one area where the financial institution does know better than their customers. The very idea of letting someone get around two-factor authentication for convenience is just amazing to me. Even more amazing is the Bank-of-America login that apparently (from Leos comments in the podcast) do not even use any kind of hardware token for login. This is akin to having safety deposit boxes put in the waiting area in a bank and asking customers to just put their own padlock on them.</p>
<p>Every Internet-based bank where I have  been a customer have done SOMETHING more than just a password. There have been little crypto dongles where you enter a challenge number and get a response, a card with one-time passwords, or a smart card reader that gets a one-time number from the chip on the smart card itself. Or a one-time password sent over SMS to register a certificate on a computer. Not all perfect solutions, but in all cases security has at least been considered and not just customer convenience.</p>
<p>For banks, you do not want access to be too simple. You want your money to be safe. And it is OK to make access a bit more complex than just user name and password.</p>
<p>I hope the argument is not cost-based. The cost of giving out hardware tokens should be minor compared to the cost of lost customer money. It is just part of what it means to be in business as a bank, you do have to pay for offices (or at least server rooms for an internet-only bank) and customer service.</p>
<p>I guess this is one more thing that falls in the category of &#8220;the US is a strange land&#8221;.   Because I hear an undercurrent of &#8220;convenience is more important than anything&#8221; and a fear of losing customers if login is too complex. Which in this case has to be considered the wrong priority.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/6"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/6" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/6" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/6/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

