SlideShare a Scribd company logo
KERNEL DEVELOPMENT:
DRAWING LESSONS FROM
      "MISTAKES"
    Japan Linux Symposium 2009
          October 23, 2009
          Toshiharu Harada
       haradats@nttdata.co.jp
    NTT DATA CORPORATION
ABSTRACTS
Every kernel developer knows that Linux comes with plenty of precious
documentation as an integral part. From coding style to how to post
patches, almost everything has been documented. However, history
shows that error is human nature. Sometimes developers do not well
know Don’ts, but there are also cases when they make mistakes despite
being aware of such rules. Why this happen is unsolved, but a
documentation, so far missing, of the consequences of this misbehavior
could discourage it. The presenter is project manager of TOMOYO
Linux, a security enhancement feature merged in version 2.6.30.
Thinking open-minded, he decided to share the errors his project
made, wishing it could be a helpful warning to other projects, especially
newcomers. In this presentation, it will try to explain the mistake
circumstances in TOMOYO Linux project, highlighting the thoughts of
project members and the community reactions.
“Experience is the name everyone gives to
his mistakes” --- Oscar Wild
WHAT’S THIS ALL ABOUT


• Linux   comes with a set of great documentation

• DOs     and DON’Ts are there already

• Yet   we keep on making mistakes

• Finding   a missing piece
WHAT IS MISSING?


• In   my humble opinion:

  • Human       nature (hard to fix)

  • Most   of us don’t really like readings (hard to fix)

  • Real-life   examples taken from TOMOYO Linux project
WHO AM I?



• Project   manager of TOMOYO Linux
OUCH, IS THIS “SECURE LINUX” TALK?




• No! Thistalk has no “security”, no “Policy” or “MAC” (so, please
  remain seated)

• If   you are interested in them, contact me personally
COVERED TOPICS

•   Chapter 1:

    •   Where to find DOs and DON’Ts

•   Chapter 2:

    •   TOMOYO Linux posting history overview

•   Chapter 3:

    •   Step by step introDOs and DON’Ts of the TOMOYO Linux
CHAPTER 1
Where to find DOs and DON’Ts
Gentle Reminder

Documentation is a part of Linux Kernel

After checking out the kernel, cd to
“Documentation”

Problem is “there are just too many files and
directories” and people prefer coding than
reading
How Great is It?

$Documentation/ManagementStyle

  “Most people are idiots, and being a
  manager means you'll have to deal with it,
  and perhaps more importantly, that
  _they_ have to deal with _you_.”

  “Thing will go wrong, and people want
  somebody to blame. Tag you’re it.”
Minimal Reading

Entire Scheme

  $Documentation/HOWTO

Submitting Patches

  $Documentation/SubmitChecklist

  $Documentation/CodingStyle
References




Note that the title is “How to Participate in
the Linux Community”

Making your code upstream means your
participation in the Linux Community
My favorite one
http://www.linuxfoundation.jp/jp_uploads/
seminar20070710/Jon-Dev-Process.pdf
CHAPTER 2
TOMOYO Linux by Numbers
All Happy Families Resemble Each
Other, Each Unhappy Family Is
Unhappy in Its Own Way. - Leo Tolstoy
3
We were 3
3
3rd LSM
module
15
Posted 15
  times
716
Merged since 716
days after the first
       post
162
Received 162
comments from
    LKML
Proposal History
http://tomoyo.sourceforge.jp/wiki-e/?JLS2009
CHAPTER 3
Drawing Lessons from the “Mistakes”
    of TOMOYO Linux Project
IN THE 1ST POSTING

I wrote:

All right, that's almost everything. Please
visit the following
URL for the code and documents:
  http://tomoyo.sourceforge.jp/wiki-e/
If you want to see the code first, then:
  http://tomoyo.sourceforge.jp/cgi-bin/lxr/
source/security/tomoyo/?v=linux-2.6.21.3-
tomoyo-2.0
DON’T
Send URL




Send patches
WHAT HAPPENED?


•Igot a personal message from Stephen Smalley, a maintainer
 of that famous SELinux

     –“If you really want feedback or to get your code into the
      kernel, you need to do more than post a URL to the code - you
      need to break your code down into a number of patches and
      post them, just like the AppArmor folks have been doing. “
SO WE RUSHED TO POSTED
     PATCHES NEXT DAY


