<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Repeating a check sometimes makes sense</title>
	<atom:link href="http://rdist.root.org/2009/08/31/repeating-a-check-sometimes-makes-sense/feed/" rel="self" type="application/rss+xml" />
	<link>http://rdist.root.org/2009/08/31/repeating-a-check-sometimes-makes-sense/</link>
	<description>Embedded security, crypto, software protection</description>
	<lastBuildDate>Mon, 06 Feb 2012 20:16:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Nate Lawson</title>
		<link>http://rdist.root.org/2009/08/31/repeating-a-check-sometimes-makes-sense/comment-page-1/#comment-5306</link>
		<dc:creator><![CDATA[Nate Lawson]]></dc:creator>
		<pubDate>Tue, 15 Sep 2009 18:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/?p=84#comment-5306</guid>
		<description><![CDATA[Dave, yes, you&#039;re right. However, ZFS is working to &lt;a href=&quot;http://opensolaris.org/os/project/zfs-crypto/&quot; rel=&quot;nofollow&quot;&gt;add better cryptographic support&lt;/a&gt;. It might be worth a review.

I&#039;ve always thought disk encryption without integrity protection is worse from a reliability standpoint. You want an accidental bitflip in a sector to be reported to an upper layer (like a RAID mirror) so it can fail over to known good data from another source. CBC alone turns a bitflip into 16 extra bytes of garbage while still not detecting the error. So it makes things worse by itself.]]></description>
		<content:encoded><![CDATA[<p>Dave, yes, you&#8217;re right. However, ZFS is working to <a href="http://opensolaris.org/os/project/zfs-crypto/" rel="nofollow">add better cryptographic support</a>. It might be worth a review.</p>
<p>I&#8217;ve always thought disk encryption without integrity protection is worse from a reliability standpoint. You want an accidental bitflip in a sector to be reported to an upper layer (like a RAID mirror) so it can fail over to known good data from another source. CBC alone turns a bitflip into 16 extra bytes of garbage while still not detecting the error. So it makes things worse by itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://rdist.root.org/2009/08/31/repeating-a-check-sometimes-makes-sense/comment-page-1/#comment-5305</link>
		<dc:creator><![CDATA[Dave]]></dc:creator>
		<pubDate>Tue, 15 Sep 2009 06:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/?p=84#comment-5305</guid>
		<description><![CDATA[Speaking of protection built into compilers, it&#039;s been interesting tracing the evolution of /GS in Microsoft&#039;s compilers.  This has been upgraded for pretty much every release since it was introduced in VS 2002 in response to new attacks (a few days ago I went to a talk by a MS security person who said that if you have no other reason to upgrade to Visual Studio 2010 then get it just so you can rebuild your existing code with the enhanced GS handling).  There&#039;s a nice summary of the evolution (although with most of the emphasis on recent changes) on the VS blog at http://blogs.msdn.com/vcblog/archive/2009/03/19/gs.aspx.

As for the checksum-insertion, Microsoft&#039;s Phoenix compiler project (which allows you to extend the compiler with user-written add-ons) looks like one way of doing this.  The downside is that it&#039;s still a bit of a fixer-upper.  The closest I&#039;ve seen in the OSS world is Treehydra, a gcc plugin that provides Javascript access to the gcc AST, but that&#039;s read-only access to help in writing static analysis tools rather than a user-written compiler extension capability.  Now all we need is (handwave) someone else to write the necessary plugins...]]></description>
		<content:encoded><![CDATA[<p>Speaking of protection built into compilers, it&#8217;s been interesting tracing the evolution of /GS in Microsoft&#8217;s compilers.  This has been upgraded for pretty much every release since it was introduced in VS 2002 in response to new attacks (a few days ago I went to a talk by a MS security person who said that if you have no other reason to upgrade to Visual Studio 2010 then get it just so you can rebuild your existing code with the enhanced GS handling).  There&#8217;s a nice summary of the evolution (although with most of the emphasis on recent changes) on the VS blog at <a href="http://blogs.msdn.com/vcblog/archive/2009/03/19/gs.aspx" rel="nofollow">http://blogs.msdn.com/vcblog/archive/2009/03/19/gs.aspx</a>.</p>
<p>As for the checksum-insertion, Microsoft&#8217;s Phoenix compiler project (which allows you to extend the compiler with user-written add-ons) looks like one way of doing this.  The downside is that it&#8217;s still a bit of a fixer-upper.  The closest I&#8217;ve seen in the OSS world is Treehydra, a gcc plugin that provides Javascript access to the gcc AST, but that&#8217;s read-only access to help in writing static analysis tools rather than a user-written compiler extension capability.  Now all we need is (handwave) someone else to write the necessary plugins&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://rdist.root.org/2009/08/31/repeating-a-check-sometimes-makes-sense/comment-page-1/#comment-5304</link>
		<dc:creator><![CDATA[Dave]]></dc:creator>
		<pubDate>Tue, 15 Sep 2009 05:55:48 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/?p=84#comment-5304</guid>
		<description><![CDATA[Is there much security benefit to using SHA-256 though?  You&#039;re not getting any crypto benefit because it&#039;s a pure hash and not a MAC (unless ZFS protects the checksums in some way that I&#039;m not familiar with), and you&#039;re paying a huge performance penalty just to get a wider checksum value.  If all you&#039;re worried about is catching errors than 32-bit Fletcher (or insert-favourite-quick-check here) seems to be a good tradeoff.]]></description>
		<content:encoded><![CDATA[<p>Is there much security benefit to using SHA-256 though?  You&#8217;re not getting any crypto benefit because it&#8217;s a pure hash and not a MAC (unless ZFS protects the checksums in some way that I&#8217;m not familiar with), and you&#8217;re paying a huge performance penalty just to get a wider checksum value.  If all you&#8217;re worried about is catching errors than 32-bit Fletcher (or insert-favourite-quick-check here) seems to be a good tradeoff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate Lawson</title>
		<link>http://rdist.root.org/2009/08/31/repeating-a-check-sometimes-makes-sense/comment-page-1/#comment-5301</link>
		<dc:creator><![CDATA[Nate Lawson]]></dc:creator>
		<pubDate>Tue, 15 Sep 2009 01:08:11 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/?p=84#comment-5301</guid>
		<description><![CDATA[Dave, insightful as always. The book &quot;Surrepititious Software&quot; is on my reading list. I&#039;ve always respected Collberg&#039;s academic articles on software protection, given that there aren&#039;t many out there on this topic.

One thing I keep coming back to is the idea that software protection principles will eventually be deployed in every compiler. Just like stack cookies are expected to be enabled in production software today, future compilers will automatically insert compile-time-randomized hash integrity checks for both code and data. This will be great for reliabilty as well, since memory corruption errors (even self-induced, not due to an attacker) will be more obvious.

I&#039;m interested in seeing research in this area because, as you point out, it&#039;s difficult to do in an automated way since you have to explicitly tell the compiler how you will be treating struct members.]]></description>
		<content:encoded><![CDATA[<p>Dave, insightful as always. The book &#8220;Surrepititious Software&#8221; is on my reading list. I&#8217;ve always respected Collberg&#8217;s academic articles on software protection, given that there aren&#8217;t many out there on this topic.</p>
<p>One thing I keep coming back to is the idea that software protection principles will eventually be deployed in every compiler. Just like stack cookies are expected to be enabled in production software today, future compilers will automatically insert compile-time-randomized hash integrity checks for both code and data. This will be great for reliabilty as well, since memory corruption errors (even self-induced, not due to an attacker) will be more obvious.</p>
<p>I&#8217;m interested in seeing research in this area because, as you point out, it&#8217;s difficult to do in an automated way since you have to explicitly tell the compiler how you will be treating struct members.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://rdist.root.org/2009/08/31/repeating-a-check-sometimes-makes-sense/comment-page-1/#comment-5283</link>
		<dc:creator><![CDATA[Dave]]></dc:creator>
		<pubDate>Thu, 10 Sep 2009 06:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/?p=84#comment-5283</guid>
		<description><![CDATA[As a general comment on both software and (some) hardware protection, there&#039;s a rather good book that&#039;s just appeared with the somewhat misleading title of &quot;Surreptitious Software&quot; (the subtitle &quot;Obfuscation, Watermarking, and Tamperproofing for Software Protection&quot; as a bit more illuminating) that covers these issues in considerable detail.  I don&#039;t generally do endorsements but the authors of this one really know their stuff and cover a huge range of techniques, both attacks and defences.

One thing that I haven&#039;t seen discussed much is robustness principles for software that go beyond the basic &quot;check for integer overflows&quot; and the like.  For example one defence mechanism that MS adopted in recent versions of the Windows allocator is to check, before freeing (unlinking) a memory block, that current-&gt;prev == prev-&gt;next and current-&gt;next == next-&gt;prev, to prevent common heap-overflow attacks.  This is fairly easy to add to any linked-list manipulation code, but I don&#039;t know of any list of design patterns that can be applied in the same way as, say, the CERT secure coding guidelines.

One particularly challenging issue is how to sanity-check the contents of a large structure containing state information.  Say you have an SSL implementation and want to protect it against control-flow attacks (there was an unpublished attack on an SSH implementation a few years ago, for example, that allowed you to bypass the sign-in authentication by overflowing the password field so that it overwrote the nearby &#039;is-authenticated&#039; field with the characters from the end of the password).  Lets say your SSL implementation holds all your session state in (say) a &#039;struct SSL&#039; containing a mix of mutable and immutable (after the session is established) fields.  Moving the fields around to make the mutable and immutable ones adjacent isn&#039;t really an option because you&#039;d end up with a random mix of unrelated variables (in other words you&#039;d end up with an &#039;unstruct SSL&#039;).  How do you build a means of checking for unexpected modifications without moving fields around?  You end up with a problem that&#039;s a bit like the AH header checks in IPsec, but with many fields present in the struct and a far more complex field structure it&#039;s much harder to do.

(This is an open question, I&#039;d be interested in any comments on how to solve it).]]></description>
		<content:encoded><![CDATA[<p>As a general comment on both software and (some) hardware protection, there&#8217;s a rather good book that&#8217;s just appeared with the somewhat misleading title of &#8220;Surreptitious Software&#8221; (the subtitle &#8220;Obfuscation, Watermarking, and Tamperproofing for Software Protection&#8221; as a bit more illuminating) that covers these issues in considerable detail.  I don&#8217;t generally do endorsements but the authors of this one really know their stuff and cover a huge range of techniques, both attacks and defences.</p>
<p>One thing that I haven&#8217;t seen discussed much is robustness principles for software that go beyond the basic &#8220;check for integer overflows&#8221; and the like.  For example one defence mechanism that MS adopted in recent versions of the Windows allocator is to check, before freeing (unlinking) a memory block, that current-&gt;prev == prev-&gt;next and current-&gt;next == next-&gt;prev, to prevent common heap-overflow attacks.  This is fairly easy to add to any linked-list manipulation code, but I don&#8217;t know of any list of design patterns that can be applied in the same way as, say, the CERT secure coding guidelines.</p>
<p>One particularly challenging issue is how to sanity-check the contents of a large structure containing state information.  Say you have an SSL implementation and want to protect it against control-flow attacks (there was an unpublished attack on an SSH implementation a few years ago, for example, that allowed you to bypass the sign-in authentication by overflowing the password field so that it overwrote the nearby &#8216;is-authenticated&#8217; field with the characters from the end of the password).  Lets say your SSL implementation holds all your session state in (say) a &#8216;struct SSL&#8217; containing a mix of mutable and immutable (after the session is established) fields.  Moving the fields around to make the mutable and immutable ones adjacent isn&#8217;t really an option because you&#8217;d end up with a random mix of unrelated variables (in other words you&#8217;d end up with an &#8216;unstruct SSL&#8217;).  How do you build a means of checking for unexpected modifications without moving fields around?  You end up with a problem that&#8217;s a bit like the AH header checks in IPsec, but with many fields present in the struct and a far more complex field structure it&#8217;s much harder to do.</p>
<p>(This is an open question, I&#8217;d be interested in any comments on how to solve it).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Travis</title>
		<link>http://rdist.root.org/2009/08/31/repeating-a-check-sometimes-makes-sense/comment-page-1/#comment-5280</link>
		<dc:creator><![CDATA[Travis]]></dc:creator>
		<pubDate>Tue, 08 Sep 2009 15:03:17 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/?p=84#comment-5280</guid>
		<description><![CDATA[I&#039;ll have to keep reading this blog. This blog has some interesting posts and comments worth reading!

Dave has a great point. As the software stack becomes harder and harder to break attackers will look for issues in the hardware itself.  If the software is checking the hardware results attacks based on a hardware flaw could be detected.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ll have to keep reading this blog. This blog has some interesting posts and comments worth reading!</p>
<p>Dave has a great point. As the software stack becomes harder and harder to break attackers will look for issues in the hardware itself.  If the software is checking the hardware results attacks based on a hardware flaw could be detected.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

