researcher-guidelines.rst 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. To help clarify: sending patches to developers *is* interacting
  38. with them, but they have already consented to receiving *good faith
  39. contributions*. Sending intentionally flawed/vulnerable patches or
  40. contributing misleading information to discussions is not consented
  41. to. Such communication can be damaging to the developer (e.g. draining
  42. time, effort, and morale) and damaging to the project by eroding
  43. the entire developer community's trust in the contributor (and the
  44. contributor's organization as a whole), undermining efforts to provide
  45. constructive feedback to contributors, and putting end users at risk of
  46. software flaws.
  47. Participation in the development of Linux itself by researchers, as
  48. with anyone, is welcomed and encouraged. Research into Linux code is
  49. a common practice, especially when it comes to developing or running
  50. analysis tools that produce actionable results.
  51. When engaging with the developer community, sending a patch has
  52. traditionally been the best way to make an impact. Linux already has
  53. plenty of known bugs -- what's much more helpful is having vetted fixes.
  54. Before contributing, carefully read the appropriate documentation:
  55. * Documentation/process/development-process.rst
  56. * Documentation/process/submitting-patches.rst
  57. * Documentation/admin-guide/reporting-issues.rst
  58. * Documentation/admin-guide/security-bugs.rst
  59. Then send a patch (including a commit log with all the details listed
  60. below) and follow up on any feedback from other developers.
  61. When sending patches produced from research, the commit logs should
  62. contain at least the following details, so that developers have
  63. appropriate context for understanding the contribution. Answer:
  64. * What is the specific problem that has been found?
  65. * How could the problem be reached on a running system?
  66. * What effect would encountering the problem have on the system?
  67. * How was the problem found? Specifically include details about any
  68. testing, static or dynamic analysis programs, and any other tools or
  69. methods used to perform the work.
  70. * Which version of Linux was the problem found on? Using the most recent
  71. release or a recent linux-next branch is strongly preferred (see
  72. Documentation/process/howto.rst).
  73. * What was changed to fix the problem, and why it is believed to be correct?
  74. * How was the change build tested and run-time tested?
  75. * What prior commit does this change fix? This should go in a "Fixes:"
  76. tag as the documentation describes.
  77. * Who else has reviewed this patch? This should go in appropriate
  78. "Reviewed-by:" tags; see below.
  79. For example::
  80. From: Author <author@email>
  81. Subject: [PATCH] drivers/foo_bar: Add missing kfree()
  82. The error path in foo_bar driver does not correctly free the allocated
  83. struct foo_bar_info. This can happen if the attached foo_bar device
  84. rejects the initialization packets sent during foo_bar_probe(). This
  85. would result in a 64 byte slab memory leak once per device attach,
  86. wasting memory resources over time.
  87. This flaw was found using an experimental static analysis tool we are
  88. developing, LeakMagic[1], which reported the following warning when
  89. analyzing the v5.15 kernel release:
  90. path/to/foo_bar.c:187: missing kfree() call?
  91. Add the missing kfree() to the error path. No other references to
  92. this memory exist outside the probe function, so this is the only
  93. place it can be freed.
  94. x86_64 and arm64 defconfig builds with CONFIG_FOO_BAR=y using GCC
  95. 11.2 show no new warnings, and LeakMagic no longer warns about this
  96. code path. As we don't have a FooBar device to test with, no runtime
  97. testing was able to be performed.
  98. [1] https://url/to/leakmagic/details
  99. Reported-by: Researcher <researcher@email>
  100. Fixes: aaaabbbbccccdddd ("Introduce support for FooBar")
  101. Signed-off-by: Author <author@email>
  102. Reviewed-by: Reviewer <reviewer@email>
  103. If you are a first time contributor it is recommended that the patch
  104. itself be vetted by others privately before being posted to public lists.
  105. (This is required if you have been explicitly told your patches need
  106. more careful internal review.) These people are expected to have their
  107. "Reviewed-by" tag included in the resulting patch. Finding another
  108. developer familiar with Linux contribution, especially within your own
  109. organization, and having them help with reviews before sending them to
  110. the public mailing lists tends to significantly improve the quality of the
  111. resulting patches, and there by reduces the burden on other developers.
  112. If no one can be found to internally review patches and you need
  113. help finding such a person, or if you have any other questions
  114. related to this document and the developer community's expectations,
  115. please reach out to the private Technical Advisory Board mailing list:
  116. <[email protected]>.