<?xml version="1.0" encoding="utf-8" ?>

<?xml-stylesheet type="text/xsl" href="/templates/2k11/rss.xsl" media="screen" ?>
<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Daniel Lange's blog (Entries tagged as linux)</title>
    <link>https://daniel-lange.com/</link>
    <description>agrep -pB IT /dev/life</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 2.6.0 - http://www.s9y.org/</generator>
    <pubDate>Mon, 19 Jun 2023 15:32:03 GMT</pubDate>

    <image>
    <url>//daniel-lange.com/uploads/Avatar_Blog_144_234.png</url>
    <title>RSS: Daniel Lange's blog - agrep -pB IT /dev/life</title>
    <link>https://daniel-lange.com/</link>
    <width>144</width>
    <height>234</height>
</image>

<item>
    <title>Linux kernel USB errors -71 and -110</title>
    <link>https://daniel-lange.com/archives/183-Linux-kernel-USB-errors-71-and-110.html</link>
            <category>Linux</category>
    
    <comments>https://daniel-lange.com/archives/183-Linux-kernel-USB-errors-71-and-110.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=183</wfw:comment>

    <slash:comments>11</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=183</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;After an upgrade of my PC&#039;s mainboard BIOS the boot would take a minute or more to complete and sometimes the lightdm login screen would sit there but not accept keyboard input for another minute or so. Then the keyboard got enabled and I could log in normally. Everything worked fine after that bootup struggle completed. This was fully reproducible and persisted across reboots. Weird.&lt;/p&gt;

&lt;p&gt;The kernel &lt;code&gt;dmesg&lt;/code&gt; log showed entries that looked suspicious:&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:708 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;607&quot; height=&quot;373&quot;  src=&quot;https://daniel-lange.com/uploads/entries/230619_Linux_kernel_USB_errors_minus_71_and_minus_110.png&quot;  alt=&quot;dmesg log excerpt showing USB error messages&quot;&gt;&lt;/p&gt;