• Pavel   Machek gave a comment

  • “Looks   whitespace-damaged to me.”
DON’T
Ignore the Linux standard coding style




         Always apply checkpatch.pl
DO




• Read   the $Document/CodingStyle

• Check   your code with $scripts/checkpatch.pl

• Also   use other $scripts/check*.pl
• Jiri   Kosina pointed us to make patches bisectable

• “Just a trivial minor nitpick - IMHO this breaks bisectability. It
  might be better to add the Kconfig/Makefile patch at the end
  of the whole series, so that bisect doesn't end up in the tree in
  which Makefile references non-existing files/directories.”
DO




• Add the Kconfig/Makefile patch at the end of the whole
 series, so that bisect doesn't end up in the tree in which
 Makefile references non-existing files/directories.”
IN THE 3RD PATCH



• James   Morris taught us series of patches should form a thread

 • “I'd
      also suggest making all of the patches a reply to the first
   email, so they can be threaded.”
DO




• Send series of patches as children of the first message so that
 they can form a thread
• James   Morris said:

 • “Please   use standard kernel list handling, per include/linux/list.h”

• YOSHIFUJI    Hideaki also mentioned:

 • You'reintroducing a custom API, which is open-coded repeatedly
   throughout your module.

 • All  linked lists (at least, new ones) must use the standard kernel
   list API.
DON’T
Propose new data structure




       Use existing one
IN THE 5TH POSTING


• James   Morris suggested to CC netdev mailing list

 • “You should send anything which touches core networking to
   netdev, too, and get an ack from one of the core developers
   there.”
DO




• Carefully   choose CCs and get a review from them
IN THE 6TH POSTING


• Tetsuoposted 30 series of messages with the subject,
 “Subject: [TOMOYO #7 00/30] TOMOYO Linux 1.6.0
 released”

• Theproblem was “TOMOYO 1.6.0” did not use LSM and
 implemented different hooks
DON’T
Try to invent a new API




Respect a standard and follow one
• Tetsuoand I knew that posting such patches will never be
 accepted

• However, we   had been stuck and we couldn’t find another
 way

• Our posting was thoughtless, but we were so serious to make
 our code upstream
IN THE 7TH POSTING

I changed my mind and wrote:

We apologize for the confusion we caused in
the last posting,
but we don't want to give up returning our
work to the mainline.
We cordially request LSM changes to pass
vfsmount parameters.
DON’T
Cordially ask to merge your code ;-)




     Make good patches and post them
• Stephen   Smalley kindly responded on the list

  –“Don't cordially request it - submit patches to make it happen. 
   Or work with others who have been submitting such patches. “
• Serge   E. Hallyn wrote:
CONCLUSION
• Our mistakes, presented in this slides, are merely the tip of the
 iceberg

• We made many failures and we sometimes behaved very
 badly

• Nevertheless, this   Linux community reacted and even merged
 our code
• Feedbacks    were not limited by mailing list replies

• There    were people who sent off-list messages and left advices
 in face
WITH ALL MY EXPERIENCES
                      I CAN SAY


• Linux   is not just free code

• Linux   is great because people are great

• Sending   your code is a conversation with people

• Theymight not appear friendly for the first time, but try to
 speak them first
ACKNOWLEDGMENTS
Al Viro, Albert Cahalan, Alexey Dobriyan, Andi Kleen, Andrew
Morton, Bodo Eggert, Casey Schaufler, Chris Wright, Christoph
Hellwig, Crispin Cowan, Daniel Walker, David Howells, David Lang,
David P. Quigley, Greg KH, James Morris, Jamie Lokier, Jiri Kosina,
Jonathan Corbet, Joshua Brindle, KaiGai Kohei, Kamezawa
Hiroyuki, KOSAKI Motohiro, Kyle Moffett, Linus Torvalds, Matthew
Wilcox, Miklos Szeredi, Paul E. McKenney, Paul Moore, Pavel
Machek, Peter Dolding, Peter Zijlstra, Rik van Riel, Serge E. Hallyn,
Seth Arnorld, Shaya Potter, Stephen Smalley, Tim Bird, Trond
Myklebust, Valdis Kletnieks, William Leibzon, YOSHIFUJI Hideaki
WE COULDN’T HAVE DONE IT
           WITHOUT YOUR HELP

