<?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/"
		>
<channel>
	<title>Comments for Tridge's Corner</title>
	<atom:link href="http://blog.tridgell.net/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.tridgell.net</link>
	<description>Another Australian Hacker</description>
	<lastBuildDate>Mon, 11 Apr 2011 23:46:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on Flavours of Kangaroo Valley by gohai</title>
		<link>http://blog.tridgell.net/?p=134&#038;cpage=1#comment-2368</link>
		<dc:creator>gohai</dc:creator>
		<pubDate>Mon, 11 Apr 2011 23:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tridgell.net/?p=134#comment-2368</guid>
		<description>looks to me like the aspect ratio of these pictures (at least the third one) is possibly wrong?
regards</description>
		<content:encoded><![CDATA[<p>looks to me like the aspect ratio of these pictures (at least the third one) is possibly wrong?<br />
regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Going solar by tridge</title>
		<link>http://blog.tridgell.net/?p=46&#038;cpage=1#comment-2365</link>
		<dc:creator>tridge</dc:creator>
		<pubDate>Thu, 17 Mar 2011 11:05:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tridgell.net/?p=46#comment-2365</guid>
		<description>sure, give me a call at home. I&#039;m in the phone book :-)

maybe you could drop in for a coffee? I&#039;m at home most days.</description>
		<content:encoded><![CDATA[<p>sure, give me a call at home. I&#8217;m in the phone book <img src='http://blog.tridgell.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>maybe you could drop in for a coffee? I&#8217;m at home most days.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Going solar by Tim</title>
		<link>http://blog.tridgell.net/?p=46&#038;cpage=1#comment-2364</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Thu, 17 Mar 2011 10:27:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tridgell.net/?p=46#comment-2364</guid>
		<description>Hi,  Just a quick &quot;reference&quot; follow-up. 

I&#039;m close to deciding on a 7.5kW system and live one street away from you with a v large ColorBond roof.  I would be very grateful for your input.  

Please send me some contract details so we can talk</description>
		<content:encoded><![CDATA[<p>Hi,  Just a quick &#8220;reference&#8221; follow-up. </p>
<p>I&#8217;m close to deciding on a 7.5kW system and live one street away from you with a v large ColorBond roof.  I would be very grateful for your input.  </p>
<p>Please send me some contract details so we can talk</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Linux powered coffee roasting by tridge</title>
		<link>http://blog.tridgell.net/?p=146&#038;cpage=1#comment-2362</link>
		<dc:creator>tridge</dc:creator>
		<pubDate>Wed, 09 Mar 2011 21:14:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tridgell.net/?p=146#comment-2362</guid>
		<description>yes, I&#039;ve used qemu/kvm for USB sniffing before, and it does work well, except that I couldn&#039;t find a way to attach/detach a USB device on the fly. Being able to re-attach is really useful when doing this sort of work.

I use the GPLd version of VirtualBox, without the proprietary add-ons. That only gives me USB1, but its quite sufficient for this sort of work.

Thanks for all your work on qemu/kvm! I have used it a lot for creating virtual clusters to test Samba with CTDB, and its a fantastic piece of work.</description>
		<content:encoded><![CDATA[<p>yes, I&#8217;ve used qemu/kvm for USB sniffing before, and it does work well, except that I couldn&#8217;t find a way to attach/detach a USB device on the fly. Being able to re-attach is really useful when doing this sort of work.</p>
<p>I use the GPLd version of VirtualBox, without the proprietary add-ons. That only gives me USB1, but its quite sufficient for this sort of work.</p>
<p>Thanks for all your work on qemu/kvm! I have used it a lot for creating virtual clusters to test Samba with CTDB, and its a fantastic piece of work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Linux powered coffee roasting by Amit Shah</title>
		<link>http://blog.tridgell.net/?p=146&#038;cpage=1#comment-2330</link>
		<dc:creator>Amit Shah</dc:creator>
		<pubDate>Sat, 26 Feb 2011 07:15:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tridgell.net/?p=146#comment-2330</guid>
		<description>Hey Andrew,  I just saw the video of the talk, very nice!

Just a note to let you know that qemu-kvm can be used as well instead of virtualbox -- it&#039;s completely free (no proprietary addons).  Though the GUI virt-manager isn&#039;t as feature-rich as virtualbox&#039;es, we&#039;re getting there :-)

[btw: virtualbox uses a very old fork of qemu and qemu&#039;s been evolving at a rapid pace.  USB2 support isn&#039;t avl. in qemu as well so far, but there&#039;s a branch being maintained and collecting patches.]</description>
		<content:encoded><![CDATA[<p>Hey Andrew,  I just saw the video of the talk, very nice!</p>
<p>Just a note to let you know that qemu-kvm can be used as well instead of virtualbox &#8212; it&#8217;s completely free (no proprietary addons).  Though the GUI virt-manager isn&#8217;t as feature-rich as virtualbox&#8217;es, we&#8217;re getting there <img src='http://blog.tridgell.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>[btw: virtualbox uses a very old fork of qemu and qemu's been evolving at a rapid pace.  USB2 support isn't avl. in qemu as well so far, but there's a branch being maintained and collecting patches.]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on worst abuse of preload I&#8217;ve ever seen by Stuart Longland</title>
		<link>http://blog.tridgell.net/?p=141&#038;cpage=1#comment-2314</link>
		<dc:creator>Stuart Longland</dc:creator>
		<pubDate>Wed, 23 Feb 2011 23:23:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tridgell.net/?p=141#comment-2314</guid>
		<description>Can someone tell me what to look for in identifying a Sundtek device?  I want to make absolutely sure that I, and the people around me, successfully &lt;i&gt;avoid&lt;/i&gt; these horrors.

I&#039;m sorry, but calling a LD_PRELOAD hack a driver is false advertising.  Blatantly overriding core system calls in &lt;i&gt;every&lt;/i&gt; application, whether it needs to access this particular device or not, is straight plain &lt;i&gt;wrong&lt;/i&gt;.

Do you replace core Microsoft Windows DLLs with &quot;hacked&quot; versions of your own?  It&#039;s not MS-DOS, it&#039;s Linux.  While hooking interrupts (effectively system calls) was the way to get drivers written in DOS, it is not the way it&#039;s done in Linux, or in any other sane OS.</description>
		<content:encoded><![CDATA[<p>Can someone tell me what to look for in identifying a Sundtek device?  I want to make absolutely sure that I, and the people around me, successfully <i>avoid</i> these horrors.</p>
<p>I&#8217;m sorry, but calling a LD_PRELOAD hack a driver is false advertising.  Blatantly overriding core system calls in <i>every</i> application, whether it needs to access this particular device or not, is straight plain <i>wrong</i>.</p>
<p>Do you replace core Microsoft Windows DLLs with &#8220;hacked&#8221; versions of your own?  It&#8217;s not MS-DOS, it&#8217;s Linux.  While hooking interrupts (effectively system calls) was the way to get drivers written in DOS, it is not the way it&#8217;s done in Linux, or in any other sane OS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on worst abuse of preload I&#8217;ve ever seen by Michael Shigorin</title>
		<link>http://blog.tridgell.net/?p=141&#038;cpage=1#comment-2282</link>
		<dc:creator>Michael Shigorin</dc:creator>
		<pubDate>Fri, 18 Feb 2011 13:03:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tridgell.net/?p=141#comment-2282</guid>
		<description>Well, I guess I&#039;ll avoid hardware produced by a company supporting such practices of dumping the debugging/fixup effort onto others instead of implementing proper driver and proposing it for mainline.

But defending being *that* cheap is ugly.</description>
		<content:encoded><![CDATA[<p>Well, I guess I&#8217;ll avoid hardware produced by a company supporting such practices of dumping the debugging/fixup effort onto others instead of implementing proper driver and proposing it for mainline.</p>
<p>But defending being *that* cheap is ugly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on worst abuse of preload I&#8217;ve ever seen by Benjamin Herrenschmidt</title>
		<link>http://blog.tridgell.net/?p=141&#038;cpage=1#comment-2105</link>
		<dc:creator>Benjamin Herrenschmidt</dc:creator>
		<pubDate>Thu, 10 Feb 2011 04:04:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tridgell.net/?p=141#comment-2105</guid>
		<description>You could just as well distribute a source code and a script that recompiles the driver for the various distributions you care about, it&#039;s actually not very complicated.

The -fact- is that your approach, from an engineering perspective, is the most risky for the overall system stability you could have chosen. Fact it, any piece of code -will- have bugs, imagine what happens if I now have a dozen random &quot;drivers&quot; staring to override various libc functions like you do. And you -do- have bugs, see  tridge crash, even in totally unrelated applications.

What about exploits ? What about security holes your library might introduce into every other program in the system ?
 
You seem to be a Mac person, well, I used to be as well, remember how &quot;stable&quot; the system was when we had something like 2 rows of INITs patching every single A-Trap to oblivion, including Apple own stuff as they couldn&#039;t figure out themselves how to get their own stuff working without binary patching at runtime ?

Your approach is wrong and risk prone, and justifying it by &quot;doing the right thing is too hard&quot; isn&#039;t going to fly.</description>
		<content:encoded><![CDATA[<p>You could just as well distribute a source code and a script that recompiles the driver for the various distributions you care about, it&#8217;s actually not very complicated.</p>
<p>The -fact- is that your approach, from an engineering perspective, is the most risky for the overall system stability you could have chosen. Fact it, any piece of code -will- have bugs, imagine what happens if I now have a dozen random &#8220;drivers&#8221; staring to override various libc functions like you do. And you -do- have bugs, see  tridge crash, even in totally unrelated applications.</p>
<p>What about exploits ? What about security holes your library might introduce into every other program in the system ?</p>
<p>You seem to be a Mac person, well, I used to be as well, remember how &#8220;stable&#8221; the system was when we had something like 2 rows of INITs patching every single A-Trap to oblivion, including Apple own stuff as they couldn&#8217;t figure out themselves how to get their own stuff working without binary patching at runtime ?</p>
<p>Your approach is wrong and risk prone, and justifying it by &#8220;doing the right thing is too hard&#8221; isn&#8217;t going to fly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on worst abuse of preload I&#8217;ve ever seen by Markus Rechberger</title>
		<link>http://blog.tridgell.net/?p=141&#038;cpage=1#comment-2066</link>
		<dc:creator>Markus Rechberger</dc:creator>
		<pubDate>Mon, 07 Feb 2011 03:42:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tridgell.net/?p=141#comment-2066</guid>
		<description>tridge, we tested the driver multiple times with many applications.
Your considerations are all valid, but in practice not valid.

That dup2 is not intercepted is because it is not needed for us. The number of TV applications out there are limited to a few, definitely below 50.
You can go start some tests buy several different TV cards none of them will work with all available TV applications due different API implementation in the background. The clone operation is indeed very tricky to handle, but we took care about this and guess what it works. It was a very tough way to have those things work. 

I saw your USB preloadable library, if this would be set globally it would break various applications, just because you intercepted a few syscalls the wrong way (it would deadlock some applications to be more specific). To me that shows that you know the concept of preloading but that you never went into it as deep as we are.

It does not cause any pain to other developers, if you see that our application is running ignore it tell them to remove it and or to ask us about support for it, Linux Kerneldevelopers can do that - they just set the tainted flag and tell the user to remove the module which causes this before helping them further.
Additionally we use to give away tuners to multimedia developers for testing and integrating better support for it, and the feedback we get is very good from beginner users to experienced developers, if there are any problems - especially with external applications - we&#039;ll check it (so far there are none).
Last driver update was just a day ago to increase DVB-S/S2 support, should we tell every customer to recompile the drivers now? That is very much unrealistic, they now just pull the installer for their Ubuntu, Mandrake, Suse, Redhat, Gentoo, etc system and they are done.

This tuner works nearly everywhere including different architectures. You misinterpreted another fact, the fact of writing a driver for different kernel versions.
I&#039;m sure you and some other people are very well aware how to compile kernelmodules, but many users are not. So how to distribute this?
You might remember eeePC or Acer Aspire One netbooks, it came without multimedia stack, without kernel headers, our driver adds support for TV within seconds without even having to take care about the platform. If you compile drivers the manual way you&#039;ll end up with an ABI issue with the audio drivers (for the audio part of analog TV) since Asus never seemed to distribute or document which audio stack they used, we know all the kernelspace issues with regular drivers.
And this particular driver is not only a driver, it&#039;s an application which provides a streaming interface to the TV tuner, the driver interface is an addon.

The discussion should go into the direction, how can this be advanced without the need of preloading. Obviously a driver installable within seconds on all systems with different kernelversions is something that increases the usability of Linux a lot.

We are certainly on the better side when saying that we are only satisfied if everything works, if you checked the installer there&#039;s even a flag to disable preloading - because it was discussed in our support forums, we don&#039;t have to hide what we do.
There&#039;s nothing else to discuss rather than the last sentence here, I just found time to answer this because I&#039;m updating my Mac :-)</description>
		<content:encoded><![CDATA[<p>tridge, we tested the driver multiple times with many applications.<br />
Your considerations are all valid, but in practice not valid.</p>
<p>That dup2 is not intercepted is because it is not needed for us. The number of TV applications out there are limited to a few, definitely below 50.<br />
You can go start some tests buy several different TV cards none of them will work with all available TV applications due different API implementation in the background. The clone operation is indeed very tricky to handle, but we took care about this and guess what it works. It was a very tough way to have those things work. </p>
<p>I saw your USB preloadable library, if this would be set globally it would break various applications, just because you intercepted a few syscalls the wrong way (it would deadlock some applications to be more specific). To me that shows that you know the concept of preloading but that you never went into it as deep as we are.</p>
<p>It does not cause any pain to other developers, if you see that our application is running ignore it tell them to remove it and or to ask us about support for it, Linux Kerneldevelopers can do that &#8211; they just set the tainted flag and tell the user to remove the module which causes this before helping them further.<br />
Additionally we use to give away tuners to multimedia developers for testing and integrating better support for it, and the feedback we get is very good from beginner users to experienced developers, if there are any problems &#8211; especially with external applications &#8211; we&#8217;ll check it (so far there are none).<br />
Last driver update was just a day ago to increase DVB-S/S2 support, should we tell every customer to recompile the drivers now? That is very much unrealistic, they now just pull the installer for their Ubuntu, Mandrake, Suse, Redhat, Gentoo, etc system and they are done.</p>
<p>This tuner works nearly everywhere including different architectures. You misinterpreted another fact, the fact of writing a driver for different kernel versions.<br />
I&#8217;m sure you and some other people are very well aware how to compile kernelmodules, but many users are not. So how to distribute this?<br />
You might remember eeePC or Acer Aspire One netbooks, it came without multimedia stack, without kernel headers, our driver adds support for TV within seconds without even having to take care about the platform. If you compile drivers the manual way you&#8217;ll end up with an ABI issue with the audio drivers (for the audio part of analog TV) since Asus never seemed to distribute or document which audio stack they used, we know all the kernelspace issues with regular drivers.<br />
And this particular driver is not only a driver, it&#8217;s an application which provides a streaming interface to the TV tuner, the driver interface is an addon.</p>
<p>The discussion should go into the direction, how can this be advanced without the need of preloading. Obviously a driver installable within seconds on all systems with different kernelversions is something that increases the usability of Linux a lot.</p>
<p>We are certainly on the better side when saying that we are only satisfied if everything works, if you checked the installer there&#8217;s even a flag to disable preloading &#8211; because it was discussed in our support forums, we don&#8217;t have to hide what we do.<br />
There&#8217;s nothing else to discuss rather than the last sentence here, I just found time to answer this because I&#8217;m updating my Mac <img src='http://blog.tridgell.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on worst abuse of preload I&#8217;ve ever seen by tridge</title>
		<link>http://blog.tridgell.net/?p=141&#038;cpage=1#comment-2065</link>
		<dc:creator>tridge</dc:creator>
		<pubDate>Mon, 07 Feb 2011 02:44:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tridgell.net/?p=141#comment-2065</guid>
		<description>Thorsten,

I do believe that the device works well for you. That is not the problem.

The problem is that the approach taken, while it works for individual users, is very dangerous and inevitably leads to bugs. What is particularly bad is that those bugs don&#039;t turn up in any code or program that Markus wrote - the bugs turn up in other programs and the developers of those programs get the blame. Markus is inserting his incorrect code into every binary on the system.

I don&#039;t know if you are a programmer, but if you are then perhaps this simple example will help you understand. If you use nm on libmediaclient.so then you&#039;ll see that it intercepts dup() but not dup2(). That means there _must_ be a bug in the code.

To understand this I&#039;ll need to explain how preload based drivers work. A preload based driver catches open() and open64() on a specific filename in /dev, such as /dev/dsp. When it sees an open of that file it remembers the file descriptor number that the open gave, usually in a static local variable.

Then when the program later does a fd based operation, such as read(), write(), mmap() etc, it checks the fd against the list of currently intercepted fds, and overrides the result, thus providing access to the virtual device.

Given the above, now look at what dup2() does. dup2() is a system call that changes a fd from one number to another. So if a program first opens /dev/dsp and later uses dup2() to move it to another fd, then the Sundtek driver will not properly intercept later operations on that fd. Even worse the next open which does then re-use that fd may be intercepted by the SUntek driver and the application could well end up getting audio data in a document file.

Markus could &quot;fix&quot; this bug, but it is but one example of many possible bugs that Markus would need to catch. If he fixed the dup2() problem then he&#039;d next be bitten by dup3(). Then he&#039;d be bitten by the flags to clone() that control sharing of the fs and fd space. Then he&#039;d be bitten by the subtleties of locking and mmap. After that he&#039;ll be bitten by the subtleties of the changes in futex() semantics between glibc versions.

After doing all that, you _still_ can&#039;t get it completely right. The weak symbol aliasing in glibc prevents you from correctly intercepting some library calls that you should be intercepting for this type of &quot;preload&quot; driver. That was a deliberate change by the glibc maintainer (Ulrich Drepper) to make this type of &quot;preload driver&quot; impossible because he thought it is such a bad idea (I know, because I was the one that triggered that change, when I made the mistake of doing a SMB based preload driver for Samba).

It is a neverending task. You end up having to copy more and more of glibc into that &quot;driver&quot;, and then you have to choose what version? Then if bugs are fixed in glibc, you end up with the bugs still present because of the Sundtek driver being loaded.

It is just not possible to write a completely correct preload driver like this. Doing it just causes pain for other developers in very subtle ways.</description>
		<content:encoded><![CDATA[<p>Thorsten,</p>
<p>I do believe that the device works well for you. That is not the problem.</p>
<p>The problem is that the approach taken, while it works for individual users, is very dangerous and inevitably leads to bugs. What is particularly bad is that those bugs don&#8217;t turn up in any code or program that Markus wrote &#8211; the bugs turn up in other programs and the developers of those programs get the blame. Markus is inserting his incorrect code into every binary on the system.</p>
<p>I don&#8217;t know if you are a programmer, but if you are then perhaps this simple example will help you understand. If you use nm on libmediaclient.so then you&#8217;ll see that it intercepts dup() but not dup2(). That means there _must_ be a bug in the code.</p>
<p>To understand this I&#8217;ll need to explain how preload based drivers work. A preload based driver catches open() and open64() on a specific filename in /dev, such as /dev/dsp. When it sees an open of that file it remembers the file descriptor number that the open gave, usually in a static local variable.</p>
<p>Then when the program later does a fd based operation, such as read(), write(), mmap() etc, it checks the fd against the list of currently intercepted fds, and overrides the result, thus providing access to the virtual device.</p>
<p>Given the above, now look at what dup2() does. dup2() is a system call that changes a fd from one number to another. So if a program first opens /dev/dsp and later uses dup2() to move it to another fd, then the Sundtek driver will not properly intercept later operations on that fd. Even worse the next open which does then re-use that fd may be intercepted by the SUntek driver and the application could well end up getting audio data in a document file.</p>
<p>Markus could &#8220;fix&#8221; this bug, but it is but one example of many possible bugs that Markus would need to catch. If he fixed the dup2() problem then he&#8217;d next be bitten by dup3(). Then he&#8217;d be bitten by the flags to clone() that control sharing of the fs and fd space. Then he&#8217;d be bitten by the subtleties of locking and mmap. After that he&#8217;ll be bitten by the subtleties of the changes in futex() semantics between glibc versions.</p>
<p>After doing all that, you _still_ can&#8217;t get it completely right. The weak symbol aliasing in glibc prevents you from correctly intercepting some library calls that you should be intercepting for this type of &#8220;preload&#8221; driver. That was a deliberate change by the glibc maintainer (Ulrich Drepper) to make this type of &#8220;preload driver&#8221; impossible because he thought it is such a bad idea (I know, because I was the one that triggered that change, when I made the mistake of doing a SMB based preload driver for Samba).</p>
<p>It is a neverending task. You end up having to copy more and more of glibc into that &#8220;driver&#8221;, and then you have to choose what version? Then if bugs are fixed in glibc, you end up with the bugs still present because of the Sundtek driver being loaded.</p>
<p>It is just not possible to write a completely correct preload driver like this. Doing it just causes pain for other developers in very subtle ways.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