&lt;p&gt;Googleing these &lt;code&gt;error -110&lt;/code&gt; and &lt;code&gt;error -71&lt;/code&gt; is a bit hard. Now why the USB driver does not give useful error messages instead of archaic &lt;code&gt;errno&lt;/code&gt;-style numbers escapes me. This is not the 80s anymore.&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:709 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;163&quot; height=&quot;176&quot;  src=&quot;https://daniel-lange.com/uploads/icons/citation_needed.png&quot; title=&quot;This is from https://xkcd.com/285/&quot; alt=&quot;Citation needed (Wikipedia style)&quot;&gt;
The wisdom of the crowd says &lt;code&gt;error -110&lt;/code&gt; is something around &quot;the USB port power supply was exceeded&quot; [&lt;a href=&quot;https://askubuntu.com/questions/644010/ubuntu-cant-read-my-usb-device-descriptor-read-64-error-110&quot;&gt;source&lt;/a&gt;].&lt;/p&gt;

&lt;p&gt;Now &lt;code&gt;lsusb -tv&lt;/code&gt; shows device 1-7 ... to be my USB keyboard. I somehow doubt that wants more power than the hub is willing to provide.&lt;/p&gt;

&lt;p&gt;The Archlinux BBS Forums recommend to &lt;a href=&quot;https://bbs.archlinux.org/viewtopic.php?id=149708&quot;&gt;piece together&lt;/a&gt; information from &lt;code&gt;drivers/usb/host/ohci.h&lt;/code&gt; and (updated from their piece which is from 2012) &lt;code&gt;/tools/include/uapi/asm-generic/errno.h&lt;/code&gt;. This is why some people then consider &lt;code&gt;-110&lt;/code&gt; to mean &quot;Connection timed out&quot;. Nah, not likely either.&lt;/p&gt;

&lt;p&gt;Reading through the kernel source around &lt;code&gt;drivers/usb/host&lt;/code&gt; did not enlighten me either. To the contrary. Uuugly. There seems to be no comprehensive list what these error codes mean. And the numbers are assigned to errors conditions quite arbitrarily. And - of course - there is no documentation. &lt;em&gt;&quot;It was hard to do, so it should be hard to understand as well.&quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Luckily some of the random musings I read through contained some curious advice: power cycle the host. So I did and that did not make the error go away. Other people insisted on removing cables out of wall sockets, unplugging everything and conducting esoteric rituals. That made it dawn on me, the mainboard of course nicely powers the USB in &quot;off&quot; state, too. So switching the power supply off (yes, these have a separate switch, go find yours), waiting a bit for capacitors to drain and switching things back on and ... the errors were gone, the system booted within seconds again.&lt;/p&gt;

&lt;p&gt;So the takeaway message: If you get random error messages like&lt;/p&gt;

&lt;div class=&quot;apache geshi&quot; style=&quot;text-align: left&quot;&gt;device descriptor read/&lt;span style=&quot;color: #ff0000;&quot;&gt;64&lt;/span&gt;, error -&lt;span style=&quot;color: #ff0000;&quot;&gt;110&lt;/span&gt;&lt;br /&gt;device not accepting address &lt;span style=&quot;color: #ff0000;&quot;&gt;42&lt;/span&gt;, error -&lt;span style=&quot;color: #ff0000;&quot;&gt;71&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;on devices that previously worked fine ... completely remove power from the host, the hubs and the USB devices. So they forget they saw each other on the bus before. And when they see each other after that blackout, they will happily go through negotiating protocol details with each other again successfully.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Mon, 19 Jun 2023 11:00:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/183-guid.html</guid>
    <category>codes</category>
<category>error</category>
<category>hardware</category>
<category>kernel</category>
<category>linux</category>
<category>usb</category>

</item>
<item>
    <title>Linux App Summit - Linux applications apparently unable to produce a five page sponsorship brochure</title>
    <link>https://daniel-lange.com/archives/181-Linux-App-Summit-Linux-applications-apparently-unable-to-produce-a-five-page-sponsorship-brochure.html</link>
            <category>Strategy</category>
    
    <comments>https://daniel-lange.com/archives/181-Linux-App-Summit-Linux-applications-apparently-unable-to-produce-a-five-page-sponsorship-brochure.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=181</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=181</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;I&#039;ve been calling out the Linux foundation for &lt;a href=&quot;https://daniel-lange.com/archives/166-No-dog-food-today-the-Linux-Foundation-annual-report.html&quot;&gt;producing their annual report on Macs&lt;/a&gt;. And &lt;a href=&quot;https://daniel-lange.com/archives/172-Gradual-improvements-at-the-Linux-Foundation.html&quot;&gt;again&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But catching the Linux App(lication) Summit to produce their &lt;a href=&quot;https://web.archive.org/web/20230321185718/https://linuxappsummit.org/assets/2023LAS-Brochure.pdf&quot; title=&quot;LAS2023 Sponsorship brochure on Archive Org&#039;s Wayback Machine&quot;&gt;5 page sponsorship brochure&lt;/a&gt; one Windows with Adobe...&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:703 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;850&quot; height=&quot;650&quot;  src=&quot;https://daniel-lange.com/uploads/entries/Linux_App_Summit_sponsorship_brochure_made_on_Windows.jpg&quot; title=&quot;Consider what messages you send with being so lazy...&quot; alt=&quot;Produced by Adobe InDesign 18.1 on Windows&quot;&gt;&lt;/p&gt;

&lt;p&gt;Apparently neither GNOME nor KDE have apps that are sufficient to produce such content. Wtf folks.&lt;/p&gt;

&lt;p&gt;P.S.: Just checked the &lt;a href=&quot;https://web.archive.org/web/20221217233033/https://project.linuxfoundation.org/hubfs/LF%20Research/2022%20Linux%20Foundation%20Annual%20Report.pdf&quot;&gt;Linux Foundation&#039;s 2022 Annual Report&lt;/a&gt; titled &quot;Leadership in Security and Innovation&quot; ... Adobe InDesign 18.0 (Macintosh).&lt;/p&gt;

&lt;p&gt;Their pdf title looks like this:&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:704 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;523&quot; height=&quot;109&quot;  src=&quot;https://daniel-lange.com/uploads/entries/230321_LF_Annual_report_2022_pdf_title.jpg&quot; title=&quot;pdfgrep -ic quality &amp;quot;2022 Linux Foundation Annual Report.pdf&amp;quot; -&gt; 8&quot; alt=&quot;&quot;&gt;&lt;/p&gt;

&lt;p&gt;Pdf is hard.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Tue, 21 Mar 2023 19:15:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/181-guid.html</guid>
    <category>dogfood</category>
<category>dtp</category>
<category>gnome</category>
<category>kde</category>
<category>linux</category>
<category>windows</category>

</item>
<item>
    <title>Gradual improvements at the Linux Foundation</title>
    <link>https://daniel-lange.com/archives/172-Gradual-improvements-at-the-Linux-Foundation.html</link>
            <category>Strategy</category>
    
    <comments>https://daniel-lange.com/archives/172-Gradual-improvements-at-the-Linux-Foundation.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=172</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=172</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;After &lt;a href=&quot;https://daniel-lange.com/archives/166-No-dog-food-today-the-Linux-Foundation-annual-report.html&quot;&gt;last year&#039;s blunder&lt;/a&gt; with trying to hide the Adobe toolchain and using hilarious stock photos, the Linux Foundation did much better in their &lt;a href=&quot;https://web.archive.org/web/20211206213021/https://www.linuxfoundation.org/wp-content/uploads/2021_LF_Annual_Report_120621a.pdf&quot;&gt;2021 annual report&lt;/a&gt;&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; published Dec. 6, 2021.&lt;/p&gt;

&lt;p&gt;Still they are using the Adobe toolchain (InDesign, Acrobat PDF) and my fellow &lt;del&gt;Debian&lt;/del&gt;Kernel&lt;sup id=&quot;fnref:2&quot;&gt;&lt;a href=&quot;#fn:2&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; Developer Geert was quick to point that out as the first comment to the LWN note on the publication:&lt;/p&gt;

&lt;p&gt;&lt;a class=&quot;serendipity_image_link&quot;  href=&#039;https://lwn.net/Articles/877844/&#039; target=&quot;_blank&quot;&gt;&lt;!-- s9ymdb:679 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;611&quot; height=&quot;389&quot;  src=&quot;https://daniel-lange.com/uploads/entries/211207_Screenshot_LWN_LF_Annual_Report_2021.png&quot;  alt=&quot;LWN comment from Geert&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think it is important to call the Linux Foundation (LF) out again and again. Adobe is a Silver member of the LF and they can motivate them to publish their applications for Linux. And if that is not an option, there are Free alternatives like &lt;a href=&quot;https://www.scribus.net/&quot;&gt;Scribus&lt;/a&gt; that could well use the exposure and funds of LF to help catch up to the market leading product, Adobe InDesign.&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:677 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;1704&quot; height=&quot;770&quot;  src=&quot;https://daniel-lange.com/uploads/entries/211207_Screenshot_LF_Annual_Report_1.png&quot; title=&quot;No &amp;quot;Sharp Zaurus XR-5000 (Maemo5) Edition&amp;quot; this time&quot; alt=&quot;Linux Foundation Annual report 2021, document properties&quot;&gt;&lt;/p&gt;

&lt;p&gt;Personally, as a photographer, I am very happy they used stock images from &lt;a href=&quot;https://unsplash.com/&quot;&gt;Unsplash&lt;/a&gt; to illustrate the 2021 edition over the cringeworthy Shutterstock footage from last year&#039;s report.&lt;/p&gt;

&lt;p&gt;And they gave proper credit:&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:678 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;487&quot; height=&quot;916&quot;  src=&quot;https://daniel-lange.com/uploads/entries/211207_Screenshot_LF_Annual_Report_2.png&quot; title=&quot;Speling ihs hart&quot; alt=&quot;Thank you section for Unsplash from the Linux Foundation 2021 annual report&quot;&gt;&lt;/p&gt;

&lt;p&gt;Now for next year ... find an editor that knows how to spell photographers, please. And consider Scribus. And make Adobe publish their apps for Linux. Thank you.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;

&lt;li id=&quot;fn:1&quot;&gt;
&lt;p&gt;Update 07.12.2021 22:00 CET: I had to replace the link to the Linux Foundation 2021 annual report with an archive.org one as they updated the report to fix the typo as per the comment from Melissa Schmidt below. Stable URLs are not a thing, apparently. You can find their new report at &lt;a href=&quot;https://www.linuxfoundation.org/wp-content/uploads/2021_LF_Annual_Report_120721c.pdf&quot;&gt;https://www.linuxfoundation.org/wp-content/uploads/2021_LF_Annual_Report_120721c.pdf&lt;/a&gt;. Unless somebody points out more typos. There is a &lt;a href=&quot;https://datatracker.ietf.org/doc/html/rfc7232.html#section-2.2&quot;&gt;Last-Modified Header in HTTP 1.1&lt;/a&gt;. Wordpress, Varnish and Nginx, serving the LF website, all support that.
&lt;!-- s9ymdb:682 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;1349&quot; height=&quot;765&quot;  src=&quot;https://daniel-lange.com/uploads/entries/Diff_of_LF_2021_reports_120621a_and_120721c.png&quot; title=&quot;The binary diff is 381 kB for s/phtoographers/photographers/. Found once.&quot; alt=&quot;Diff of 2021_LF_Annual_Report_120621a and2021_LF_Annual_Report_120721c&quot;&gt;&amp;#160;&lt;a href=&quot;#fnref:1&quot; rev=&quot;footnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id=&quot;fn:2&quot;&gt;
&lt;p&gt;08.12.2021: Geert Uytterhoeven wrote in that he is &quot;geert&quot; on LWN, both are very nice Geert&#039;s but different Geert&#039;s :-)&amp;#160;&lt;a href=&quot;#fnref:2&quot; rev=&quot;footnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;
&lt;/div&gt;
 
    </content:encoded>

    <pubDate>Tue, 07 Dec 2021 10:11:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/172-guid.html</guid>
    <category>dogfood</category>
<category>dtp</category>
<category>linux</category>
<category>mac</category>
<category>macos</category>
<category>updated</category>

</item>
<item>
    <title>No dog food today - the Linux Foundation annual report</title>
    <link>https://daniel-lange.com/archives/166-No-dog-food-today-the-Linux-Foundation-annual-report.html</link>
            <category>Strategy</category>
    
    <comments>https://daniel-lange.com/archives/166-No-dog-food-today-the-Linux-Foundation-annual-report.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=166</wfw:comment>

    <slash:comments>5</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=166</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;The Linux Foundation has published its &lt;a href=&quot;https://www.linuxfoundation.org/wp-content/uploads/2020/11/2020-Linux-Foundation-Annual-Report_113020.pdf&quot;&gt;annual report&lt;/a&gt; today. LWN &lt;a href=&quot;https://lwn.net/Articles/838871&quot;&gt;calls it glossy&lt;/a&gt; and yeah, boy, it is shiny.&lt;/p&gt;

&lt;p&gt;So shiny that people that work in the publishing industry immediately see this has been produced with the Adobe toolchain which - unfortunately - is one of the big suites of software not yet available for Linux.&lt;/p&gt;

&lt;p&gt;Checking the PDF file metadata reveals the keywords &quot;open source, open standards, open hardware, open data&quot;. That is what the Linux Foundation is about. Good stuff.&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:667 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;552&quot; height=&quot;676&quot;  src=&quot;https://daniel-lange.com/uploads/entries/Linux-Foundation-Annual-Report-2020-cover.jpg&quot; title=&quot;Mouseovers are for xkcd!&quot; alt=&quot;Linux Foundation annual report 2020 cover&quot;&gt;&lt;/p&gt;

&lt;p&gt;The PDF producer meta data for the annual report PDF has been set to &quot;Linux kernel 0.12.1 for Workgroups&quot; and the PDF creator meta data element to &quot;Sharp Zaurus XR-5000 (Maemo5) Edition&quot;. Somebody thought to better hide the real data and had some tongue-in-cheek ideas. Kudos.&lt;/p&gt;

&lt;p&gt;But nicer would have been to use Open Source software to produce the report, not?&lt;/p&gt;

&lt;p&gt;Running &lt;code&gt;strings 2020-Linux-Foundation-Annual-Report_113020.pdf | grep Adobe | wc -l&lt;/code&gt; gives us 1229 lines and confirms the suspicion of the toolchain.&lt;/p&gt;

&lt;p&gt;A stale &lt;code&gt;/Title (Annual Report 2020) /Producer (macOS Version 10.15.7 \(Build 19H15\) Quartz PDFContext)&lt;/code&gt; has been forgotten in the document to tell us about the platform.&lt;/p&gt;

&lt;p&gt;So, ladies and gentlemen, the Linux Foundation 2020 annual report has been produced on a Mac.&lt;/p&gt;

&lt;p&gt;Running Adobe Creative Cloud on MacOS Catalina 10.15.7.&lt;/p&gt;

&lt;p&gt;Which is proprietary software. Its kernel (and some userland pieces) are based on BSD. Not Linux.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;The image on the front page also struck me as a bit odd ... using a ballpoint pen on the laptop screen?&lt;/p&gt;

&lt;p&gt;Unbranded laptop.
Unbranded cup in the foreground.&lt;/p&gt;

&lt;p&gt;Kid in the background &lt;em&gt;not&lt;/em&gt; paying attention to his tablet.&lt;/p&gt;

&lt;p&gt;All of that cries stock image so loud it hurts.&lt;/p&gt;

&lt;p&gt;Google currently finds ~560 uses of the picture and any &lt;a href=&quot;https://www.shutterstock.com/support/article/Do-I-need-to-credit-Shutterstock-the-artist-when-I-use-Images-or-Footage&quot;&gt;editorial use&lt;/a&gt; nicely tells us that it is &amp;copy; &lt;a href=&quot;https://www.shutterstock.com/de/g/draganagordic&quot;&gt;Dragana Gordic / Shutterstock&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The image is &quot;Smiling mom working at home with her child on the sofa while writing an email. Young woman working from home, while in quarantine isolation during the Covid-19 health crisis&quot;.&lt;/p&gt;

&lt;p&gt;See the &lt;a href=&quot;https://www.dailymail.co.uk/news/article-8683629/Staff-working-home-nearly-extra-hour-day-research-shows-send-emails.html&quot;&gt;Daily Mail&lt;/a&gt; for a wonderful example of the working mum in context. I hope, if her laptop had been powered on, it would have run Linux. I mean, what else would still run on an old white MacBook with an Intel &quot;Core 2 Duo&quot; processor from 2008?&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:668 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;504&quot; height=&quot;742&quot;  src=&quot;https://daniel-lange.com/uploads/entries/DailyMail-screenshot-stock-image.png&quot; title=&quot;O.k., here you go: Shiny, too!&quot; alt=&quot;Daily Mail screenshot of the same stock image used&quot;&gt;&lt;/p&gt;
 &lt;a class=&quot;block_level&quot; href=&quot;https://daniel-lange.com/archives/166-No-dog-food-today-the-Linux-Foundation-annual-report.html#extended&quot;&gt;Continue reading &quot;No dog food today - the Linux Foundation annual report&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 03 Dec 2020 22:18:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/166-guid.html</guid>
    <category>bsd</category>
<category>dogfood</category>
<category>dtp</category>
<category>linux</category>
<category>mac</category>
<category>macos</category>

</item>
<item>
    <title>Git shared hosting quirk</title>
    <link>https://daniel-lange.com/archives/165-Git-shared-hosting-quirk.html</link>
            <category>IT</category>
    
    <comments>https://daniel-lange.com/archives/165-Git-shared-hosting-quirk.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=165</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=165</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;Show &lt;a href=&quot;https://github.com/torvalds/linux/blob/b4061a10fc29010a610ff2b5b20160d7335e69bf/drivers/hid/hid-samsung.c#L113-L118&quot;&gt;https://github.com/torvalds/linux/blob/b4061a10fc29010a610ff2b5b20160d7335e69bf/drivers/hid/hid-samsung.c#L113-L118&lt;/a&gt; to a friend.&lt;/p&gt;

&lt;p&gt;Oops &#039;eh? Yep, Linux has been backdoored.&lt;/p&gt;

&lt;p&gt;Well, or not.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://mricon.com/&quot;&gt;Konstantin Ryabitsev&lt;/a&gt; explains it nicely in a &lt;a href=&quot;https://lists.zx2c4.com/pipermail/cgit/2020-October/004571.html&quot;&gt;cgit mailing list email&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
It is common for git hosting environments to configure all forks of the
same repo to use an &quot;object storage&quot; repository. For example, this is
what allows git.kernel.org&#039;s 600+ forks of linux.git to take up only
10GB on disk as opposed to 800GB.

One of the side-effects of this setup is that any object in the shared
repository can be accessed from any of the forks, which periodically
confuses people into believing that something terrible has happened.
&lt;/blockquote&gt;

&lt;p&gt;The hack was &lt;a href=&quot;https://github.com/torvalds/linux/commit/b4061a10fc29010a610ff2b5b20160d7335e69bf#diff-b2b8b8422630002a41cf5901247f9a6af2cc8d000fc792ef7aae9ea1f393f8b4&quot;&gt;discussed on Github in Dec 2018&lt;/a&gt; 
when it was discovered. I forgot about it again but Konstantin&#039;s mail brought the memory back and I think it deserves more attention.&lt;/p&gt;

&lt;p&gt;I&#039;m sure putting some illegal content into a fork and sending a made up &quot;blob&quot; URL to law enforcement would go quite far.
Good luck explaining the issue. &lt;i&gt;&quot;Yes this is my repo&quot;&lt;/i&gt; but &lt;i&gt;&quot;no, no that&#039;s not my data&quot;&lt;/i&gt; ... &lt;i&gt;&quot;yes, it &lt;u&gt;is&lt;/u&gt; my repo but not my data&quot;&lt;/i&gt; ... &lt;i&gt;&quot;no we don&#039;t want that data either, really&quot;&lt;/i&gt; ... &lt;i&gt;&quot;but, but there is nothing we can do, we host on github...&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&quot;&lt;/i&gt;.&lt;/p&gt;

&lt;h3&gt;Updates&lt;/h3&gt;

&lt;p&gt;05.11.20 Nate Friedman (CEO of Github) &lt;a href=&quot;https://news.ycombinator.com/item?id=24995121&quot;&gt;promises&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;[..] we are going to make it much more obvious when you&#039;re viewing an orphaned commit.&lt;/blockquote&gt;

&lt;p&gt;For context: The source code of Github (the product) had been leaked as a &lt;a href=&quot;https://web.archive.org/web/20201104050026/https://github.com/github/dmca/tree/565ece486c7c1652754d7b6d2b5ed9cb4097f9d5&quot;&gt;commit to Github&#039;s own DMCA repository&lt;/a&gt;. The repository has turned into a &lt;a href=&quot;https://github.com/github/dmca/pull/8148&quot;&gt;playground&lt;/a&gt; since Github took down the hosting for &lt;code&gt;youtube-dl&lt;/code&gt; as the result of a &lt;a href=&quot;https://github.com/github/dmca/blob/18429823a5404ff7d9f6f0418588d8a48b81f671/2020/10/2020-10-23-RIAA.md&quot;&gt;DMCA complaint&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;14.11.20 Seems Github now adds a warning to commits that are not in a reachable branch
&lt;!-- s9ymdb:665 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;789&quot; height=&quot;85&quot;  src=&quot;https://daniel-lange.com/uploads/entries/201114_Github_commit_warning_message.png&quot;  alt=&quot;Github commit warning message&quot; style=&quot;border:0px; display: inline;&quot;&gt;&lt;/p&gt;

&lt;p&gt;28.01.22 Github currently fails to show the warning message, so &lt;a href=&quot;https://github.com/torvalds/linux/tree/8bcab0346d4fcf21b97046eb44db8cf37ddd6da0&quot;&gt;https://github.com/torvalds/linux/tree/8bcab0346d4fcf21b97046eb44db8cf37ddd6da0&lt;/a&gt; is making rounds now:
&lt;!-- s9ymdb:685 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;1063&quot; height=&quot;651&quot;  src=&quot;https://daniel-lange.com/uploads/entries/220128_Github_still_failing_attribution.png&quot;  alt=&quot;Fake commit to Linus Torvalds&#039; kernel repo updating the README file and claiming to have deleted Linux&quot;&gt;&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;

&lt;li id=&quot;fn:1&quot;&gt;
&lt;p&gt;Actually there is something you can do. Making a repo private takes it out of the shared &quot;object storage&quot;. You can make it public again afterwards. Seems to work at least for now.&amp;#160;&lt;a href=&quot;#fnref:1&quot; rev=&quot;footnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;
&lt;/div&gt;
 
    </content:encoded>

    <pubDate>Wed, 28 Oct 2020 21:30:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/165-guid.html</guid>
    <category>git</category>
<category>github</category>
<category>hacking</category>
<category>linux</category>
<category>updated</category>

</item>
<item>
    <title>Openssh taking minutes to become available, booting takes half an hour ... because your server waits for a few bytes of randomness</title>
    <link>https://daniel-lange.com/archives/152-Openssh-taking-minutes-to-become-available,-booting-takes-half-an-hour-...-because-your-server-waits-for-a-few-bytes-of-randomness.html</link>
            <category>Linux</category>
    
    <comments>https://daniel-lange.com/archives/152-Openssh-taking-minutes-to-become-available,-booting-takes-half-an-hour-...-because-your-server-waits-for-a-few-bytes-of-randomness.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=152</wfw:comment>

    <slash:comments>22</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=152</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;So, your machine now needs minutes to boot before you can ssh in where it used to be seconds before the Debian Buster update?&lt;/p&gt;

&lt;h1&gt;Problem&lt;/h1&gt;

&lt;p&gt;Linux 3.17 (2014-10-05) learnt a new syscall getrandom() that, well, gets bytes from the entropy pool.
Glibc learnt about this with 2.25 (2017-02-05) and &lt;a href=&quot;https://github.com/openssl/openssl/pull/180&quot;&gt;two tries&lt;/a&gt; and four years after the kernel, OpenSSL used that functionality from release 1.1.1 (2018-09-11).
OpenSSH implemented this natively for the 7.8 release (2018-08-24) as well.&lt;/p&gt;

&lt;p&gt;Now the getrandom() syscall will block&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; if the kernel can&#039;t provide enough entropy. And that&#039;s frequenty the case during boot. Esp. with VMs that have no input devices or IO jitter to source the pseudo random number generator from.&lt;/p&gt;

&lt;h2&gt;First seen in the wild January 2017&lt;/h2&gt;

&lt;p&gt;I vividly remember not seeing my Alpine Linux VMs back on the net after the Alpine 3.5 upgrade. That was basically the same &lt;a href=&quot;https://bugs.alpinelinux.org/issues/6635&quot; title=&quot;Alpine Linux bug tracker #6636&quot;&gt;issue&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;systemd&quot;&gt;&lt;/a&gt;Systemd. Yeah.&lt;/h2&gt;

&lt;p&gt;Systemd makes this behaviour worse, see issues &lt;a href=&quot;https://github.com/systemd/systemd/issues/4271&quot;&gt;#4271&lt;/a&gt;, &lt;a href=&quot;https://github.com/systemd/systemd/pull/4513&quot;&gt;#4513&lt;/a&gt; and &lt;a href=&quot;https://github.com/systemd/systemd/pull/10621&quot;&gt;#10621&lt;/a&gt;.&lt;br /&gt;
Basically as of now the entropy file saved as &lt;code&gt;/var/lib/systemd/random-seed&lt;/code&gt; will not - drumroll - add entropy to the random pool when played back during boot. Actually it will. It will just not be accounted for. So Linux doesn&#039;t know. And continues blocking getrandom(). This is obviously different from SysVinit times&lt;sup id=&quot;fnref:2&quot;&gt;&lt;a href=&quot;#fn:2&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; when &lt;code&gt;/var/lib/urandom/random-seed&lt;/code&gt; (that you still have lying around on updated systems) made sure the system carried enough entropy over reboot to continue working right after enough of the system was booted.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/systemd/systemd/issues/4167&quot;&gt;#4167&lt;/a&gt; is a re-opened discussion about systemd eating randomness early at boot (hashmaps in PID 0...). Some Debian folks participate in the recent discussion and it is worth reading if you want to learn about the mess that booting a Linux system has become.&lt;/p&gt;

&lt;p&gt;While we&#039;re talking systemd ... &lt;a href=&quot;https://github.com/systemd/systemd/pull/10676&quot;&gt;#10676&lt;/a&gt; also means systems will use RDRAND in the future despite &lt;a href=&quot;https://plus.google.com/+TheodoreTso/posts/SDcoemc9V3J&quot;&gt;Ted Ts&#039;o&#039;s warning on RDRAND&lt;/a&gt; [&lt;a href=&quot;https://web.archive.org/web/20180320163305/https://plus.google.com/+TheodoreTso/posts/SDcoemc9V3J&quot;&gt;Archive.org mirror&lt;/a&gt; and mirrored locally as &lt;a href=&quot;https://daniel-lange.com/documents/130905_Ted_Tso_on_RDRAND.pdf&quot;&gt;130905_Ted_Tso_on_RDRAND.pdf, 205kB&lt;/a&gt; as &lt;a href=&quot;https://killedbygoogle.com/&quot;&gt;Google+ will be discontinued&lt;/a&gt; in April 2019].&lt;br /&gt;
Update: RDRAND doesn&#039;t return random data on pre-Ryzen AMD CPUs (AMD CPU family &amp;lt;23) as per &lt;a href=&quot;https://github.com/systemd/systemd/issues/11810#issuecomment-489727505&quot;&gt;systemd bug #11810&lt;/a&gt;. It will always be 0xFFFFFFFFFFFFFFFF (2&lt;sup&gt;64&lt;/sup&gt;-1). This is a known issue since 2014, see &lt;a href=&quot;https://bugzilla.kernel.org/show_bug.cgi?id=85911&quot;&gt;kernel bug #85991&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Debian&lt;/h2&gt;

&lt;p&gt;Debian is seeing the same issue working up towards the Buster release, e.g. &lt;a href=&quot;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912087&quot;&gt;Bug #912087&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The typical issue is:&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000;&quot;&gt;4.428797&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt; EXT4-fs &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;vda1&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;: mounted filesystem with ordered data mode. Opts: &lt;span style=&quot;color: #007800;&quot;&gt;data&lt;/span&gt;=ordered&lt;br /&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;130.970863&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt; random: crng init &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;done&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;with delays up to tens of minutes on systems with very little external random sources.&lt;/p&gt;

&lt;p&gt;This is what it should look like:&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000;&quot;&gt;1.616819&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt; random: fast init &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;done&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000;&quot;&gt;2.299314&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt; random: crng init &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;done&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;Check &lt;code&gt;dmesg | grep -E &quot;(rng|random)&quot;&lt;/code&gt; to see how your systems are doing.&lt;/p&gt;

&lt;p&gt;If this is not fully solved before the Buster release, I hope some of the below can end up in the &lt;a href=&quot;https://salsa.debian.org/ddp-team/release-notes&quot;&gt;release notes&lt;/a&gt;&lt;sup id=&quot;fnref:3&quot;&gt;&lt;a href=&quot;#fn:3&quot; rel=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;h1&gt;Solutions&lt;/h1&gt;

&lt;p&gt;You need to get entropy into the random pool earlier at boot. There are many ways to achieve this and - currently - all require action by the system administrator.&lt;/p&gt;

&lt;h2&gt;Kernel boot parameter&lt;/h2&gt;

&lt;p&gt;From kernel 4.19 (Debian Buster currently runs 4.18 [Update: but will be getting 4.19 before release according to &lt;a href=&quot;https://twitter.com/mikagrml/status/1080602882737610754&quot; title=&quot;Of course this is formal Debian planning. It&#039;s on Twitter!&quot;&gt;Ben via Mika&lt;/a&gt;]) you can set &lt;code&gt;RANDOM_TRUST_CPU&lt;/code&gt; at compile time or &lt;code&gt;random.trust_cpu=on&lt;/code&gt; on the kernel command line. This will make recent Intel / AMD systems trust RDRAND and fill the entropy pool with it. See the warning from Ted Ts&#039;o linked above.&lt;/p&gt;

&lt;p&gt;Update: Since Linux kernel build 4.19.20-1 &lt;code&gt;CONFIG_RANDOM_TRUST_CPU&lt;/code&gt; has been &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/02/msg00170.html&quot;&gt;enabled by default&lt;/a&gt; in Debian.&lt;/p&gt;

&lt;h2&gt;Using a TPM&lt;/h2&gt;

&lt;p&gt;The Trusted Platform Module has an embedded random number generator that can be used. Of course you need to have one on your board for this to be useful. It&#039;s a hardware device.&lt;/p&gt;

&lt;p&gt;Load the &lt;code&gt;tpm-rng&lt;/code&gt; module (ideally from initrd) or compile it into the kernel (&lt;code&gt;config HW_RANDOM_TPM&lt;/code&gt;).
Now, the kernel does not &quot;trust&quot; the TPM RNG by default, so you need to add&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rng_core.default_quality=1000&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to the kernel command line.
1000 means &quot;trust&quot;, 0 means &quot;don&#039;t use&quot;. So you can chose any value in between that works for you depending on how much you consider your TPM to be unbugged.&lt;/p&gt;

&lt;h2&gt;VirtIO (KVM, QEMU, ...)&lt;/h2&gt;

&lt;p&gt;For Virtual Machines (VMs) you can forward entropy from the host (that should be running longer than the VMs and have enough entropy) via &lt;code&gt;virtio_rng&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So on the host, you do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;kvm ... -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x7&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and within the VM newer kernels should automatically load &lt;code&gt;virtio_rng&lt;/code&gt; and use that.&lt;/p&gt;

&lt;p&gt;You can confirm with dmesg as per above.&lt;/p&gt;

&lt;p&gt;Or check:&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# cat /sys/devices/virtual/misc/hw_random/rng_available&lt;/span&gt;&lt;br /&gt;virtio_rng.0&lt;br /&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# cat /sys/devices/virtual/misc/hw_random/rng_current&lt;/span&gt;&lt;br /&gt;virtio_rng.0&lt;/div&gt;

&lt;h2&gt;Patching systemd&lt;/h2&gt;

&lt;p&gt;The Fedora bugtracker has a &lt;a href=&quot;https://bugzilla.redhat.com/show_bug.cgi?id=1572944#c46&quot;&gt;bash / python script&lt;/a&gt; that replaces the systemd &lt;code&gt;rnd&lt;/code&gt; seeding with a (better) working one. The script can also serve as a good starting point if you need to script your own solution, e.g. for reading from an entropy provider available within your (secure) network.&lt;/p&gt;

&lt;h2&gt;Chaoskey&lt;/h2&gt;

&lt;p&gt;The wonderful Keith Packard and Bdale Garbee have developed a USB dongle, &lt;a href=&quot;https://altusmetrum.org/ChaosKey/&quot;&gt;ChaosKey&lt;/a&gt;, that supplies entropy to the kernel. Hard- and software are open source.&lt;/p&gt;

&lt;p&gt;&lt;a name=&quot;jitterentropy_rng&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Jitterentropy_RNG&lt;/h2&gt;

&lt;p&gt;Kernel 4.2 introduced &lt;a href=&quot;https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bb5530e4082446aac3a3d69780cd4dbfa4520013&quot;&gt;&lt;code&gt;jitterentropy_rng&lt;/code&gt;&lt;/a&gt; which will use the jitter in CPU timings to generate randomness.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;modprobe jitterentropy_rng&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This &lt;a href=&quot;https://pthree.org/2016/05/24/cpu-jitter-entropy-for-the-linux-kernel/&quot;&gt;apparently needs a userspace daemon&lt;/a&gt; though (read: design mistake) so&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt install jitterentropy-rngd&lt;/code&gt; (available from &lt;a href=&quot;https://packages.debian.org/search?keywords=jitterentropy-rngd&quot;&gt;Buster/testing&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The current version 1.0.8-3 installs nicely on Stretch. &lt;code&gt;dpkg -i&lt;/code&gt; is your friend.&lt;/p&gt;

&lt;p&gt;But - drumroll - that daemon doesn&#039;t seem to use the kernel module at all.&lt;/p&gt;

&lt;p&gt;That&#039;s where I stopped looking at that solution. At least for now. There are extensive &lt;a href=&quot;http://www.chronox.de/jent/doc/CPU-Jitter-NPTRNG.html&quot;&gt;docs&lt;/a&gt; if you want to dig into this yourself.&lt;/p&gt;

&lt;p&gt;Update: The Linux kernel 5.3 will have an updated jitterentropy_rng as per &lt;a href=&quot;https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4d2fa8b44b891f0da5ceda3e5a1402ccf0ab6f26&quot;&gt;Commit 4d2fa8b44&lt;/a&gt;. This is based on the &lt;a href=&quot;https://www.chronox.de/jent.html&quot;&gt;upstream&lt;/a&gt; version &lt;a href=&quot;https://github.com/smuellerDD/jitterentropy-library/releases/tag/v2.1.2&quot;&gt;2.1.2&lt;/a&gt; and should be worth another look.&lt;/p&gt;

&lt;h2&gt;Haveged&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;apt install haveged&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Haveged is a user-space daemon that gathers entropy though the timing jitter any CPU has. It will only run &quot;late&quot; in boot but may still get your openssh back online within seconds and not minutes.&lt;/p&gt;

&lt;p&gt;It is also - to the best of my knowledge - not verified at all regarding the quality of randomness it generates.
The haveged &lt;a href=&quot;http://issihosts.com/haveged/history.html#havege&quot;&gt;design and history page&lt;/a&gt; provides and interesting read and I wouldn&#039;t recommend haveged if you have alternatives. If you have none, haveged is a wonderful solution though as it works reliably. And unverified entropy is better than no entropy. Just forget this is &lt;del&gt;2018&lt;/del&gt; 2019 &lt;img src=&quot;https://daniel-lange.com/plugins/serendipity_event_emoticate/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; class=&quot;emoticon&quot; /&gt;.&lt;/p&gt;

&lt;h2&gt;early-rng-init-tools&lt;/h2&gt;

&lt;p&gt;Thorsten Glaser has posted newly developed &lt;a href=&quot;https://evolvis.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=alioth/early-rng-init-tools.git;a=tree&quot;&gt;early-rng-init-tools&lt;/a&gt; in a &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/02/msg00327.html&quot;&gt;debian-devel thread&lt;/a&gt;. He provides packages at &lt;a href=&quot;http://fish.mirbsd.org/~tg/Debs/dists/sid/wtf/Pkgs/early-rng-init-tools/&quot;&gt;http://fish.mirbsd.org/~tg/Debs/dists/sid/wtf/Pkgs/early-rng-init-tools/&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;First he deserves kudos for naming a tool for what it does. This makes it much more easily discoverable than the trend to name things after girlfriends, pets or anime characters. The implementation hooks into the early boot via initrd integration and carries over a seed generated during the previous shutdown. This and some other implementation details are not ideal and there has been quite extensive &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/02/threads.html#00327&quot;&gt;scrutiny&lt;/a&gt; but none that discovered serious issues. Early-rng-init-tools look like a good option for non-RDRAND (~CONFIG_RANDOM_TRUST_CPU) capable platforms.&lt;/p&gt;

&lt;p&gt;&lt;a name=&quot;linustotherescue&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Linus to the rescue&lt;/h2&gt;

&lt;p&gt;Luckily end of September Linus Torvalds was fed up with the entropy starvation issue and the non-conclusive discussions about (mostly) who&#039;s at fault and ... &lt;a href=&quot;https://lore.kernel.org/lkml/CAHk-=wi0vxLmwEBn2Xgu7hZ0U8z2kN4sgCax+57ZJMVo3huDaQ@mail.gmail.com/&quot;&gt;started coding&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With the kernel 5.4 release on 25.11.2019 his &lt;a href=&quot;https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=50ee7529ec4500c88f8664560770a7a1b65db72b&quot;&gt;patch&lt;/a&gt; has made it into mainline. He created a &lt;code&gt;try_to_generate_entropy&lt;/code&gt; function that uses CPU jitter to generate seed entropy for the PRNG early in boot.&lt;/p&gt;

&lt;p&gt;In the &lt;a href=&quot;https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3f2dc2798b81531fd93a3b9b7c39da47ec689e55&quot;&gt;merge commit&lt;/a&gt; Linus explains:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is admittedly partly &quot;for discussion&quot;.  We need to have a way
forward for the boot time deadlocks where user space ends up waiting for
more entropy, but no entropy is forthcoming because the system is
entirely idle just waiting for something to happen.&lt;/p&gt;

&lt;p&gt;While this was triggered by what is arguably a user space bug with
GDM/gnome-session asking for secure randomness during early boot, when
they didn&#039;t even need any such truly secure thing, the issue ends up
being that our &quot;getrandom()&quot; interface is prone to that kind of
confusion, because people don&#039;t think very hard about whether they want
to block for sufficient amounts of entropy.&lt;/p&gt;

&lt;p&gt;The approach here-in is to decide to not just passively wait for entropy
to happen, but to start actively collecting it if it is missing.  This
is not necessarily always possible, but if the architecture has a CPU
cycle counter, there is a fair amount of noise in the exact timings of
reasonably complex loads.&lt;/p&gt;

&lt;p&gt;We may end up tweaking the load and the entropy estimates, but this
should be at least a reasonable starting point.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So once this kernel is available in your distribution, you should be safe from entropy starvation at boot on any platform that has hardware timers (I haven&#039;t encountered one that does not in the last decade).&lt;/p&gt;

&lt;p&gt;Ted Ts&#039;o &lt;a href=&quot;https://lore.kernel.org/lkml/20190930033706.GD4994@mit.edu/&quot;&gt;reviewed the approach and was fine&lt;/a&gt; and Ahmed Dawish did some &lt;a href=&quot;https://lore.kernel.org/lkml/20191001161448.GA1918@darwi-home-pc/&quot;&gt;testing of the quality of randomness generated and that seems fine&lt;/a&gt;, too.&lt;/p&gt;

&lt;h1&gt;Updates&lt;/h1&gt;

&lt;h3&gt;14.01.2019&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://sfritsch.de/&quot;&gt;Stefan Fritsch&lt;/a&gt;, the Apache2 maintainer in Debian, OpenBSD developer and a former Debian security team member stumbled over the systemd issue preventing Apache libssl to initialize at boot in a Debian bug &lt;a href=&quot;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916690&quot;&gt;#916690 - apache2: getrandom call blocks on first startup, systemd kills with timeout&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The bug has been retitled &quot;document getrandom changes causing entropy starvation&quot; hinting at not fixing the underlying issue but documenting it in the Debian Buster release notes.&lt;/p&gt;

&lt;p&gt;Unhappy with this &quot;minimal compromise&quot; Stefan wrote a &lt;a href=&quot;https://lists.debian.org/debian-devel/2018/12/msg00184.html&quot;&gt;comprehensive summary of the current situation&lt;/a&gt; to the Debian-devel mailing list. The discussion spans over &lt;a href=&quot;https://lists.debian.org/debian-devel/2018/12/&quot;&gt;December 2018&lt;/a&gt; and &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/01/&quot;&gt;January 2019&lt;/a&gt; and mostly iterated what had been written above already. The discussion has - so far - not reached any consensus. There is still the &quot;systemd stance&quot; (&lt;a href=&quot;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=914297#59&quot;&gt;not our problem, fix the daemons&lt;/a&gt;) and the &quot;ssh/apache stance&quot; (&lt;a href=&quot;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=914297#66&quot;&gt;fix systemd, credit entropy&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The &quot;document in release notes&quot; minimal compromise was brought up again and Stefan &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/01/msg00129.html&quot;&gt;warned of the problems this would create for Buster users&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;
&gt; I&#039;d prefer having this documented in the release notes:
&gt; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916690
&gt; with possible solutions like installing haveged, configuring virtio-rng,
&gt; etc. depending on the situation.

That would be an extremely user-unfriendly &quot;solution&quot; and would lead to 
countless hours of debugging and useless bug reports.
&lt;/pre&gt;

&lt;p&gt;This is exactly why I wrote this blog entry and keep it updated. We need to either fix this or tell everybody we can reach before upgrading to Buster. Otherwise this will lead to huge amounts of systems dead on the network after what looked like a successful upgrade.&lt;/p&gt;

&lt;p&gt;Some interesting tidbits were mentioned within the thread:&lt;/p&gt;

&lt;p&gt;Raphael Hertzog fixed the issue for Kali Linux by &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/01/msg00120.html&quot;&gt;installing haveged by default&lt;/a&gt;. Michael Prokop did &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/01/msg00122.html&quot;&gt;the same for the grml distribution&lt;/a&gt; within its December 2018 release.&lt;/p&gt;

&lt;p&gt;Ben Hutchings pointed to an &lt;a href=&quot;https://lists.debian.org/debian-release/2018/05/threads.html#00130&quot;&gt;interesting thread&lt;/a&gt; on the debian-release mailing list he kicked off in May 2018. Multiple people summarized the options and the fact that there is no &lt;a href=&quot;https://lists.debian.org/debian-release/2018/05/msg00374.html&quot;&gt;&quot;general solution that is both correct and easy&quot;&lt;/a&gt; at the time.&lt;/p&gt;

&lt;p&gt;Sam Hartman identified Debian Buster VMs running under VMware as an issue, because that supervisor does not provide virtio-rng. So &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/01/msg00167.html&quot;&gt;Debian VMs wouldn&#039;t boot into ssh availability&lt;/a&gt; within a reasonable time. This is an issue for real world use cases albeit running a proprietary product as the supervisor.&lt;/p&gt;

&lt;h3&gt;16.01.2019&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://dkg.fifthhorseman.net/blog/&quot;&gt;Daniel Kahn Gillmor&lt;/a&gt; wrote in to explain a risk for VMs starting right after the boot of the host OS:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;
If that pool is used by the guest to generate long-term secrets because it appears to be well-initialized, that could be a serious problem.&lt;br /&gt;
(e.g. &quot;Mining your P&#039;s and Q&#039;s&quot; by Heninger et al -- &lt;a href=&quot;https://factorable.net/weakkeys12.extended.pdf&quot;&gt;https://factorable.net/weakkeys12.extended.pdf&lt;/a&gt;)&lt;br /&gt;
I&#039;ve just opened &lt;a href=&quot;https://bugs.launchpad.net/qemu/+bug/1811758&quot;&gt;https://bugs.launchpad.net/qemu/+bug/1811758&lt;/a&gt; to report a way to improve that situation in qemu by default.
&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;So ... make sure that your host OS has access to a hardware random number generator or at least carries over its random seed properly across reboots. You could also delay VM starts until the crng on the host Linux is fully initialized (&lt;code&gt;random: crng init done&lt;/code&gt;).&lt;br /&gt;
Otherwise your VMs may get insufficiently generated pseudo-random numbers and won&#039;t even know.&lt;/p&gt;

&lt;h3&gt;12.03.2019&lt;/h3&gt;

&lt;p&gt;Stefan Fritsch revived the &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/01/msg00079.html&quot;&gt;thread on debian-devel&lt;/a&gt; again and got a few more interesting tidbits out of the developer community:&lt;/p&gt;

&lt;p&gt;Ben Hutchings has &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/02/msg00170.html&quot;&gt;enabled CONFIG_RANDOM_TRUST_CPU for Debian kernels from 4.19.20-1&lt;/a&gt; so the problem is somewhat contained for recent CPU AMD64 systems (RDRAND capable) in Buster.&lt;/p&gt;

&lt;p&gt;Thorsten Glaser developed &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/02/msg00327.html&quot;&gt;early-rng-init-tools&lt;/a&gt; which combine a few options to try and get entropy carried across boot and generated early during boot. He received some &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/02/threads.html#00327&quot;&gt;scrutiny&lt;/a&gt; as can be expected but none that would discourage me from using it. He explains that this is for early boot and thus has initrd integration. It &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/02/msg00383.html&quot;&gt;complements safer randomness sources or haveged&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;16.04.2019&lt;/h3&gt;

&lt;p&gt;The Debian installer for Buster is running into the same problem now as indicated in the &lt;a href=&quot;https://lists.debian.org/debian-devel-announce/2019/04/msg00004.html&quot;&gt;release notes for RC1&lt;/a&gt;.
&lt;a href=&quot;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923675&quot;&gt;Bug #923675&lt;/a&gt; has details. Essentially &lt;code&gt;choose-mirror&lt;/code&gt; waits serveral minutes for entropy when used with https mirrors.&lt;/p&gt;

&lt;h3&gt;08.05.2019&lt;/h3&gt;

&lt;p&gt;The RDRAND use introduced in systemd to bypass the kernel random number generator during boot falls for a AMD pre-Ryzen bug as RDRAND on these systems doesn&#039;t return random data after a suspend / resume cycle. Added an update note to the &lt;a href=&quot;#systemd&quot;&gt;systemd section&lt;/a&gt; above.&lt;/p&gt;

&lt;h3&gt;03.06.2019&lt;/h3&gt;

&lt;p&gt;Bastian Blank reports the issue is &lt;a href=&quot;https://lists.debian.org/debian-devel/2019/06/msg00027.html&quot;&gt;affecting Debian cloud images&lt;/a&gt; now as well as cloud-init generates ssh keys during boot.&lt;/p&gt;

&lt;h3&gt;10.07.2019&lt;/h3&gt;

&lt;p&gt;Added the update of jitterentropy_rng to a version based on upstream v2.1.2 into the &lt;a href=&quot;#jitterentropy_rng&quot;&gt;Jitterentropy section above&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;16.09.2019&lt;/h3&gt;

&lt;p&gt;The Linux Kernel Mailing List (LKML) is re-iterating the entropy starvation issue and the un-willingness of systemd to fix its usage of randomness in early boot. Ahmed S. Darwish has &lt;a href=&quot;https://lore.kernel.org/linux-ext4/20190910042107.GA1517@darwi-home-pc/&quot;&gt;reported the issue leading to ext4 reproducibly blocking boot with Kernel 5.3-r8&lt;/a&gt;. There are a few patches floated and the whole discussion it worth reading albeit non-conclusive as of now.&lt;/p&gt;

&lt;blockquote&gt;Ted Ts&#039;o says &quot;I really very strongly believe that the idea of making getrandom(2) non-blocking and to blindly assume that we can load up the buffer with &#039;best efforts&#039; randomness to be a terrible, terrible idea that is going to cause major security problems that we will potentially regret very badly. Linus Torvalds believes I am an incompetent systems designer.&quot; in &lt;a href=&quot;https://lore.kernel.org/linux-ext4/20190915052242.GG19710@mit.edu/&quot;&gt;this email&lt;/a&gt;.&lt;/blockquote&gt;

&lt;p&gt;In case you needed a teaser to really start reading the thread! Linus Torvalds also mentions the issue (and a primer on what &quot;never break userspace&quot; means) in the &lt;a href=&quot;https://lkml.org/lkml/2019/9/15/241&quot;&gt;Linux kernel 5.3 release notes&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;18.09.2019&lt;/h3&gt;

&lt;p&gt;... and &lt;a href=&quot;https://lkml.org/lkml/2019/9/17/885&quot;&gt;Martin Steigerwald kindly noticed that I update this blog post&lt;/a&gt; with the relevant discussions I come across as this entropy starvation mess continues to haunt us.&lt;/p&gt;

&lt;h3&gt;25.11.2019&lt;/h3&gt;

&lt;p&gt;Added the &lt;a href=&quot;#linustotherescue&quot;&gt;&quot;Linus to the rescue&quot;&lt;/a&gt; section after the Linux kernel 5.4 has been released.&lt;/p&gt;

&lt;h3&gt;02.04.2020&lt;/h3&gt;

&lt;p&gt;I ran into the same issue on a Gentoo system today. Luckily &lt;a href=&quot;https://en.wikipedia.org/wiki/OpenRC&quot;&gt;OpenRC&lt;/a&gt; handeled this gracefully but it delayed booting:
&lt;code&gt;syslog-ng&lt;/code&gt; actually hangs the boot for some time ... waiting for entropy. Argh.
The &lt;a href=&quot;https://forums.gentoo.org/viewtopic-t-1053732-start-0.html&quot;&gt;Gentoo forums thread&lt;/a&gt; on the topic clearly listed the options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make syslog-ng depend on haveged by adding &lt;code&gt;rc_syslog_ng_need=&quot;haveged&quot;&lt;/code&gt; to &lt;code&gt;/etc/rc.conf&lt;/code&gt; (and obviously having haveged installed)&lt;/li&gt;
&lt;li&gt;Re-compiling the kernel with &lt;code&gt;CONFIG_RANDOM_TRUST_CPU=y&lt;/code&gt; where that is an option&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;footnotes&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;

&lt;li id=&quot;fn:1&quot;&gt;
&lt;p&gt;it will return with EAGAIN in the GRND_NONBLOCK use case. The blocking behaviour when lacking entropy is a security measure as per &lt;a href=&quot;https://bugs.chromium.org/p/project-zero/issues/detail?id=1559&quot;&gt;Bug #1559 of Google&#039;s Project Zero&lt;/a&gt;.&amp;#160;&lt;a href=&quot;#fnref:1&quot; rev=&quot;footnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id=&quot;fn:2&quot;&gt;
&lt;p&gt;Update 18.12.2018: &quot;SysVinit times&quot; ::= &quot;The times when most Linux distros used SysVinit over other init systems.&quot; So Wheezy and previous for Debian. Some people objected to the statement, so I added this footnote as a clarification. See the discussion in the comments below.&amp;#160;&lt;a href=&quot;#fnref:2&quot; rev=&quot;footnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id=&quot;fn:3&quot;&gt;
&lt;p&gt;there is no Buster branch in the release notes repository yet (17.12.2018). Update: I wrote a section for the release notes 06.05.2019 and Paul Gevers amended and committed that. So when users of affected systems read the release notes before upgrading to Buster they will hopefully not be surprised (and worried) by the long boot delays.&amp;#160;&lt;a href=&quot;#fnref:3&quot; rev=&quot;footnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;
&lt;/div&gt;
 
    </content:encoded>

    <pubDate>Mon, 17 Dec 2018 15:45:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/152-guid.html</guid>
    <category>alpine</category>
<category>apache</category>
<category>boot</category>
<category>debian</category>
<category>fedora</category>
<category>hang</category>
<category>linux</category>
<category>random</category>
<category>security</category>
<category>ssh</category>
<category>sshd</category>
<category>updated</category>

</item>
<item>
    <title>Unbalanced volume (channels) on headset audio</title>
    <link>https://daniel-lange.com/archives/144-Unbalanced-volume-channels-on-headset-audio.html</link>
            <category>Linux</category>
    
    <comments>https://daniel-lange.com/archives/144-Unbalanced-volume-channels-on-headset-audio.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=144</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=144</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;I use a headset to make phone calls and when they are mono the great awesomeness of the Linux audio stack seems to change volume only on the active channel (e.g. the right channel).
So when I listen to some music (stereo) afterwards the channels are not balanced anymore and one side is louder than the other. And this persists thanks to saving the preferences across reboots. Duh.&lt;/p&gt;

&lt;p&gt;As usually checking Pulseaudio (pavucontrol) is useless, it shows balanced channels.&lt;/p&gt;

&lt;p&gt;But checking Alsa (alsamixer) revealed the issue and alsamixer can fix this, too:&lt;/p&gt;

&lt;p&gt;Step 1: run &lt;code&gt;alsamixer&lt;/code&gt; in a terminal and select your headset after pressing [F6]:&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:649 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;848&quot; height=&quot;655&quot;  src=&quot;https://daniel-lange.com/uploads/entries/180604_alsamixer_select_sound_card.png&quot; title=&quot;Alsamixer: Select sound card&quot; alt=&quot;Alsamixer: Select sound card&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Select the headset audio output with [&amp;lt;-] and [-&gt;] cursor keys:&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:649 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;848&quot; height=&quot;655&quot;  src=&quot;https://daniel-lange.com/uploads/entries/180604_alsamixer_headset_uneven_loudness.png&quot; title=&quot;Alsamixer: Unbalanced channels on the headset (left / right channel loudness are different)&quot; alt=&quot;Alsamixer: Unbalanced channels on the headset (left / right channel loudness are different)&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Step 3: Press [b] to balance the left and right channels:&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:649 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;848&quot; height=&quot;655&quot;  src=&quot;https://daniel-lange.com/uploads/entries/180604_alsamixer_headset_balanced_loudness.png&quot; title=&quot;Alsamixer: Balanced channels (left / right channel loudness) again&quot; alt=&quot;Alsamixer: Balanced channels (left / right channel loudness) again&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Step 4: Press [Esc] to exit &lt;code&gt;alsamixer&lt;/code&gt; which will keep the changed settings (... great choice of key, [q] raises the left channel&#039;s loundness ...).&lt;/p&gt;

&lt;p&gt;Step 5: Save this setting by running &lt;code&gt;sudo alsactl store&lt;/code&gt; which should update &lt;code&gt;/var/lib/alsa/asound.state&lt;/code&gt; with the fixed settings so they persist across reboots.&lt;/p&gt;

&lt;p&gt;Step 6: Enjoy music again &lt;img src=&quot;https://daniel-lange.com/plugins/serendipity_event_emoticate/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; class=&quot;emoticon&quot; /&gt;.&lt;/p&gt;

&lt;p&gt;If you need to script this, &lt;code&gt;amixer&lt;/code&gt; is the tool to use, e.g. &lt;code&gt;amixer -c 1 set &quot;Headset&quot; 36&lt;/code&gt;.&lt;br /&gt;
&lt;i&gt;1&lt;/i&gt; is the card number which you see in &lt;code&gt;alsamixer&lt;/code&gt;,  &lt;i&gt;&quot;Headset&quot;&lt;/i&gt; is the channel name, also from &lt;code&gt;alsamixer&lt;/code&gt; (which can contain blanks, hence the quotes around the name) and &lt;i&gt;36&lt;/i&gt; is the desired loundness level for both channels. See the screenshots above where to find the data or run &lt;code&gt;aplay -l&lt;/code&gt; to see the cards on your PC and &lt;code&gt;amixer -c 1&lt;/code&gt; (with your card id) to see the channels that (virtual, USB) sound card has.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Mon, 04 Jun 2018 12:08:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/144-guid.html</guid>
    <category>alsa</category>
<category>audio</category>
<category>debian</category>
<category>headset</category>
<category>linux</category>
<category>loundness</category>
<category>mono</category>
<category>pulseaudio</category>
<category>sound</category>
<category>stereo</category>
<category>ubuntu</category>

</item>
<item>
    <title>Updating the Dell XPS 13 9360 Thunderbolt firmware to get VGA and HDMI working</title>
    <link>https://daniel-lange.com/archives/129-Updating-the-Dell-XPS-13-9360-Thunderbolt-firmware-to-get-VGA-and-HDMI-working.html</link>
            <category>IT</category>
    
    <comments>https://daniel-lange.com/archives/129-Updating-the-Dell-XPS-13-9360-Thunderbolt-firmware-to-get-VGA-and-HDMI-working.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=129</wfw:comment>

    <slash:comments>6</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=129</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;Last year I bought the wonderful Dell XPS 13 9360 as it is certified to work with Ubuntu Linux and is just all around an awesome device. Dell made me buy the Windows version as only that got a 1 TB NVMe-SSD option. Linux apparently is only worthy of the 512GB and below models. What product manager comes up with such a stupid idea? Are SKUs that precious? Anyways ... so I bought a Windows version and that got wiped with a Linux install immediately as that was and is its intended purpose.&lt;/p&gt;

&lt;p&gt;&lt;a class=&quot;serendipity_image_link&quot; title=&quot;Dell DA200 USB-C to HDMI/VGA/Ethernet/USB 3.0 adapter&quot; href=&#039;https://daniel-lange.com/uploads/entries/170406_Dell_DA200.jpg&#039; onclick=&quot;F1 = window.open(&#039;/uploads/entries/170406_Dell_DA200.jpg&#039;,&#039;Zoom&#039;,&#039;height=698,width=1039,top=258.5,left=448,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:640 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;109&quot; height=&quot;73&quot;  src=&quot;https://daniel-lange.com/uploads/entries/170406_Dell_DA200.serendipityThumb.jpg&quot; title=&quot;Dell DA200 USB-C to HDMI/VGA/Ethernet/USB 3.0 adapter&quot; alt=&quot;Dell DA200 USB-C to HDMI/VGA/Ethernet/USB 3.0 adapter&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I purchased a DA200 with the system which is Dell&#039;s USB-C to anything (HDMI/VGA/Ethernet/USB 3.0) dongle. When I got the laptop the Ethernet port and USB 3.0 via the DA200 were working right out of the box. The VGA and HDMI ports were detected by Ubuntu but there was no way to get connected screens working. They stayed black.&lt;/p&gt;

&lt;p&gt;The device was shipped with Thunderbolt firmware NVM18 and we&#039;ve been told rather quickly by Dell this would be fixed with an update. And lo and behold Dell &lt;a href=&quot;http://www.dell.com/support/home/en/en/debsdt1/product-support/product/xps-13-9360-laptop/drivers&quot; title=&quot;Dell website with drivers and firmware files for the XPS 13&quot; target=&quot;_blank&quot;&gt;published the firmware version NVM21&lt;/a&gt; right for Christmas 2016. Now unfortunately while their BIOS updates are Windows / DOS executables that can be just shoved at the Dell UEFI flash updater and thus the main BIOS can be updated from any OS, including Linux, without any hassle, the Intel provided Thunderbolt update needs Windows to get installed. Or, well, there is a &lt;a href=&quot;https://github.com/dell/thunderbolt-nvm-linux&quot; title=&quot;Dell github page with description of Thunderbolt updates in Linux&quot; target=&quot;_blank&quot;&gt;convoluted way to compile an out-of-tree Linux kernel module, download and compile a few sets of software and do it via Linux&lt;/a&gt;. That description read so lengthy, I didn&#039;t even try it. Additionally there seems to have been no progress at all in getting this more mainline in the last three months, so I chose the cheap route and installed Windows 10 on a USB thumb drive&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;This is done via the (unfortunately Windows only) &lt;a href=&quot;http://www.easyuefi.com/wintousb/&quot; title=&quot;Win2USB product site&quot; target=&quot;_blank&quot;&gt;Win2USB software&lt;/a&gt; (the free version is sufficient).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; There&#039;s a new bash script &lt;a href=&quot;https://github.com/ValdikSS/windows2usb&quot; title=&quot;windows2usb bash script on Github&quot; target=&quot;_blank&quot;&gt;windows2usb&lt;/a&gt; that looks good and should work to get you a bootable Windows USB thumb drive in Linux. WinUSB (that stopped working in the Win10 area some time) has also been forked and updated into &lt;a href=&quot;https://github.com/slacka/WoeUSB&quot; title=&quot;WoeUSB. A updated WinUSB fork&quot; target=&quot;_blank&quot;&gt;WoeUSB&lt;/a&gt;. And there is &lt;a href=&quot;https://gitlab.com/vaared/wintousblinux/&quot; title=&quot;WinToUSBLinux on Gitlab&quot;&gt;WinToUSBLinux&lt;/a&gt;, yet another shell script. Give them a try.&lt;/p&gt;

&lt;p&gt;Once Windows has rebooted often enough to finish its own installation, you can work with the USB thumb drive install as with any Windows 10. Nice.&lt;/p&gt;

&lt;div style=&quot;min-height: 90px;&quot;&gt;
&lt;a class=&quot;serendipity_image_link&quot; title=&quot;Dell TPM 1.2 to 2.0 firmware update&quot; href=&#039;https://daniel-lange.com/uploads/entries/170406_screenshot_TPM_update.png&#039; onclick=&quot;F1 = window.open(&#039;/uploads/entries/170406_screenshot_TPM_update.png&#039;,&#039;Zoom&#039;,&#039;height=789,width=1039,top=213,left=448,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:641 --&gt;&lt;img class=&quot;serendipity_image_left&quot; width=&quot;110&quot; height=&quot;83&quot;  src=&quot;https://daniel-lange.com/uploads/entries/170406_screenshot_TPM_update.serendipityThumb.png&quot; title=&quot;Dell TPM 1.2 to 2.0 firmware update&quot; alt=&quot;Dell TPM 1.2 to 2.0 firmware update&quot; /&gt;&lt;/a&gt;

&lt;p&gt;Put all the files you downloaded from Dell to update your XPS 13 into a directory on the USB thumb drive. That way Windows does not need to have any network connectivity.&lt;/p&gt;

I first updated the TPM 1.2 firmware to a TPM 2.0 version (DellTpm2.0_Fw1.3.2.8_V1_64.exe at the time of writing this blog entry). Now this is quite hilarious as the Windows installer doesn&#039;t do anything but putting a UEFI firmware update into the EFI partition that runs on reboot. Duh. You do need to manually clear the TPM in the BIOS&#039; security settings section (there&#039;s a clear checkbox) to be able to program new firmware onto it.
&lt;/div&gt;

&lt;div style=&quot;min-height: 90px;&quot;&gt;
&lt;a class=&quot;serendipity_image_link&quot; title=&quot;Thunderbolt firmware upgrade progress bar&quot; href=&#039;https://daniel-lange.com/uploads/entries/170406_screenshot_Thunderbolt_firmware_update.png&#039; onclick=&quot;F1 = window.open(&#039;/uploads/entries/170406_screenshot_Thunderbolt_firmware_update.png&#039;,&#039;Zoom&#039;,&#039;height=788,width=1039,top=213.5,left=448,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:642 --&gt;&lt;img class=&quot;serendipity_image_left&quot; width=&quot;110&quot; height=&quot;83&quot;  src=&quot;https://daniel-lange.com/uploads/entries/170406_screenshot_Thunderbolt_firmware_update.serendipityThumb.png&quot; title=&quot;Thunderbolt firmware upgrade progress bar&quot; alt=&quot;Thunderbolt firmware upgrade progress bar&quot; /&gt;&lt;/a&gt;
&lt;a class=&quot;serendipity_image_link&quot; title=&quot;Thunderbolt firmware upgrade successful&quot; href=&#039;https://daniel-lange.com/uploads/entries/170406_screenshot_Thunderbolt_firmware_successful.png&#039; onclick=&quot;F1 = window.open(&#039;/uploads/entries/170406_screenshot_Thunderbolt_firmware_successful.png&#039;,&#039;Zoom&#039;,&#039;height=789,width=1039,top=213,left=448,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:643 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;110&quot; height=&quot;83&quot;  src=&quot;https://daniel-lange.com/uploads/entries/170406_screenshot_Thunderbolt_firmware_successful.serendipityThumb.png&quot; title=&quot;Thunderbolt firmware upgrade successful&quot; alt=&quot;Thunderbolt firmware upgrade successful&quot; /&gt;&lt;/a&gt;

Now back in Windows install the Thunderbolt drivers (Chipset_Driver_J95RR_WN32_16.2.55.275_A01.exe at the time of writing this) and then run Intel_TBT3_FW_UPDATE_NVM21_0THFT_A00_3.21.00.008.exe, which is the NVM21 Thunderbolt firmware update (or a later version).
&lt;/div&gt;

&lt;p&gt;Reboot again (into Linux if you want to) and (drumroll) the VGA and HDMI ports are working.  Awesome.&lt;/p&gt;

&lt;p&gt;An update log can be found on the USB thumb drive at &lt;code&gt;Dell\UpdatePackage\Log\Intel_TBT3_FW_UPDATE_NVM21_0THFT_A00_3.log&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
*** Dell Thunderbolt firmware update started on 4/6/2017 at 12:56:56***
Command: C:\Install\Intel_TBT3_FW_UPDATE_NVM21_0THFT_A00_3.21.00.008.exe 

Starting FW Update....
***TBT GPIO Power is Turning On:  No Dock or DockInfo.
***TBT GPIO power is turned on.

Thunderbolt Firmware Update SUCCEEDED
TBT Items Registry creation is Success at \SOFTWARE\Dell\ManageableUpdatePackage\Thunderbolt Controller:
User selected OK for reboot
System TBT NVM Current Version:BCD:00000018: New Version:BCD:00000021

Exit Code = 0 (Success) 
***Thunderbolt Firmware flash finished at 4/6/2017 at 13:00:23***
&lt;/pre&gt;

&lt;p&gt;If Windows has added its boot loader entry into your UEFI options, you can easily remove that again with the Dell UEFI BIOS or efibootmgr from within Linux.&lt;/p&gt;

&lt;p&gt;The whole process took me less than 30 minutes. And most of that was creating the Windows USB thumb drive. I&#039;ll keep that for future updates until Intel and Dell have sorted out the Thunderbolt update process in Linux.&lt;/p&gt;

&lt;h3&gt;Updates:&lt;/h3&gt;

&lt;p&gt;18.05.17:
Intel has published a &lt;a href=&quot;http://lkml.iu.edu/hypermail/linux/kernel/1705.2/02534.html&quot; title=&quot;LKML: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade&quot;&gt;large patchset on &lt;abbr title=&quot;Linux Kernel Mailing List&quot;&gt;LKML&lt;/abbr&gt;&lt;/a&gt; to enable Thunderbolt security levels (thus preventing DMA attacks) and get NVM firmware upgrades mainlined. Yeah!&lt;/p&gt;

&lt;p&gt;02.05.18:
Added a link to the &lt;a href=&quot;https://github.com/ValdikSS/windows2usb&quot; title=&quot;windows2usb bash script on Github&quot; target=&quot;_blank&quot;&gt;windows2usb&lt;/a&gt; bash script that should remove the need to create a bootable Windows USB thumb drive with a Windows only software.&lt;/p&gt;

&lt;p&gt;11.06.18:
Added a link to &lt;a href=&quot;https://github.com/slacka/WoeUSB&quot; title=&quot;WoeUSB. A updated WinUSB fork&quot; target=&quot;_blank&quot;&gt;WoeUSB&lt;/a&gt; which is currently packaged for Ubuntu in a PPA.&lt;/p&gt;

&lt;p&gt;08.04.20:
Added a link to &lt;a href=&quot;https://gitlab.com/vaared/wintousblinux/&quot; title=&quot;WinToUSBLinux on Gitlab&quot;&gt;WinToUSBLinux&lt;/a&gt;. A recently released shell script to create a bootable Windows USB stick from Linux.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;

&lt;li id=&quot;fn:1&quot;&gt;
&lt;p&gt;If you go the Linux route please post a minimal image somewhere (kernel, initrd, squashfs or FAT16/32 raw image) and put a link into a comment below this blog post. Thanks.&amp;#160;&lt;a href=&quot;#fnref:1&quot; rev=&quot;footnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;
&lt;/div&gt;
 
    </content:encoded>

    <pubDate>Thu, 06 Apr 2017 14:45:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/129-guid.html</guid>
    <category>bios</category>
<category>dell</category>
<category>firmware</category>
<category>linux</category>
<category>thunderbolt</category>
<category>uefi</category>
<category>update</category>
<category>updated</category>
<category>windows</category>
<category>xps13</category>

</item>
<item>
    <title>Mozilla Firefox and Thunderbird Menu font sizes</title>
    <link>https://daniel-lange.com/archives/120-Mozilla-Firefox-and-Thunderbird-Menu-font-sizes.html</link>
            <category>Open Source</category>
    
    <comments>https://daniel-lange.com/archives/120-Mozilla-Firefox-and-Thunderbird-Menu-font-sizes.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=120</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=120</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;The font size Mozilla chose for Firefox and Thunderbird menus looks awfully large on Netbook screens. It wastes space and is visually at odds with reasonably sized content. And for some weird reason you can set the content font and size via the menu but not the font and size for the drop-down menus themselves.&lt;/p&gt;

&lt;p&gt;As the &quot;Theme Font &amp;amp; Size Changer&quot; Add-On doesn&#039;t work reliably and phones home way too often (showing a nag screen), I dug back into how to do this &quot;manually&quot;. Probably a decade after I fixed this the first time...&lt;/p&gt;

&lt;p&gt;You need to create the file &lt;code&gt;~/.mozilla/firefox/*/chrome/userChrome.css&lt;/code&gt;  with * being your profile directory (&amp;lt;random_number&amp;gt;.default usually) and you most probably have to create the &lt;code&gt;chrome&lt;/code&gt; directory first.&lt;/p&gt;

&lt;p&gt;The same for Thunderbird resides in &lt;code&gt;~/.thunderbird/*/chrome/userChrome.css&lt;/code&gt;. Here again the &lt;code&gt;chrome&lt;/code&gt; directory will most probably need to be created first.&lt;/p&gt;

&lt;div class=&quot;javascript geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;/* Global UI font */&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt; font&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;size&lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt; 10pt &lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt;important&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; font&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;family&lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt; Ubuntu &lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt;important&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;p&gt;needs to go into these files for Firefox or Thunderbird respectively. The curly braces are important. So copy &amp;amp; paste correctly. Symlinks or hardlinks are fine if those files do not need to differ between your web browser and your email client.&lt;/p&gt;

&lt;p&gt;Restart Firefox and/or Thunderbird to see the effect.&lt;/p&gt;

&lt;p&gt;Obviously you can choose any other font and font size in the snippet above to suit your taste and requirements.&lt;/p&gt;

&lt;p&gt;If you are massively space-confined and don&#039;t mind a quite ugly UI, check out the &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/littlefox-for-firefox/&quot;&gt;Littlefox Add-on&lt;/a&gt;. Ugly but optimal use of the minimal screen estate with very small screens.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Sun, 04 Sep 2016 11:37:57 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/120-guid.html</guid>
    <category>browser</category>
<category>client</category>
<category>design</category>
<category>email</category>
<category>firefox</category>
<category>font</category>
<category>linux</category>
<category>mozilla</category>
<category>screen</category>
<category>size</category>
<category>thunderbird</category>
<category>ui</category>

</item>
<item>
    <title>IPv6: Getting rid of the dreaded &quot;Neighbour table overflow&quot;</title>
    <link>https://daniel-lange.com/archives/109-IPv6-Getting-rid-of-the-dreaded-Neighbour-table-overflow.html</link>
            <category>Internet</category>
    
    <comments>https://daniel-lange.com/archives/109-IPv6-Getting-rid-of-the-dreaded-Neighbour-table-overflow.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=109</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=109</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;IPv6 is hard. It has many, many &lt;a href=&quot;https://cr.yp.to/djbdns/ipv6mess.html&quot; title=&quot;DJB&#039;s 2002 article on why IPv6 is a mess.&quot;&gt;design flaws&lt;/a&gt; and the decade where we all ignored it and hoped for the better hasn&#039;t helped.
So we&#039;re now all in on the protocol. Yeah.&lt;/p&gt;

&lt;p&gt;One of the design principles is that it tries to be rather stateless in the configuration and &quot;plug and play&quot;. But just like &lt;abbr title=&quot;Plug &amp;amp; Play (also known as Plug &amp;amp; Pray)&quot;&gt;P&amp;amp;P&lt;/abbr&gt; in the good old &lt;a href=&quot;https://en.wikipedia.org/wiki/Plug_and_play#ISA_and_PCI_self-configuration&quot; title=&quot;Wikipedia: Plug and Play ... ISA&quot;&gt;ISA times&lt;/a&gt;, it just doesn&#039;t always work.&lt;/p&gt;

&lt;p&gt;One of the common issues is that Linux bridges in IPv6 just don&#039;t work well with the router announcements that try to discover and configure the IPv6 neighbourhood.&lt;/p&gt;

&lt;p&gt;The result is a sheer endless amount of &quot;kernel: Neighbour table overflow.&quot; lines flooding dmesg and syslog (or journal for those on SystemD).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Oct  4 16:26:06 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:11 host-260 kernel: __ratelimit: 1832 callbacks suppressed
Oct  4 16:26:11 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:11 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:11 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:11 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:11 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:11 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:11 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:11 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:11 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:11 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:16 host-260 kernel: __ratelimit: 887 callbacks suppressed
Oct  4 16:26:16 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:16 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:16 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:16 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:16 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:16 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:16 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:16 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:16 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:16 host-260 kernel: Neighbour table overflow.
Oct  4 16:26:23 host-260 kernel: __ratelimit: 803 callbacks suppressed
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;!-- s9ymdb:617 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;568&quot; height=&quot;38&quot; src=&quot;https://daniel-lange.com/uploads/entries/151004_Neighbour_table_overflow.png&quot; title=&quot;Grep -c(ount) on syslog&quot; alt=&quot;Grep -c(ount) on syslog&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Lovely. Welcome to a storage &lt;abbr title=&quot;Denial of Service&quot;&gt;DOS&lt;/abbr&gt; waiting to happen.&lt;/p&gt;

&lt;p&gt;So first tip:
&lt;code&gt;cat /proc/sys/kernel/printk_ratelimit&lt;/code&gt; shows you the amount of seconds the ratelimiter suppresses messages. The default is 5 seconds and you can adjust it to more reasonable values in case you get heavily flooded like in the example above. Notice that this will mean your dmesg becomes rather useless as the kernel is not very selective about which messages to suppress.&lt;/p&gt;

&lt;p&gt;Now when you google &quot;Neighbour table overflow&quot;, you&#039;ll find thousands of pages suggesting to increase the arp / lladdr caches and garbage collection (gc) times like so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Set ARP cache garbage collection interval
net.ipv4.neigh.default.gc_interval = 3600
net.ipv6.neigh.default.gc_interval = 3600

# Set ARP cache entry timeout
net.ipv4.neigh.default.gc_stale_time = 3600
net.ipv6.neigh.default.gc_stale_time = 3600

# Setup cache threshold for ARP
net.ipv4.neigh.default.gc_thresh1 = 1024
net.ipv4.neigh.default.gc_thresh2 = 2048
net.ipv4.neigh.default.gc_thresh3 = 4096

# And the same for IPv6
net.ipv6.neigh.default.gc_thresh1 = 1024
net.ipv6.neigh.default.gc_thresh2 = 2048
net.ipv6.neigh.default.gc_thresh3 = 4096
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That helps if and only if you really have 500+ IPv6 neighbours. Unless you have a badly segmented network or run in a university lab, you don&#039;t.&lt;/p&gt;

&lt;p&gt;Now ... you may be seeing messages like &quot;kernel: vmbr0: Multicast hash table maximum of 512 reached, disabling snooping: eth0&quot; or &quot;kernel: vmbr0: Multicast hash table chain limit reached: eth0&quot; in your dmesg / syslog / journal.&lt;/p&gt;

&lt;p&gt;That hints at what is really happening here: The bridge confused the link-local router negotiation and so you get endless ff02:: neighbour routing entries added to your caches until they flow over. So increasing the caches as in the sysctl entries above is basically pasting band-aid over the problem.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ip route show cache table all&lt;/code&gt; will show you the tables. With all entries. See if you have too many ff02:: neighbours in there.
If so, you should try to add change your &lt;code&gt;/etc/network/interfaces&lt;/code&gt; on Debian / Ubuntu similar to this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;iface vmbr0 inet6 static
   address 2a02:0100:1:1::500:1
   netmask 64
   gateway 2a02:0100:1:1::1
   post-up echo 2048 &amp;gt; /sys/class/net/vmbr0/bridge/hash_max
   post-up echo 1 &amp;gt; /sys/class/net/vmbr0/bridge/multicast_snooping
   post-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/vmbr0/accept_ra
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This obviously assumes your bridge is called &lt;code&gt;vmbr0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Red Hat/CentOS users will need to adjust the config spread throughout multiple files in &lt;code&gt;/etc/sysconfig/network-scripts&lt;/code&gt;.
The &lt;code&gt;ifup-ipv6&lt;/code&gt; script is a good one to look at and amend.&lt;/p&gt;

&lt;p&gt;The increase of the hash_max entry makes your bridge survive the initial storm of (useless) router solicitations.&lt;br /&gt;
multicast_snooping is usually off when routing but you may need it to make sure your VMs on the bridge can be reached.&lt;br /&gt;
Finally we make sure the bridge does not accept router announcements. Because that is what the host system should handle.&lt;/p&gt;

&lt;p&gt;Sometimes you may need to throw in a static route or two to reach the VMs. &lt;abbr title=&quot;Plug &amp;amp; Play (also known as Plug &amp;amp; Pray)&quot;&gt;P&amp;amp;P&lt;/abbr&gt;, you remember ... &lt;code&gt;ip -6 neigh add nud permanent proxy &amp;lt;VM:IPv6:goes::here&amp;gt; dev vmbr0&lt;/code&gt; is your friend. Unfortunately the antidote for the dreaded &quot;Neighbour table overflow&quot; depends on the specific cause. So you&#039;ll have to poke around a bit. &lt;code&gt;tcpdump -i eth0 -v ip6&lt;/code&gt; will show you what is on the wire and &lt;code&gt;tcpdump -i vmbr0 -v ip6&lt;/code&gt; what&#039;s visible on the bridge.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Wed, 07 Oct 2015 16:25:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/109-guid.html</guid>
    <category>bridge</category>
<category>dmesg</category>
<category>flood</category>
<category>ipv6</category>
<category>linux</category>
<category>network</category>
<category>storm</category>
<category>sysconfig</category>
<category>sysctl</category>
<category>syslog</category>

</item>
<item>
    <title>How much memory does a process use on Linux?</title>
    <link>https://daniel-lange.com/archives/93-How-much-memory-does-a-process-use-on-Linux.html</link>
            <category>Linux</category>
    
    <comments>https://daniel-lange.com/archives/93-How-much-memory-does-a-process-use-on-Linux.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=93</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=93</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;Sometimes the easy questions are the hardest to answer.&lt;/p&gt;

&lt;p&gt;Memory can mean RSS (Resident Set Size) which is the memory of a process held in RAM (so not swapped out).
That does include shared memory allocations. So if you add two RSS numbers, you&#039;re probably wrong already.
Still this is usually the number we look for in most practical investigations.&lt;/p&gt;

&lt;p&gt;Then there is VSZ (Virtual Set siZe) also called SIZE. The VSZ includes code, data and stack segments a process has allocated.
And again that will count &lt;em&gt;some&lt;/em&gt; shared address space. So usually bash will have a VSZ that&#039;s lower than its RSS.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;man ps&lt;/code&gt; will also tell you:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;   The SIZE and RSS fields don&#039;t count some parts of a process including the page tables, kernel stack, struct
   thread_info, and struct task_struct.  This is usually at least 20 KiB of memory that is always resident.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In most (if not all) practical scenarios that difference won&#039;t matter. If it were, you&#039;d be using &lt;code&gt;valgrind&lt;/code&gt; to look into the memory usage of your application in minute detail. Wouldn&#039;t you?&lt;/p&gt;

&lt;p&gt;If you want to have an as-detailed-as-possible look into the memory allocations of a process &lt;code&gt;pmap &amp;lt;pid&amp;gt;&lt;/code&gt; will give you the information.
The summary at the end is a gross over-estimation of the total memory a process has allocated as it counts all mapped memory (and may still be wrong due to de-duplication and other factors). But that number may well serve as an upper bound if you need something like that.&lt;/p&gt;

&lt;p&gt;For running processes&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ps&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-eo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;pid user rss:8 size:8 cmd&#039;&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;--sort&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;rss&#039;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;p&gt;will give you a nice sorted list of processes and their RSS and VSZ (SIZE) in kiB (old school &lt;a href=&quot;http://en.wikipedia.org/wiki/Kibibyte&quot; title=&quot;Wikipedia article: Kibibytes&quot;&gt;kB&lt;/a&gt;...).&lt;/p&gt;

&lt;p&gt;For short running commands GNU &lt;code&gt;time&lt;/code&gt; (not the bash build-in &lt;code&gt;time&lt;/code&gt; command, &lt;code&gt;apt install time&lt;/code&gt; on Debian-based systems) has a nice capability that&#039;s not widely known yet:&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;usr&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;bin&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;time&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-f&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;RSS: %MkiB&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;command&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;p&gt;will tell you the maximum RSS size the &lt;code&gt;&amp;lt;command&amp;gt;&lt;/code&gt; has had during its lifetime. That&#039;s better than &lt;code&gt;top&lt;/code&gt; or &lt;code&gt;watch ps&lt;/code&gt; and trying to spot the process.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Fri, 06 Jun 2014 17:45:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/93-guid.html</guid>
    <category>address</category>
<category>linux</category>
<category>memory</category>
<category>ram</category>

</item>
<item>
    <title>Firefox opens directories in RawTherapee ... or a tale of colliding assumptions</title>
    <link>https://daniel-lange.com/archives/77-Firefox-opens-directories-in-RawTherapee-...-or-a-tale-of-colliding-assumptions.html</link>
            <category>Internet</category>
    
    <comments>https://daniel-lange.com/archives/77-Firefox-opens-directories-in-RawTherapee-...-or-a-tale-of-colliding-assumptions.html#comments</comments>
    <wfw:comment>https://daniel-lange.com/wfwcomment.php?cid=77</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>https://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=77</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;After installing &lt;a href=&quot;http://rawtherapee.com/&quot;&gt;RawTherapee&lt;/a&gt;, a raw photo to jpg image converter, on my Kubuntu 13.04 desktop, Mozilla Firefox started to open the Downloads directory in ... RawTherapee. Gosh. Now that&#039;s what you&#039;d want to browse a downloads folder with.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Update-alternatives&lt;/code&gt; did not help as RawTherapee is not managed by the &lt;a href=&quot;http://wiki.debian.org/DebianAlternatives&quot; title=&quot;Debian wiki entry: The Debian alternatives system&quot;&gt;Debian alternatives system&lt;/a&gt;. Hm, &lt;code&gt;xdg-open&lt;/code&gt; still works as intended and opens dolphin.&lt;/p&gt;

&lt;p&gt;Asking Google turns up &lt;a href=&quot;http://rubylution.ping.de/articles/2007/09/11/open-containing-folder-in-firefox-under-linux&quot;&gt;many&lt;/a&gt; &lt;a href=&quot;http://forums.fedoraforum.org/showthread.php?t=227756&quot;&gt;not&lt;/a&gt; &lt;a href=&quot;http://bewareofninjas.wordpress.com/2009/09/23/make-firefox-3-open-containing-folder-work-properly/&quot;&gt;working&lt;/a&gt; &lt;a href=&quot;https://support.mozilla.org/de/questions/938874&quot;&gt;solution&lt;/a&gt; &lt;a href=&quot;http://forums.linuxmint.com/viewtopic.php?f=110&amp;amp;t=114932&quot;&gt;proposals&lt;/a&gt;. Hm.&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:604 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;400&quot; height=&quot;235&quot;  src=&quot;https://daniel-lange.com/uploads/entries/130530_Firefox_Open_Containing_Folder.png&quot; title=&quot;Firefox screenshot&quot; alt=&quot;Firefox: Context menu (right click) -&gt; Open Containing Folder&quot; /&gt;&lt;/p&gt;

&lt;p&gt;But, searching the collective memory is not completely useless. There is a &lt;a href=&quot;http://code.google.com/p/rawtherapee/issues/detail?id=1398&quot; title=&quot;Issue 1398: Remove inode/directory from supported mime-types&quot;&gt;solved bug report&lt;/a&gt; on the RawTherapee bug tracker that explains the issue. The .desktop file RawTherapee installs contains &lt;code&gt;inode/directory&lt;/code&gt; as a supported mime type. Well, that&#039;s technically correct but makes no sense in the way mime associations are used. Thankfully the bug reporter was able to convince the developer of this and get this fixed for future RawTherapee releases.&lt;/p&gt;

&lt;p&gt;So &lt;strong&gt;option 1&lt;/strong&gt;: edit &lt;code&gt;/usr/share/applications/rawtherapee.desktop&lt;/code&gt; and remove the &lt;code&gt;inode/directory&lt;/code&gt; entry from the &lt;code&gt;MimeType=&lt;/code&gt;-line. Then regenerate the various mimetype caches.&lt;/p&gt;

&lt;p&gt;This still bears the question why Firefox does not use the &lt;code&gt;inode/directory&lt;/code&gt; entry from &lt;code&gt;dolphin.desktop&lt;/code&gt;. Also, the next update from Debian/Ubuntu will probably overwrite the fixed &lt;code&gt;rawtherapee.desktop&lt;/code&gt; file again as the patch from the Rawtherapee developer will only be included on new releases (and these may or may not be backported to Debian/Ubuntu). So you&#039;d need to copy that fixed &lt;code&gt;rawtherapee.desktop&lt;/code&gt; file to &lt;code&gt;~/.local/share/applications/&lt;/code&gt; or the like.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 2&lt;/strong&gt;: find out what the real issue is...&lt;/p&gt;
 &lt;a class=&quot;block_level&quot; href=&quot;https://daniel-lange.com/archives/77-Firefox-opens-directories-in-RawTherapee-...-or-a-tale-of-colliding-assumptions.html#extended&quot;&gt;Continue reading &quot;Firefox opens directories in RawTherapee ... or a tale of colliding assumptions&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 30 May 2013 23:00:00 +0000</pubDate>
    <guid isPermaLink="false">https://daniel-lange.com/archives/77-guid.html</guid>
    <category>bug</category>
<category>dolphin</category>
<category>freedesktop</category>
<category>gnome</category>
<category>kde</category>
<category>linux</category>
<category>mime</category>
<category>mimetypes</category>
<category>nautilus</category>
<category>rawtherapee</category>
<category>standard</category>
<category>updated</category>

</item>

</channel>
</rss>