Al Viro, Albert Cahalan, Alexey Dobriyan, Andi Kleen, Andrew
Morton, Bodo Eggert, Casey Schaufler, Chris Wright, Christoph
Hellwig, Crispin Cowan, Daniel Walker, David Howells, David Lang,
David P. Quigley, Greg KH, James Morris, Jamie Lokier, Jiri Kosina,
Jonathan Corbet, Joshua Brindle, KaiGai Kohei, Kamezawa
Hiroyuki, KOSAKI Motohiro, Kyle Moffett, Linus Torvalds, Matthew
Wilcox, Miklos Szeredi, Paul E. McKenney, Paul Moore, Pavel
Machek, Peter Dolding, Peter Zijlstra, Rik van Riel, Serge E. Hallyn,
Seth Arnorld, Shaya Potter, Stephen Smalley, Tim Bird, Trond
Myklebust, Valdis Kletnieks, William Leibzon, YOSHIFUJI Hideaki
AND OF COURSE
• We thank NTT DATA CORPORATION for their support of
 the project
RELATED PRESENTATIONS

Realities of Mainlining
 - Case of the TOMOYO Linux Project -     Time to Glean
                                        !#$%'$()*+,-$.)/0'1$2*3$0.4$%+0+'4
             Toshiharu Harada
         haradats@nttdata.co.jp                      July 25, 2008
          haradats@gmail.com                       Toshiharu Harada
                                                 haradats@nttdata.co.jp
                                                      Kentaro Takeda
       NTT DATA CORPORATION                            Tetsuo Handa
                                                NTT DATA CORPORATION
               July 9, 2008
What does it mean being an
 What does it mean being an
Open Source project manager        Open Source project manager
       in Enterprise                      in Enterprise
     enterprise edition               Open Source Edition
      LinuxCon 2009 (Business)           LinuxCon2009 (Business)
         September 23, 2009
          Toshiharu Harada
                                            September 23, 2009
        haradats@nttdata.co.jp
                                             Toshiharu Harada
      NTT DATA CORPORATION                haradats@gmail.com
                                         TOMOYO Linux Project
TRADEMARKS


• Linuxis a registered trademark of Linus Torvalds in Japan and
 other countries

• TOMOYOis a registered trademark of NTT DATA
 CORPORATION in Japan

More Related Content

Viewers also liked

Linux kernel development chapter 10
Linux kernel development chapter 10Linux kernel development chapter 10
Linux kernel development chapter 10huangachou
 
Linux internal
Linux internalLinux internal
Linux internalmcganesh
 
Linux Kernel Startup Code In Embedded Linux
Linux    Kernel    Startup  Code In  Embedded  LinuxLinux    Kernel    Startup  Code In  Embedded  Linux
Linux Kernel Startup Code In Embedded LinuxEmanuele Bonanni
 
Browsing Linux Kernel Source
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel SourceMotaz Saad
 
Linux Kernel Security Overview - KCA 2009
Linux Kernel Security Overview - KCA 2009Linux Kernel Security Overview - KCA 2009
Linux Kernel Security Overview - KCA 2009James Morris
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniquesSatpal Parmar
 
Linux Kernel Development
Linux Kernel DevelopmentLinux Kernel Development
Linux Kernel DevelopmentPriyank Kapadia
 
Troubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversTroubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversSatpal Parmar
 
Linux kernel development ch4
Linux kernel development   ch4Linux kernel development   ch4
Linux kernel development ch4huangachou
 
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBshimosawa
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel ProgrammingNalin Sharma
 
Overview of linux kernel development
Overview of linux kernel developmentOverview of linux kernel development
Overview of linux kernel developmentPushkar Pashupat
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingStephan Cadene
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBshimosawa
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingTushar B Kute
 
History Of Linux
History Of LinuxHistory Of Linux
History Of Linuxanand09
 

Viewers also liked (20)

Linux kernel development chapter 10
Linux kernel development chapter 10Linux kernel development chapter 10
Linux kernel development chapter 10
 
Linux internal
Linux internalLinux internal
Linux internal
 
Linux Kernel Startup Code In Embedded Linux
Linux    Kernel    Startup  Code In  Embedded  LinuxLinux    Kernel    Startup  Code In  Embedded  Linux
Linux Kernel Startup Code In Embedded Linux
 
Browsing Linux Kernel Source
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel Source
 
