researcher-guidelines.rst 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. .. SPDX-License-Identifier: GPL-2.0
  2. .. _researcher_guidelines:
  3. Researcher Guidelines
  4. +++++++++++++++++++++
  5. The Linux kernel community welcomes transparent research on the Linux
  6. kernel, the activities involved in producing it, and any other byproducts
  7. of its development. Linux benefits greatly from this kind of research, and
  8. most aspects of Linux are driven by research in one form or another.
  9. The community greatly appreciates if researchers can share preliminary
  10. findings before making their results public, especially if such research
  11. involves security. Getting involved early helps both improve the quality
  12. of research and ability for Linux to improve from it. In any case,
  13. sharing open access copies of the published research with the community
  14. is recommended.
  15. This document seeks to clarify what the Linux kernel community considers
  16. acceptable and non-acceptable practices when conducting such research. At
  17. the very least, such research and related activities should follow
  18. standard research ethics rules. For more background on research ethics
  19. generally, ethics in technology, and research of developer communities
  20. in particular, see:
  21. * `History of Research Ethics <https://www.unlv.edu/research/ORI-HSR/history-ethics>`_
  22. * `IEEE Ethics <https://www.ieee.org/about/ethics/index.html>`_
  23. * `Developer and Researcher Views on the Ethics of Experiments on Open-Source Projects <https://arxiv.org/pdf/2112.13217.pdf>`_
  24. The Linux kernel community expects that everyone interacting with the
  25. project is participating in good faith to make Linux better. Research on
  26. any publicly-available artifact (including, but not limited to source
  27. code) produced by the Linux kernel community is welcome, though research
  28. on developers must be distinctly opt-in.
  29. Passive research that is based entirely on publicly available sources,
  30. including posts to public mailing lists and commits to public
  31. repositories, is clearly permissible. Though, as with any research,
  32. standard ethics must still be followed.
  33. Active research on developer behavior, however, must be done with the
  34. explicit agreement of, and full disclosure to, the individual developers
  35. involved. Developers cannot be interacted with/experimented on without
  36. consent; this, too, is standard research ethics.
  37. Surveys
  38. =======
  39. Research often takes the form of surveys sent to maintainers or
  40. contributors. As a general rule, though, the kernel community derives
  41. little value from these surveys. The kernel development process works
  42. because every developer benefits from their participation, even working
  43. with others who have different goals. Responding to a survey, though, is a
  44. one-way demand placed on busy developers with no corresponding benefit to
  45. themselves or to the kernel community as a whole. For this reason, this
  46. method of research is discouraged.
  47. Kernel community members already receive far too much email and are likely
  48. to perceive survey requests as just another demand on their time. Sending
  49. such requests deprives the community of valuable contributor time and is
  50. unlikely to yield a statistically useful response.
  51. As an alternative, researchers should consider attending developer events,
  52. hosting sessions where the research project and its benefits to the
  53. participants can be explained, and interacting directly with the community
  54. there. The information received will be far richer than that obtained from
  55. an email survey, and the community will gain from the ability to learn from
  56. your insights as well.
  57. Patches
  58. =======
  59. To help clarify: sending patches to developers *is* interacting
  60. with them, but they have already consented to receiving *good faith
  61. contributions*. Sending intentionally flawed/vulnerable patches or
  62. contributing misleading information to discussions is not consented
  63. to. Such communication can be damaging to the developer (e.g. draining
  64. time, effort, and morale) and damaging to the project by eroding
  65. the entire developer community's trust in the contributor (and the
  66. contributor's organization as a whole), undermining efforts to provide
  67. constructive feedback to contributors, and putting end users at risk of
  68. software flaws.
  69. Participation in the development of Linux itself by researchers, as
  70. with anyone, is welcomed and encouraged. Research into Linux code is
  71. a common practice, especially when it comes to developing or running
  72. analysis tools that produce actionable results.
  73. When engaging with the developer community, sending a patch has
  74. traditionally been the best way to make an impact. Linux already has
  75. plenty of known bugs -- what's much more helpful is having vetted fixes.
  76. Before contributing, carefully read the appropriate documentation:
  77. * Documentation/process/development-process.rst
  78. * Documentation/process/submitting-patches.rst
  79. * Documentation/admin-guide/reporting-issues.rst
  80. * Documentation/process/security-bugs.rst
  81. Then send a patch (including a commit log with all the details listed
  82. below) and follow up on any feedback from other developers.
  83. When sending patches produced from research, the commit logs should
  84. contain at least the following details, so that developers have
  85. appropriate context for understanding the contribution. Answer:
  86. * What is the specific problem that has been found?
  87. * How could the problem be reached on a running system?
  88. * What effect would encountering the problem have on the system?
  89. * How was the problem found? Specifically include details about any
  90. testing, static or dynamic analysis programs, and any other tools or
  91. methods used to perform the work.
  92. * Which version of Linux was the problem found on? Using the most recent
  93. release or a recent linux-next branch is strongly preferred (see
  94. Documentation/process/howto.rst).
  95. * What was changed to fix the problem, and why it is believed to be correct?
  96. * How was the change build tested and run-time tested?
  97. * What prior commit does this change fix? This should go in a "Fixes:"
  98. tag as the documentation describes.
  99. * Who else has reviewed this patch? This should go in appropriate
  100. "Reviewed-by:" tags; see below.
  101. For example::
  102. From: Author <author@email>
  103. Subject: [PATCH] drivers/foo_bar: Add missing kfree()
  104. The error path in foo_bar driver does not correctly free the allocated
  105. struct foo_bar_info. This can happen if the attached foo_bar device
  106. rejects the initialization packets sent during foo_bar_probe(). This
  107. would result in a 64 byte slab memory leak once per device attach,
  108. wasting memory resources over time.
  109. This flaw was found using an experimental static analysis tool we are
  110. developing, LeakMagic[1], which reported the following warning when
  111. analyzing the v5.15 kernel release:
  112. path/to/foo_bar.c:187: missing kfree() call?
  113. Add the missing kfree() to the error path. No other references to
  114. this memory exist outside the probe function, so this is the only
  115. place it can be freed.
  116. x86_64 and arm64 defconfig builds with CONFIG_FOO_BAR=y using GCC
  117. 11.2 show no new warnings, and LeakMagic no longer warns about this
  118. code path. As we don't have a FooBar device to test with, no runtime
  119. testing was able to be performed.
  120. [1] https://url/to/leakmagic/details
  121. Reported-by: Researcher <researcher@email>
  122. Fixes: aaaabbbbccccdddd ("Introduce support for FooBar")
  123. Signed-off-by: Author <author@email>
  124. Reviewed-by: Reviewer <reviewer@email>
  125. If you are a first time contributor it is recommended that the patch
  126. itself be vetted by others privately before being posted to public lists.
  127. (This is required if you have been explicitly told your patches need
  128. more careful internal review.) These people are expected to have their
  129. "Reviewed-by" tag included in the resulting patch. Finding another
  130. developer familiar with Linux contribution, especially within your own
  131. organization, and having them help with reviews before sending them to
  132. the public mailing lists tends to significantly improve the quality of the
  133. resulting patches, and there by reduces the burden on other developers.
  134. If no one can be found to internally review patches and you need
  135. help finding such a person, or if you have any other questions
  136. related to this document and the developer community's expectations,
  137. please reach out to the private Technical Advisory Board mailing list:
  138. <tech-board@groups.linuxfoundation.org>.