Aquileo | Linux Kernel Monkey Loghttp://www.kroah.com/log/ Recent content on Linux Kernel Monkey LogHugoen-usMon, 16 Feb 2026 00:00:00 +0000Aquileo | Linux CVE assignment processhttp://www.kroah.com/log/blog/2026/02/16/linux-cve-assignment-process/ Mon, 16 Feb 2026 00:00:00 +0000http://www.kroah.com/log/blog/2026/02/16/linux-cve-assignment-process/<p>As <a href="http://www.kroah.com/log/blog/2026/01/02/linux-kernel-security-work/">described previously</a>, the Linux kernel security team does not identify or mark or announce any sort of security fixes that are made to the Linux kernel tree. So how, if the Linux kernel were to become a CVE Numbering Authority (CNA) and responsible for issuing CVEs, would the identification of security fixes happen in a way that can be done by a volunteer staff? This post goes into the process of how kernel fixes are currently automatically assigned to CVEs, and also the other &ldquo;out of band&rdquo; ways a CVE can be issued for the Linux kernel project.</p>Aquileo | Linux kernel security workhttp://www.kroah.com/log/blog/2026/01/02/linux-kernel-security-work/ Fri, 02 Jan 2026 00:00:00 +0000http://www.kroah.com/log/blog/2026/01/02/linux-kernel-security-work/<p>Lots of the CVE world seems to focus on &ldquo;security bugs&rdquo; but I&rsquo;ve found that it is not all that well known exactly how the Linux kernel security process works. I gave a <a href="https://www.linuxfoundation.org/webinars/demystifying-the-linux-kernel-security-process">talk about this back in 2023</a> and at other conferences since then, attempting to explain how it works, but I also thought it would be good to explain this all in writing as it is required to know this when trying to understand how the Linux kernel CNA issues CVEs.</p>Aquileo | Tracking kernel commits across brancheshttp://www.kroah.com/log/blog/2025/12/15/tracking-kernel-commits-across-branches/ Mon, 15 Dec 2025 00:00:00 +0000http://www.kroah.com/log/blog/2025/12/15/tracking-kernel-commits-across-branches/<p>With all of the different Linux kernel stable releases happening (at least 1 stable branch and multiple longterm branches are active at any one point in time), keeping track of what commits are already applied to what branch, and what branch specific fixes should be applied to, can quickly get to be a very complex task if you attempt to do this manually. So I&rsquo;ve created some tools to help make my life easier when doing the stable kernel maintenance work, which ended up making the work of tracking CVEs much simpler to manage in an automated way.</p>Aquileo | Linux kernel version numbershttp://www.kroah.com/log/blog/2025/12/09/linux-kernel-version-numbers/ Tue, 09 Dec 2025 00:00:00 +0000http://www.kroah.com/log/blog/2025/12/09/linux-kernel-version-numbers/<p>Despite having a stable release model and cadence since December 2003, Linux kernel version numbers seem to baffle and confuse those that run across them, causing numerous groups to mistakenly make versioning statements that are flat out false. So let&rsquo;s go into how this all works in detail.</p>Aquileo | Linux CVEs, more than you ever wanted to knowhttp://www.kroah.com/log/blog/2025/12/08/linux-cves-more-than-you-ever-wanted-to-know/ Mon, 08 Dec 2025 00:00:00 +0000http://www.kroah.com/log/blog/2025/12/08/linux-cves-more-than-you-ever-wanted-to-know/<p>It&rsquo;s been almost 2 full years since <a href="http://www.kroah.com/log/blog/2024/02/13/linux-is-a-cna/">Linux became a CNA (Certificate Numbering Authority)</a> which meant that we (i.e. the kernel.org community) are now responsible for issuing all CVEs for the Linux kernel. During this time, we&rsquo;ve become one of the largest creators of CVEs by quantity, going from nothing to number 3 in 2024 to number 1 in 2025. Naturally, this has caused some questions about how we are both doing all of this work, and how people can keep track of it.</p>Aquileo | The only benchmark that matters is...http://www.kroah.com/log/blog/2025/10/01/the-only-benchmark-that-matters-is.../ Wed, 01 Oct 2025 00:00:00 +0000http://www.kroah.com/log/blog/2025/10/01/the-only-benchmark-that-matters-is.../<p>&hellip;the one that emulates your real workload. And for me (and probably many of you reading this), that would be &ldquo;build a kernel as fast as possible.&rdquo; And for that, I recommend the simple <a href="https://gitlab.com/knurd42/kcbench">kcbench</a>.</p> <p>I kcbench mentioned it a few years ago, when <a href="http://www.kroah.com/log/blog/2020/09/18/fast-kernel-builds/">writing about a new workstation</a> that Level One Techs set up for me, and I&rsquo;ve been using that as my primary workstation ever since (just over 5 years!).</p>Aquileo | Linux is a CNAhttp://www.kroah.com/log/blog/2024/02/13/linux-is-a-cna/ Tue, 13 Feb 2024 00:00:00 +0000http://www.kroah.com/log/blog/2024/02/13/linux-is-a-cna/<p>As was <a href="https://www.cve.org/Media/News/item/news/2024/02/13/kernel-org-Added-as-CNA">recently announced</a>, the Linux kernel project has been accepted as a CNA as a CVE Numbering Authority (CNA) for vulnerabilities found in Linux.</p> <p>This is a trend, of more open source projects taking over the haphazard assignments of CVEs against their project by becoming a CNA so that no other group can assign CVEs without their involvment. Here&rsquo;s the <a href="https://daniel.haxx.se/blog/2024/01/16/curl-is-a-cna/">curl project</a> doing much the same thing for the same reasons. I&rsquo;d like to point out the great work that the <a href="https://www.cve.org/Media/News/item/news/2023/08/29/Python-Software-Foundation-Added-as-CNA">Python project</a> has done in supporting this effort, and the <a href="https://openssf.org/">OpenSSF project</a> also encouraging it and providing documentation and help for open source projects to accomplish this. I&rsquo;d also like to thank the <a href="https://www.cve.org">cve.org</a> group and board as they all made the application process very smooth for us and provided loads of help in making this all possible.</p>Aquileo | Abouthttp://www.kroah.com/log/about/ Fri, 17 Feb 2023 16:56:18 +0100http://www.kroah.com/log/about/<p>Greg is a Fellow at the Linux Foundation and is responsible for the Linux kernel stable releases. He is also the maintainer of a variety of different kernel subsystems (USB, char/misc, tty/serial, driver core, staging, etc.) and has written a few books and articles about Linux kernel development.</p> <p><a href="https://en.wikipedia.org/wiki/Greg_Kroah-Hartman">Wikipedia entry that is usually very out of date</a></p> <p><a href="https://www.reddit.com/r/linux/comments/fx5e4v/im_greg_kroahhartman_linux_kernel_developer_ama/">reddit AMA in 2020</a></p> <p><a href="https://www.reddit.com/r/linux/comments/2ny1lz/im_greg_kroahhartman_linux_kernel_developer_ama/">reddit AMA in 2015</a></p> <p><a href="https://usesthis.com/interviews/greg.kh/">Greg&rsquo;s setup back in 2012</a></p>Aquileo | 8 Bits Are Enough for a Version Number...http://www.kroah.com/log/blog/2021/02/05/8-bits-are-enough-for-a-version-number.../ Fri, 05 Feb 2021 00:00:00 +0000http://www.kroah.com/log/blog/2021/02/05/8-bits-are-enough-for-a-version-number.../<p>As was <a href="https://lore.kernel.org/lkml/7pR0YCctzN9phpuEChlL7_SS6auHOM80bZBcGBTZPuMkc6XjKw7HUXf9vZUPi-IaV2gTtsRVXgywQbja8xpzjGRDGWJsVYSGQN5sNuX1yaQ=@protonmail.com/">pointed out</a> to us stable kernel maintainers last week, the overflow of the .y release number was going to happen soon, and our proposed solution for it (use 16 bits instead of 8), turns out to be breaking a userspace-visable api.</p> <p>As we can&rsquo;t really break this, I did a release of the <a href="https://lore.kernel.org/r/1612534196241236@kroah.com">4.4.256</a> and <a href="https://lore.kernel.org/r/1612535085125226@kroah.com">4.9.256</a> releases today that contain nothing but a new version number. See the links for the full technical details if curious.</p>Aquileo | Helping Out With Lts Kernel Releaseshttp://www.kroah.com/log/blog/2021/02/03/helping-out-with-lts-kernel-releases/ Wed, 03 Feb 2021 00:00:00 +0000http://www.kroah.com/log/blog/2021/02/03/helping-out-with-lts-kernel-releases/<p>A recent email thread about <a href="https://lore.kernel.org/linux-arm-kernel/YBBkplRxzzmPYKC+@kroah.com/">&ldquo;Why isn&rsquo;t the 5.10 stable kernel listed as supported for 6 years yet!&rdquo;</a> on the linux-kernel mailing list ended up generating a bunch of direct emails to me asking what could different companies and individuals due to help out. What exactly was I looking for here?</p> <p>Instead of having to respond to private emails with the same information over and over, I figured it was better to just put it here so that everyone can see what exactly I am expecting with regards to support in order to be able to maintain a kernel for longer than 2 years:</p>Aquileo | Fast Kernel Buildshttp://www.kroah.com/log/blog/2020/09/18/fast-kernel-builds/ Fri, 18 Sep 2020 00:00:00 +0000http://www.kroah.com/log/blog/2020/09/18/fast-kernel-builds/<p>A number of months ago I did an <a href="https://www.reddit.com/r/linux/comments/fx5e4v/im_greg_kroahhartman_linux_kernel_developer_ama/">&ldquo;Ask Me Anything&rdquo;</a> interview on <a href="https://www.reddit.com/r/linux/">r/linux</a> on redit. As part of that, a discussion of the hardware I used came up, and someone said, &ldquo;I know someone that can get you a new machine&rdquo; &ldquo;get that person a new machine!&rdquo; or something like that.</p> <p>Fast forward a few months, and a &ldquo;beefy&rdquo; AMD Threadwripper 3970X shows up on my doorstep thanks to the amazing work of Wendell Wilson at Level One Techs.</p>Aquileo | Patch Workflow With Mutt 2019http://www.kroah.com/log/blog/2019/08/14/patch-workflow-with-mutt-2019/ Wed, 14 Aug 2019 00:00:00 +0000http://www.kroah.com/log/blog/2019/08/14/patch-workflow-with-mutt-2019/<p>Given that the main development workflow for most kernel maintainers is with email, I spend a lot of time in my email client. For the past few decades I have used (<a href="http://mutt.org">mutt</a>), but every once in a while I look around to see if there is anything else out there that might work better.</p> <p>One project that looks promising is (<a href="https://aerc-mail.org/">aerc</a>) which was started by (<a href="https://drewdevault.com/">Drew DeVault</a>). It is a terminal-based email client written in Go, and relies on a lot of other go libraries to handle a lot of the &ldquo;grungy&rdquo; work in dealing with imap clients, email parsing, and other fun things when it comes to free-flow text parsing that emails require.</p>Aquileo | Linux Stable Tree Mirror at Githubhttp://www.kroah.com/log/blog/2019/06/15/linux-stable-tree-mirror-at-github/ Sat, 15 Jun 2019 00:00:00 +0000http://www.kroah.com/log/blog/2019/06/15/linux-stable-tree-mirror-at-github/<p>As everyone seems to like to put kernel trees up on github for random projects (based on the crazy notifications I get all the time), I figured it was time to put up a semi-official mirror of all of the stable kernel releases on github.com</p> <p>It can be found at: <a href="https://github.com/gregkh/linux">https://github.com/gregkh/linux</a> and I will try to keep it up to date with the real source of all kernel stable releases at <a href="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/">https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/</a></p>Aquileo | What Stable Kernel Should I Usehttp://www.kroah.com/log/blog/2018/08/24/what-stable-kernel-should-i-use/ Fri, 24 Aug 2018 00:00:00 +0000http://www.kroah.com/log/blog/2018/08/24/what-stable-kernel-should-i-use/<p>I get a lot of questions about people asking me about what stable kernel should they be using for their product/device/laptop/server/etc. all the time. Especially given the now-extended length of time that some kernels are being supported by me and others, this isn&rsquo;t always a very obvious thing to determine. So this post is an attempt to write down my opinions on the matter. Of course, you are free to use what ever kernel version you want, but here&rsquo;s what I recommend.</p>Aquileo | Affidavithttp://www.kroah.com/log/blog/2018/03/10/affidavit/ Sat, 10 Mar 2018 00:00:00 +0000http://www.kroah.com/log/blog/2018/03/10/affidavit/<p>As many people know, last week there was a court hearing in the Geniatech vs. McHardy case. This was a case brought claiming a license violation of the Linux kernel in Geniatech devices in the German court of OLG Cologne.</p> <p>Harald Welte has written up a <a href="http://laforge.gnumonks.org/blog/20180307-mchardy-gpl/">wonderful summary of the hearing</a>, I strongly recommend that everyone go read that first.</p> <p>In Harald&rsquo;s summary, he refers to an affidavit that I provided to the court. Because the case was withdrawn by McHardy, my affidavit was not entered into the public record. I had always assumed that my affidavit would be made public, and since I have had a number of people ask me about what it contained, I figured it was good to just publish it for everyone to be able to see it.</p>Aquileo | Linux Kernel Release Modelhttp://www.kroah.com/log/blog/2018/02/05/linux-kernel-release-model/ Mon, 05 Feb 2018 00:00:00 +0000http://www.kroah.com/log/blog/2018/02/05/linux-kernel-release-model/<h4 id="note">Note</h4> <p>This post is based on a whitepaper I wrote at the beginning of 2016 to be used to help many different companies understand the Linux kernel release model and encourage them to start taking the LTS stable updates more often. I then used it as a basis of a presentation I gave at the <a href="https://kernel-recipes.org/en/2017/">Linux Recipes conference in September 2017</a> which can be seen <a href="https://www.youtube.com/watch?v=RKadXpQLmPU">here</a>.</p> <p>With the <a href="http://www.kroah.com/log/blog/2018/01/06/meltdown-status/">recent craziness of Meltdown and Spectre</a> , I&rsquo;ve seen lots of things written about how Linux is released and how we handle handles security patches that are totally incorrect, so I figured it is time to dust off the text, update it in a few places, and publish this here for everyone to benefit from.</p>Aquileo | Meltdown and Spectre Linux Kernel Status - Updatehttp://www.kroah.com/log/blog/2018/01/19/meltdown-and-spectre-linux-kernel-status-update/ Fri, 19 Jan 2018 00:00:00 +0000http://www.kroah.com/log/blog/2018/01/19/meltdown-and-spectre-linux-kernel-status-update/<p>I keep getting a lot of private emails about my <a href="http://www.kroah.com/log/blog/2018/01/06/meltdown-status/">previous post</a> about the latest status of the Linux kernel patches to resolve both the Meltdown and Spectre issues.</p> <p>These questions all seem to break down into two different categories, &ldquo;What is the state of the Spectre kernel patches?&rdquo;, and &ldquo;Is my machine vunlerable?&rdquo;</p> <h2 id="state-of-the-kernel-patches">State of the kernel patches</h2> <p>As always, <a href="https://lwn.net/Articles/744287/">lwn.net covers the technical details</a> about the latest state of the kernel patches to resolve the Spectre issues, so please go read that to find out that type of information.</p>Aquileo | Meltdown and Spectre Linux Kernel Statushttp://www.kroah.com/log/blog/2018/01/06/meltdown-and-spectre-linux-kernel-status/ Sat, 06 Jan 2018 00:00:00 +0000http://www.kroah.com/log/blog/2018/01/06/meltdown-and-spectre-linux-kernel-status/<p>By now, everyone knows that something &ldquo;big&rdquo; just got announced regarding computer security. Heck, when the <a href="http://www.dailymail.co.uk/sciencetech/article-5238789/Intel-says-security-updates-fix-Meltdown-Spectre.html">Daily Mail does a report on it</a> , you know something is bad&hellip;</p> <p>Anyway, I&rsquo;m not going to go into the details about the problems being reported, other than to point you at the wonderfully written <a href="https://googleprojectzero.blogspot.fr/2018/01/reading-privileged-memory-with-side.html">Project Zero paper on the issues involved here</a>. They should just give out the 2018 <a href="https://pwnies.com/">Pwnie</a> award right now, it&rsquo;s that amazingly good.</p>Aquileo | Linux Kernel Community Enforcement Statementhttp://www.kroah.com/log/blog/2017/10/16/linux-kernel-community-enforcement-statement/ Mon, 16 Oct 2017 00:00:00 +0000http://www.kroah.com/log/blog/2017/10/16/linux-kernel-community-enforcement-statement/<p>By Greg Kroah-Hartman, Chris Mason, Rik van Riel, Shuah Khan, and Grant Likely</p> <p>The Linux kernel ecosystem of developers, companies and users has been wildly successful by any measure over the last couple decades. Even today, 26 years after the initial creation of the Linux kernel, the kernel developer community continues to grow, with more than 500 different companies and over 4,000 different developers getting changes merged into the tree during the past year. As Greg always says every year, the kernel continues to change faster this year than the last, this year we were running around 8.5 changes an hour, with 10,000 lines of code added, 2,000 modified, and 2,500 lines removed every hour of every day.</p>Aquileo | Linux Kernel Community Enforcement Statement FAQhttp://www.kroah.com/log/blog/2017/10/16/linux-kernel-community-enforcement-statement-faq/ Mon, 16 Oct 2017 00:00:00 +0000http://www.kroah.com/log/blog/2017/10/16/linux-kernel-community-enforcement-statement-faq/<p>Based on the recent Linux Kernel Community Enforcement Statement and <a href="http://kroah.com/log/blog/2017/10/16/linux-kernel-community-enforcement-statement/">the article describing the background and what it means</a> , here are some Questions/Answers to help clear things up. These are based on questions that came up when the statement was discussed among the initial round of over 200 different kernel developers.</p> <p><strong>Q:</strong> Is this changing the license of the kernel?</p> <p><strong>A:</strong> No.</p> <p><strong>Q:</strong> Seriously? It really looks like a change to the license.</p>Aquileo | 4.14 == This Years LTS Kernelhttp://www.kroah.com/log/blog/2017/09/06/4.14-this-years-lts-kernel/ Wed, 06 Sep 2017 00:00:00 +0000http://www.kroah.com/log/blog/2017/09/06/4.14-this-years-lts-kernel/<p>As the <a href="https://lwn.net/Articles/732793/">4.13 release has now happened</a>, the merge window for the 4.14 kernel release is now open. I mentioned <a href="https://plus.google.com/u/0/+gregkroahhartman/posts/DmKQJZMVTXG">this many weeks ago</a>, but as the word doesn&rsquo;t seem to have gotten very far based on various emails I&rsquo;ve had recently, I figured I need to say it here as well.</p> <p>So, here it is officially, 4.14 should be the next LTS kernel that I&rsquo;ll be supporting with stable kernel patch backports for at least two years, unless it really is a horrid release and has major problems. If so, I reserve the right to pick a different kernel, but odds are, given just how well our development cycle has been going, that shouldn&rsquo;t be a problem (although I guess I just doomed it now&hellip;)</p>Aquileo | 4.9 == Next Lts Kernelhttp://www.kroah.com/log/blog/2016/09/06/4.9-next-lts-kernel/ Tue, 06 Sep 2016 00:00:00 +0000http://www.kroah.com/log/blog/2016/09/06/4.9-next-lts-kernel/<p>As I <a href="https://plus.google.com/u/0/+gregkroahhartman/posts/DjCWwSo7kqY">briefly mentioned</a> a few weeks ago on my G+ page, the plan is for the 4.9 Linux kernel release to be the next &ldquo;Long Term Supported&rdquo; (LTS) kernel.</p> <p>Last year, at the Linux Kernel Summit, <a href="https://lwn.net/Articles/662966/">we discussed</a> just how to pick the LTS kernel. Many years ago, we tried to let everyone know ahead of time what the kernel version would be, but that caused a lot of problems as people threw crud in there that really wasn&rsquo;t ready to be merged, just to make it easier for their &ldquo;day job&rdquo;. That was many years ago, and people insist they aren&rsquo;t going to do this again, so let&rsquo;s see what happens.</p>Aquileo | Kdbus Detailshttp://www.kroah.com/log/blog/2014/01/15/kdbus-details/ Wed, 15 Jan 2014 00:00:00 +0000http://www.kroah.com/log/blog/2014/01/15/kdbus-details/<p>Now that linux.conf.au is over, there has been a bunch of information running around about the status of <tt>kdbus</tt> and the integration of it with <tt>systemd</tt>. So, here&rsquo;s a short summary of what&rsquo;s going on at the moment.</p> <p><a href="http://0pointer.de/lennart/">Lennart Poettering</a> gave a <a href="http://linux.conf.au/schedule/30120/view_talk?day=friday">talk</a> about <tt>kdbus</tt> at linux.conf.au. The talk can be viewed <a href="http://mirror.linux.org.au/pub/linux.conf.au/2014/Friday/104-D-Bus_in_the_kernel_-_Lennart_Poettering.mp4">here</a>, and the slides are <a href="http://0pointer.de/public/lca.pdf">here</a>. Go read the slides and watch the talk, odds are, most of your questions will be answered there already.</p>Aquileo | Binary Blos to C Structureshttp://www.kroah.com/log/blog/2013/09/11/binary-blos-to-c-structures/ Wed, 11 Sep 2013 00:00:00 +0000http://www.kroah.com/log/blog/2013/09/11/binary-blos-to-c-structures/<p>Sometimes you don&rsquo;t have access to vim&rsquo;s wonderful <a href="http://linuxcommand.org/man_pages/xxd1.html"><tt>xxd</tt></a> tool, and you need to use it to generate some <tt>.c</tt> code based on a binary file. This happened to me recently when packaging up the <a href="http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-crypt/efitools/">EFI signing tools for Gentoo.</a> Adding a build requirement of vim for a single autogenerated file was not an option for some users, so I created a perl version of the <code>xxd -i</code> command line tool.</p> <p>This works because everyone has perl in their build systems, whether they like it or not. Instead of burying it in the <tt>efitools</tt> package, here&rsquo;s a copy of it for others to use if they want/need it.</p>Aquileo | Booting a Self Signed Linux Kernelhttp://www.kroah.com/log/blog/2013/09/02/booting-a-self-signed-linux-kernel/ Mon, 02 Sep 2013 00:00:00 +0000http://www.kroah.com/log/blog/2013/09/02/booting-a-self-signed-linux-kernel/<p>Now that <a href="http://www.linuxfoundation.org/">The Linux Foundation</a> is a member of the <a href="http://www.uefi.org/">UEFI.org</a> group, I&rsquo;ve been working on the procedures for how to boot a self-signed Linux kernel on a platform so that you do not have to rely on any external signing authority.</p> <p>After digging through the documentation out there, it turns out to be relatively simple in the end, so here&rsquo;s a recipe for how I did this, and how you can duplicate it yourself on your own machine.</p>Aquileo | Longterm Kernel 3.10http://www.kroah.com/log/blog/2013/08/04/longterm-kernel-3.10/ Sun, 04 Aug 2013 00:00:00 +0000http://www.kroah.com/log/blog/2013/08/04/longterm-kernel-3.10/<p>As I&rsquo;ve <a href="http://www.kroah.com/log/linux/longterm-proposal-08-2011.html">discussed in the past</a>, I will be selecting one &ldquo;longterm stable&rdquo; kernel release every year, and maintain that kernel release for at least two years.</p> <p>Despite the fact that the 3.10-stable kernel releases are not slowing down at all, and there are plenty of pending patches already lined up for the next few releases, I figured it was a good time to let everyone know now that I&rsquo;m picking the 3.10 kernel release as the next longterm kernel, so they can start planning things around it if needed.</p>Aquileo | 3.10 Kernel Development Ratehttp://www.kroah.com/log/blog/2013/07/01/3.10-kernel-development-rate/ Mon, 01 Jul 2013 00:00:00 +0000http://www.kroah.com/log/blog/2013/07/01/3.10-kernel-development-rate/<p>While working on the latest statistics for the yearly Linux Foundation &ldquo;Who Writes Linux&rdquo; paper, I noticed the rate-of-change for the 3.10 kernel release that just happened this weekend:</p> <p><img src="http://files.kroah.com/images/kernel_3.10_rate.png" alt="3.10 rate" title="3.10 development rate"></p> <p>Every year I think we can&rsquo;t go faster, and every year I&rsquo;m wrong.</p> <p>Note, the &ldquo;number of employers&rdquo; row is not correct, I haven&rsquo;t updated those numbers yet, that takes a lot more work, which I will be doing this week.</p>Aquileo | How to Create a sysfs File Correctlyhttp://www.kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/ Wed, 26 Jun 2013 00:00:00 +0000http://www.kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/<p>One common Linux kernel driver issue that I see all the time is a driver author attempting to create a <tt>sysfs</tt> file in their code by doing something like:</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-c" data-lang="c"><span class="line"><span class="cl"><span class="kt">int</span> <span class="nf">my_driver_probe</span><span class="p">(...)</span> </span></span><span class="line"><span class="cl"><span class="p">{</span> </span></span><span class="line"><span class="cl"> <span class="p">...</span> </span></span><span class="line"><span class="cl"> <span class="n">retval</span> <span class="o">=</span> <span class="nf">device_create_file</span><span class="p">(</span><span class="n">my_device</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">my_first_attribute</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="n">retval</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">goto</span> <span class="n">error1</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> <span class="n">retval</span> <span class="o">=</span> <span class="nf">device_create_file</span><span class="p">(</span><span class="n">my_device</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">my_second_attribute</span><span class="p">);</span> </span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="n">retval</span><span class="p">)</span> </span></span><span class="line"><span class="cl"> <span class="k">goto</span> <span class="n">error2</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> <span class="p">...</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> </span></span><span class="line"><span class="cl"> </span></span><span class="line"><span class="cl"><span class="nl">error2</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="nf">device_remove_file</span><span class="p">(</span><span class="n">my_device</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">my_first_attribute</span><span class="p">);</span> </span></span><span class="line"><span class="cl"><span class="nl">error1</span><span class="p">:</span> </span></span><span class="line"><span class="cl"> <span class="cm">/* Clean up other things and return an error */</span> </span></span><span class="line"><span class="cl"> <span class="p">...</span> </span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="o">-</span><span class="n">ENODEV</span><span class="p">;</span> </span></span><span class="line"><span class="cl"><span class="p">}</span> </span></span></code></pre></div><p>That&rsquo;s a good first start, until they get tired of adding more and more <tt>sysfs</tt> files, and they discover attribute groups, which allows multiple <tt>sysfs</tt> files to be created and destroyed all at once, without having to handle the unwinding of things if problems occur:</p>Aquileo | Hardware, Past, Present, and Futurehttp://www.kroah.com/log/blog/2013/06/20/hardware-past-present-and-future/ Thu, 20 Jun 2013 00:00:00 +0000http://www.kroah.com/log/blog/2013/06/20/hardware-past-present-and-future/<p>Here&rsquo;s some thoughts about some hardware I was going to use, hardware I use daily, and hardware I&rsquo;ll probably use someday in the future.</p> <h2 id="thunderbolt-is-dead-long-live-thunderbolt">Thunderbolt is dead, long live Thunderbolt.</h2> <p>Seriously, it&rsquo;s dead, use it as a video interconnect and don&rsquo;t worry about anything else.</p> <p>Ok, some more explanation is probably in order&hellip;</p> <p>Back in October of 2012, after a meeting with some very smart Intel engineers, I ended up the proud owner of a machine with Thunderbolt support, some hard disks with Thunderbolt interfaces, and most importantly, access to the super-secret Thunderbolt specification on how to make this whole thing work properly on Linux. I also had a MacBook Pro with a Thunderbolt interface which is what I really wanted to get working.</p>