Linux Kernel Security Overview - KCA 2009
Linux Kernel Security Overview - KCA 2009Linux Kernel Security Overview - KCA 2009
Linux Kernel Security Overview - KCA 2009
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniques
 
Linux Kernel Development
Linux Kernel DevelopmentLinux Kernel Development
Linux Kernel Development
 
Troubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversTroubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device Drivers
 
Linux kernel development ch4
Linux kernel development   ch4Linux kernel development   ch4
Linux kernel development ch4
 
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKB
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel Programming
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Overview of linux kernel development
Overview of linux kernel developmentOverview of linux kernel development
Overview of linux kernel development
 
History of linux
History of linuxHistory of linux
History of linux
 
A History of Linux
A History of LinuxA History of Linux
A History of Linux
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development Training
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Power Management from Linux Kernel to Android
Power Management from Linux Kernel to AndroidPower Management from Linux Kernel to Android
Power Management from Linux Kernel to Android
 
History Of Linux
History Of LinuxHistory Of Linux
History Of Linux
 

Similar to Kernel Development: Drawing Lessons From "Mistakes" (Japan Linux Symposium 2009)

Realities of Mainlining -- Case of the TOMOYO Linux project
Realities of Mainlining -- Case of the TOMOYO Linux projectRealities of Mainlining -- Case of the TOMOYO Linux project
Realities of Mainlining -- Case of the TOMOYO Linux projectToshiharu Harada, Ph.D
 
Open Source Software and Libraries
Open Source Software and LibrariesOpen Source Software and Libraries
Open Source Software and LibrariesEllyssa Kroski
 
How to write maintainable code - Peter Hilton - Codemotion Amsterdam 2017
How to write maintainable code - Peter Hilton - Codemotion Amsterdam 2017How to write maintainable code - Peter Hilton - Codemotion Amsterdam 2017
How to write maintainable code - Peter Hilton - Codemotion Amsterdam 2017Codemotion
 
How to write maintainable code
How to write maintainable codeHow to write maintainable code
How to write maintainable codePeter Hilton
 
Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2ice799
 
Scylla Summit 2022: Predicting the Past
Scylla Summit 2022: Predicting the PastScylla Summit 2022: Predicting the Past
Scylla Summit 2022: Predicting the PastScyllaDB
 
Community dynamics
Community dynamicsCommunity dynamics
Community dynamicsDave Neary
 
Unix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell LabsUnix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell LabsAnant Narayanan
 
PyData Texas 2015 Keynote
PyData Texas 2015 KeynotePyData Texas 2015 Keynote
PyData Texas 2015 KeynotePeter Wang
 
Levelling up in open source
Levelling up in open sourceLevelling up in open source
Levelling up in open sourceJon Spriggs
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Hannes Lowette
 
How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....Mike Harris
 
Contribute 101: Engine/Swarm/ContainerD by Phil Estes
Contribute 101: Engine/Swarm/ContainerD by Phil EstesContribute 101: Engine/Swarm/ContainerD by Phil Estes
Contribute 101: Engine/Swarm/ContainerD by Phil EstesDocker, Inc.
 
Search-Driven Programming
Search-Driven ProgrammingSearch-Driven Programming
Search-Driven ProgrammingEthan Herdrick
 
NDC Oslo 2019 - War stories from .NET team -- Karel Zikmund
NDC Oslo 2019 - War stories from .NET team -- Karel ZikmundNDC Oslo 2019 - War stories from .NET team -- Karel Zikmund
NDC Oslo 2019 - War stories from .NET team -- Karel ZikmundKarel Zikmund
 
Voxxed Days Thessaloniki 2016 - Documentation Avoidance
Voxxed Days Thessaloniki 2016 - Documentation AvoidanceVoxxed Days Thessaloniki 2016 - Documentation Avoidance
Voxxed Days Thessaloniki 2016 - Documentation AvoidanceVoxxed Days Thessaloniki
 

Similar to Kernel Development: Drawing Lessons From "Mistakes" (Japan Linux Symposium 2009) (20)

Realities of Mainlining -- Case of the TOMOYO Linux project
Realities of Mainlining -- Case of the TOMOYO Linux projectRealities of Mainlining -- Case of the TOMOYO Linux project
Realities of Mainlining -- Case of the TOMOYO Linux project
 
How to Become a Hacker?
How to Become a Hacker?How to Become a Hacker?
How to Become a Hacker?
 
