€•;Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ%/translations/zh_CN/bpf/bpf_licensing”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/zh_TW/bpf/bpf_licensing”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/it_IT/bpf/bpf_licensing”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ja_JP/bpf/bpf_licensing”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ko_KR/bpf/bpf_licensing”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/pt_BR/bpf/bpf_licensing”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/sp_SP/bpf/bpf_licensing”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ BPF licensing”h]”hŒ BPF licensing”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ?/var/lib/git/docbuild/linux/Documentation/bpf/bpf_licensing.rst”h´Kubh¶)”}”(hhh]”(h»)”}”(hŒ Background”h]”hŒ Background”…””}”(hhÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhhËh²hh³hÊh´KubhŒ bullet_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hŒClassic BPF was BSD licensed ”h]”hŒ paragraph”“”)”}”(hŒClassic BPF was BSD licensed”h]”hŒClassic BPF was BSD licensed”…””}”(hhéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´Khhãubah}”(h]”h ]”h"]”h$]”h&]”uh1háhhÞh²hh³hÊh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1hÜh³hÊh´KhhËh²hubhè)”}”(hŒý"BPF" was originally introduced as BSD Packet Filter in http://www.tcpdump.org/papers/bpf-usenix93.pdf. The corresponding instruction set and its implementation came from BSD with BSD license. That original instruction set is now known as "classic BPF".”h]”(hŒ<“BPF†was originally introduced as BSD Packet Filter in ”…””}”(hjh²hh³Nh´NubhŒ reference”“”)”}”(hŒ.http://www.tcpdump.org/papers/bpf-usenix93.pdf”h]”hŒ.http://www.tcpdump.org/papers/bpf-usenix93.pdf”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”juh1j hjubhŒ›. The corresponding instruction set and its implementation came from BSD with BSD license. That original instruction set is now known as “classic BPFâ€.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´K hhËh²hubhè)”}”(hXHowever an instruction set is a specification for machine-language interaction, similar to a programming language. It is not a code. Therefore, the application of a BSD license may be misleading in a certain context, as the instruction set may enjoy no copyright protection.”h]”hXHowever an instruction set is a specification for machine-language interaction, similar to a programming language. It is not a code. Therefore, the application of a BSD license may be misleading in a certain context, as the instruction set may enjoy no copyright protection.”…””}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´KhhËh²hubhÝ)”}”(hhh]”hâ)”}”(hŒ8eBPF (extended BPF) instruction set continues to be BSD ”h]”hè)”}”(hŒ7eBPF (extended BPF) instruction set continues to be BSD”h]”hŒ7eBPF (extended BPF) instruction set continues to be BSD”…””}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´Khj9ubah}”(h]”h ]”h"]”h$]”h&]”uh1háhj6h²hh³hÊh´Nubah}”(h]”h ]”h"]”h$]”h&]”jjuh1hÜh³hÊh´KhhËh²hubhè)”}”(hŒÅIn 2014, the classic BPF instruction set was significantly extended. We typically refer to this instruction set as eBPF to disambiguate it from cBPF. The eBPF instruction set is still BSD licensed.”h]”hŒÅIn 2014, the classic BPF instruction set was significantly extended. We typically refer to this instruction set as eBPF to disambiguate it from cBPF. The eBPF instruction set is still BSD licensed.”…””}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´KhhËh²hubeh}”(h]”Œ background”ah ]”h"]”Œ background”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒImplementations of eBPF”h]”hŒImplementations of eBPF”…””}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjmh²hh³hÊh´Kubhè)”}”(hŒ^Using the eBPF instruction set requires implementing code in both kernel space and user space.”h]”hŒ^Using the eBPF instruction set requires implementing code in both kernel space and user space.”…””}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´Khjmh²hubh¶)”}”(hhh]”(h»)”}”(hŒIn Linux Kernel”h]”hŒIn Linux Kernel”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjŒh²hh³hÊh´K!ubhè)”}”(hX The reference implementations of the eBPF interpreter and various just-in-time compilers are part of Linux and are GPLv2 licensed. The implementation of eBPF helper functions is also GPLv2 licensed. Interpreters, JITs, helpers, and verifiers are called eBPF runtime.”h]”hX The reference implementations of the eBPF interpreter and various just-in-time compilers are part of Linux and are GPLv2 licensed. The implementation of eBPF helper functions is also GPLv2 licensed. Interpreters, JITs, helpers, and verifiers are called eBPF runtime.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´K#hjŒh²hubeh}”(h]”Œin-linux-kernel”ah ]”h"]”Œin linux kernel”ah$]”h&]”uh1hµhjmh²hh³hÊh´K!ubh¶)”}”(hhh]”(h»)”}”(hŒ In User Space”h]”hŒ In User Space”…””}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj³h²hh³hÊh´K)ubhè)”}”(hŒíThere are also implementations of eBPF runtime (interpreter, JITs, helper functions) under Apache2 (https://github.com/iovisor/ubpf), MIT (https://github.com/qmonnet/rbpf), and BSD (https://github.com/DPDK/dpdk/blob/main/lib/librte_bpf).”h]”(hŒdThere are also implementations of eBPF runtime (interpreter, JITs, helper functions) under Apache2 (”…””}”(hjÄh²hh³Nh´Nubj)”}”(hŒhttps://github.com/iovisor/ubpf”h]”hŒhttps://github.com/iovisor/ubpf”…””}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jÎuh1j hjÄubhŒ), MIT (”…””}”(hjÄh²hh³Nh´Nubj)”}”(hŒhttps://github.com/qmonnet/rbpf”h]”hŒhttps://github.com/qmonnet/rbpf”…””}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jáuh1j hjÄubhŒ ), and BSD (”…””}”(hjÄh²hh³Nh´Nubj)”}”(hŒ5https://github.com/DPDK/dpdk/blob/main/lib/librte_bpf”h]”hŒ5https://github.com/DPDK/dpdk/blob/main/lib/librte_bpf”…””}”(hjòh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jôuh1j hjÄubhŒ).”…””}”(hjÄh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´K+hj³h²hubeh}”(h]”Œ in-user-space”ah ]”h"]”Œ in user space”ah$]”h&]”uh1hµhjmh²hh³hÊh´K)ubh¶)”}”(hhh]”(h»)”}”(hŒIn HW”h]”hŒIn HW”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´K2ubhè)”}”(hŒ™The HW can choose to execute eBPF instruction natively and provide eBPF runtime in HW or via the use of implementing firmware with a proprietary license.”h]”hŒ™The HW can choose to execute eBPF instruction natively and provide eBPF runtime in HW or via the use of implementing firmware with a proprietary license.”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´K4hjh²hubeh}”(h]”Œin-hw”ah ]”h"]”Œin hw”ah$]”h&]”uh1hµhjmh²hh³hÊh´K2ubh¶)”}”(hhh]”(h»)”}”(hŒIn other operating systems”h]”hŒIn other operating systems”…””}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj:h²hh³hÊh´K8ubhè)”}”(hŒnOther kernels or user space implementations of eBPF instruction set and runtime can have proprietary licenses.”h]”hŒnOther kernels or user space implementations of eBPF instruction set and runtime can have proprietary licenses.”…””}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´K:hj:h²hubeh}”(h]”Œin-other-operating-systems”ah ]”h"]”Œin other operating systems”ah$]”h&]”uh1hµhjmh²hh³hÊh´K8ubeh}”(h]”Œimplementations-of-ebpf”ah ]”h"]”Œimplementations of ebpf”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒ&Using BPF programs in the Linux kernel”h]”hŒ&Using BPF programs in the Linux kernel”…””}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjih²hh³hÊh´K>ubhè)”}”(hŒˆLinux Kernel (while being GPLv2) allows linking of proprietary kernel modules under these rules: Documentation/process/license-rules.rst”h]”hŒˆLinux Kernel (while being GPLv2) allows linking of proprietary kernel modules under these rules: Documentation/process/license-rules.rst”…””}”(hjzh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´K@hjih²hubhè)”}”(hŒËWhen a kernel module is loaded, the linux kernel checks which functions it intends to use. If any function is marked as "GPL only," the corresponding module or program has to have GPL compatible license.”h]”hŒÏWhen a kernel module is loaded, the linux kernel checks which functions it intends to use. If any function is marked as “GPL only,†the corresponding module or program has to have GPL compatible license.”…””}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´KDhjih²hubhè)”}”(hX;Loading BPF program into the Linux kernel is similar to loading a kernel module. BPF is loaded at run time and not statically linked to the Linux kernel. BPF program loading follows the same license checking rules as kernel modules. BPF programs can be proprietary if they don't use "GPL only" BPF helper functions.”h]”hXALoading BPF program into the Linux kernel is similar to loading a kernel module. BPF is loaded at run time and not statically linked to the Linux kernel. BPF program loading follows the same license checking rules as kernel modules. BPF programs can be proprietary if they don’t use “GPL only†BPF helper functions.”…””}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´KHhjih²hubhè)”}”(hX9Further, some BPF program types - Linux Security Modules (LSM) and TCP Congestion Control (struct_ops), as of Aug 2021 - are required to be GPL compatible even if they don't use "GPL only" helper functions directly. The registration step of LSM and TCP congestion control modules of the Linux kernel is done through EXPORT_SYMBOL_GPL kernel functions. In that sense LSM and struct_ops BPF programs are implicitly calling "GPL only" functions. The same restriction applies to BPF programs that call kernel functions directly via unstable interface also known as "kfunc".”h]”hXGFurther, some BPF program types - Linux Security Modules (LSM) and TCP Congestion Control (struct_ops), as of Aug 2021 - are required to be GPL compatible even if they don’t use “GPL only†helper functions directly. The registration step of LSM and TCP congestion control modules of the Linux kernel is done through EXPORT_SYMBOL_GPL kernel functions. In that sense LSM and struct_ops BPF programs are implicitly calling “GPL only†functions. The same restriction applies to BPF programs that call kernel functions directly via unstable interface also known as “kfuncâ€.”…””}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´KNhjih²hubeh}”(h]”Œ&using-bpf-programs-in-the-linux-kernel”ah ]”h"]”Œ&using bpf programs in the linux kernel”ah$]”h&]”uh1hµhh·h²hh³hÊh´K>ubh¶)”}”(hhh]”(h»)”}”(hŒ3Packaging BPF programs with user space applications”h]”hŒ3Packaging BPF programs with user space applications”…””}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjºh²hh³hÊh´KXubhè)”}”(hŒåGenerally, proprietary-licensed applications and GPL licensed BPF programs written for the Linux kernel in the same package can co-exist because they are separate executable processes. This applies to both cBPF and eBPF programs.”h]”hŒåGenerally, proprietary-licensed applications and GPL licensed BPF programs written for the Linux kernel in the same package can co-exist because they are separate executable processes. This applies to both cBPF and eBPF programs.”…””}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçh³hÊh´KZhjºh²hubeh}”(h]”Œ3packaging-bpf-programs-with-user-space-applications”ah ]”h"]”Œ3packaging bpf programs with user space applications”ah$]”h&]”uh1hµhh·h²hh³hÊh´KXubeh}”(h]”Œ bpf-licensing”ah ]”h"]”Œ bpf licensing”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jæjãjjjgjfjcj°j­jj j7j4j^j[j·j´jÞjÛuŒ nametypes”}”(jæ‰jj‰jf‰j°‰j‰j7‰j^‰j·‰jÞ‰uh}”(jãh·jghËjcjmj­jŒj j³j4jj[j:j´jijÛjºuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.