Open Source Software and Libraries
Open Source Software and LibrariesOpen Source Software and Libraries
Open Source Software and Libraries
 
How to write maintainable code - Peter Hilton - Codemotion Amsterdam 2017
How to write maintainable code - Peter Hilton - Codemotion Amsterdam 2017How to write maintainable code - Peter Hilton - Codemotion Amsterdam 2017
How to write maintainable code - Peter Hilton - Codemotion Amsterdam 2017
 
How to write maintainable code
How to write maintainable codeHow to write maintainable code
How to write maintainable code
 
Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2
 
Scylla Summit 2022: Predicting the Past
Scylla Summit 2022: Predicting the PastScylla Summit 2022: Predicting the Past
Scylla Summit 2022: Predicting the Past
 
Community dynamics
Community dynamicsCommunity dynamics
Community dynamics
 
Unix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell LabsUnix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell Labs
 
PyData Texas 2015 Keynote
PyData Texas 2015 KeynotePyData Texas 2015 Keynote
PyData Texas 2015 Keynote
 
Levelling up in open source
Levelling up in open sourceLevelling up in open source
Levelling up in open source
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
Monorepo at Pinterest
Monorepo at PinterestMonorepo at Pinterest
Monorepo at Pinterest
 
week1.ppt
week1.pptweek1.ppt
week1.ppt
 
How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....
 
Contribute 101: Engine/Swarm/ContainerD by Phil Estes
Contribute 101: Engine/Swarm/ContainerD by Phil EstesContribute 101: Engine/Swarm/ContainerD by Phil Estes
Contribute 101: Engine/Swarm/ContainerD by Phil Estes
 
Commitmas 2015
Commitmas 2015Commitmas 2015
Commitmas 2015
 
Search-Driven Programming
Search-Driven ProgrammingSearch-Driven Programming
Search-Driven Programming
 
NDC Oslo 2019 - War stories from .NET team -- Karel Zikmund
NDC Oslo 2019 - War stories from .NET team -- Karel ZikmundNDC Oslo 2019 - War stories from .NET team -- Karel Zikmund
NDC Oslo 2019 - War stories from .NET team -- Karel Zikmund
 
Voxxed Days Thessaloniki 2016 - Documentation Avoidance
Voxxed Days Thessaloniki 2016 - Documentation AvoidanceVoxxed Days Thessaloniki 2016 - Documentation Avoidance
Voxxed Days Thessaloniki 2016 - Documentation Avoidance
 

Recently uploaded

ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...Product School
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...Sri Ambati
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Product School
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsVlad Stirbu
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform EngineeringJemma Hussein Allen
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
 

Recently uploaded (20)

ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 

Kernel Development: Drawing Lessons From "Mistakes" (Japan Linux Symposium 2009)

  • 1. KERNEL DEVELOPMENT: DRAWING LESSONS FROM "MISTAKES" Japan Linux Symposium 2009 October 23, 2009 Toshiharu Harada haradats@nttdata.co.jp NTT DATA CORPORATION
  • 2. ABSTRACTS Every kernel developer knows that Linux comes with plenty of precious documentation as an integral part. From coding style to how to post patches, almost everything has been documented. However, history shows that error is human nature. Sometimes developers do not well know Don’ts, but there are also cases when they make mistakes despite being aware of such rules. Why this happen is unsolved, but a documentation, so far missing, of the consequences of this misbehavior could discourage it. The presenter is project manager of TOMOYO Linux, a security enhancement feature merged in version 2.6.30. Thinking open-minded, he decided to share the errors his project made, wishing it could be a helpful warning to other projects, especially newcomers. In this presentation, it will try to explain the mistake circumstances in TOMOYO Linux project, highlighting the thoughts of project members and the community reactions.
  • 3. “Experience is the name everyone gives to his mistakes” --- Oscar Wild
  • 4. WHAT’S THIS ALL ABOUT • Linux comes with a set of great documentation • DOs and DON’Ts are there already • Yet we keep on making mistakes • Finding a missing piece
  • 5. WHAT IS MISSING? • In my humble opinion: • Human nature (hard to fix) • Most of us don’t really like readings (hard to fix) • Real-life examples taken from TOMOYO Linux project
  • 6. WHO AM I? • Project manager of TOMOYO Linux
  • 7. OUCH, IS THIS “SECURE LINUX” TALK? • No! Thistalk has no “security”, no “Policy” or “MAC” (so, please remain seated) • If you are interested in them, contact me personally
  • 8. COVERED TOPICS • Chapter 1: • Where to find DOs and DON’Ts • Chapter 2: • TOMOYO Linux posting history overview • Chapter 3: • Step by step introDOs and DON’Ts of the TOMOYO Linux
  • 9. CHAPTER 1 Where to find DOs and DON’Ts
  • 10. Gentle Reminder Documentation is a part of Linux Kernel After checking out the kernel, cd to “Documentation” Problem is “there are just too many files and directories” and people prefer coding than reading
  • 11. How Great is It? $Documentation/ManagementStyle “Most people are idiots, and being a manager means you'll have to deal with it, and perhaps more importantly, that _they_ have to deal with _you_.” “Thing will go wrong, and people want somebody to blame. Tag you’re it.”
  • 12. Minimal Reading Entire Scheme $Documentation/HOWTO Submitting Patches $Documentation/SubmitChecklist $Documentation/CodingStyle
  • 13. References Note that the title is “How to Participate in the Linux Community” Making your code upstream means your participation in the Linux Community
  • 16. All Happy Families Resemble Each Other, Each Unhappy Family Is Unhappy in Its Own Way. - Leo Tolstoy
  • 17. 3
  • 19. 3
  • 21. 15
  • 22. Posted 15 times
  • 23. 716
  • 24. Merged since 716 days after the first post
  • 25. 162
  • 28. CHAPTER 3 Drawing Lessons from the “Mistakes” of TOMOYO Linux Project
  • 29. IN THE 1ST POSTING I wrote: All right, that's almost everything. Please visit the following URL for the code and documents:   http://tomoyo.sourceforge.jp/wiki-e/ If you want to see the code first, then:   http://tomoyo.sourceforge.jp/cgi-bin/lxr/ source/security/tomoyo/?v=linux-2.6.21.3- tomoyo-2.0
  • 31. WHAT HAPPENED? •Igot a personal message from Stephen Smalley, a maintainer of that famous SELinux –“If you really want feedback or to get your code into the kernel, you need to do more than post a URL to the code - you need to break your code down into a number of patches and post them, just like the AppArmor folks have been doing. “
  • 32. SO WE RUSHED TO POSTED PATCHES NEXT DAY • Pavel Machek gave a comment • “Looks whitespace-damaged to me.”
  • 33. DON’T Ignore the Linux standard coding style Always apply checkpatch.pl
  • 34. DO • Read the $Document/CodingStyle • Check your code with $scripts/checkpatch.pl • Also use other $scripts/check*.pl
  • 35. • Jiri Kosina pointed us to make patches bisectable • “Just a trivial minor nitpick - IMHO this breaks bisectability. It might be better to add the Kconfig/Makefile patch at the end of the whole series, so that bisect doesn't end up in the tree in which Makefile references non-existing files/directories.”
  • 36. DO • Add the Kconfig/Makefile patch at the end of the whole series, so that bisect doesn't end up in the tree in which Makefile references non-existing files/directories.”
  • 37. IN THE 3RD PATCH • James Morris taught us series of patches should form a thread • “I'd also suggest making all of the patches a reply to the first email, so they can be threaded.”
  • 38. DO • Send series of patches as children of the first message so that they can form a thread
  • 39. • James Morris said: • “Please use standard kernel list handling, per include/linux/list.h” • YOSHIFUJI Hideaki also mentioned: • You'reintroducing a custom API, which is open-coded repeatedly throughout your module. • All linked lists (at least, new ones) must use the standard kernel list API.
  • 40. DON’T Propose new data structure Use existing one
  • 41. IN THE 5TH POSTING • James Morris suggested to CC netdev mailing list • “You should send anything which touches core networking to netdev, too, and get an ack from one of the core developers there.”
  • 42. DO • Carefully choose CCs and get a review from them
  • 43. IN THE 6TH POSTING • Tetsuoposted 30 series of messages with the subject, “Subject: [TOMOYO #7 00/30] TOMOYO Linux 1.6.0 released” • Theproblem was “TOMOYO 1.6.0” did not use LSM and implemented different hooks
  • 44. DON’T Try to invent a new API Respect a standard and follow one
  • 45. • Tetsuoand I knew that posting such patches will never be accepted • However, we had been stuck and we couldn’t find another way • Our posting was thoughtless, but we were so serious to make our code upstream
  • 46. IN THE 7TH POSTING I changed my mind and wrote: We apologize for the confusion we caused in the last posting, but we don't want to give up returning our work to the mainline. We cordially request LSM changes to pass vfsmount parameters.
  • 47. DON’T Cordially ask to merge your code ;-) Make good patches and post them
  • 48. • Stephen Smalley kindly responded on the list –“Don't cordially request it - submit patches to make it happen.  Or work with others who have been submitting such patches. “
  • 49. • Serge E. Hallyn wrote:
  • 51. • Our mistakes, presented in this slides, are merely the tip of the iceberg • We made many failures and we sometimes behaved very badly • Nevertheless, this Linux community reacted and even merged our code
  • 52. • Feedbacks were not limited by mailing list replies • There were people who sent off-list messages and left advices in face
  • 53. WITH ALL MY EXPERIENCES I CAN SAY • Linux is not just free code • Linux is great because people are great • Sending your code is a conversation with people • Theymight not appear friendly for the first time, but try to speak them first
  • 55.
  • 56. Al Viro, Albert Cahalan, Alexey Dobriyan, Andi Kleen, Andrew Morton, Bodo Eggert, Casey Schaufler, Chris Wright, Christoph Hellwig, Crispin Cowan, Daniel Walker, David Howells, David Lang, David P. Quigley, Greg KH, James Morris, Jamie Lokier, Jiri Kosina, Jonathan Corbet, Joshua Brindle, KaiGai Kohei, Kamezawa Hiroyuki, KOSAKI Motohiro, Kyle Moffett, Linus Torvalds, Matthew Wilcox, Miklos Szeredi, Paul E. McKenney, Paul Moore, Pavel Machek, Peter Dolding, Peter Zijlstra, Rik van Riel, Serge E. Hallyn, Seth Arnorld, Shaya Potter, Stephen Smalley, Tim Bird, Trond Myklebust, Valdis Kletnieks, William Leibzon, YOSHIFUJI Hideaki
  • 57. WE COULDN’T HAVE DONE IT WITHOUT YOUR HELP Al Viro, Albert Cahalan, Alexey Dobriyan, Andi Kleen, Andrew Morton, Bodo Eggert, Casey Schaufler, Chris Wright, Christoph Hellwig, Crispin Cowan, Daniel Walker, David Howells, David Lang, David P. Quigley, Greg KH, James Morris, Jamie Lokier, Jiri Kosina, Jonathan Corbet, Joshua Brindle, KaiGai Kohei, Kamezawa Hiroyuki, KOSAKI Motohiro, Kyle Moffett, Linus Torvalds, Matthew Wilcox, Miklos Szeredi, Paul E. McKenney, Paul Moore, Pavel Machek, Peter Dolding, Peter Zijlstra, Rik van Riel, Serge E. Hallyn, Seth Arnorld, Shaya Potter, Stephen Smalley, Tim Bird, Trond Myklebust, Valdis Kletnieks, William Leibzon, YOSHIFUJI Hideaki
  • 58. AND OF COURSE • We thank NTT DATA CORPORATION for their support of the project
  • 59. RELATED PRESENTATIONS Realities of Mainlining - Case of the TOMOYO Linux Project - Time to Glean !#$%'$()*+,-$.)/0'1$2*3$0.4$%+0+'4 Toshiharu Harada haradats@nttdata.co.jp July 25, 2008 haradats@gmail.com Toshiharu Harada haradats@nttdata.co.jp Kentaro Takeda NTT DATA CORPORATION Tetsuo Handa NTT DATA CORPORATION July 9, 2008
  • 60. What does it mean being an What does it mean being an Open Source project manager Open Source project manager in Enterprise in Enterprise enterprise edition Open Source Edition LinuxCon 2009 (Business) LinuxCon2009 (Business) September 23, 2009 Toshiharu Harada September 23, 2009 haradats@nttdata.co.jp Toshiharu Harada NTT DATA CORPORATION haradats@gmail.com TOMOYO Linux Project
  • 61. TRADEMARKS • Linuxis a registered trademark of Linus Torvalds in Japan and other countries • TOMOYOis a registered trademark of NTT DATA CORPORATION in Japan