Files
Tim Zimmermann 3996f04715 Squashed revert of BPF backports
Revert "Partially revert "fixup: add back code missed during BPF picking""

This reverts commit cc477455f73d317733850a9e4818dfd90be4d33d.

Revert "bpf: lpm_trie: check left child of last leftmost node for NULL"

This reverts commit e89007b7df49292c5ae52b3d165c0d815a61cd10.

Revert "BACKPORT: bpf: Fix out-of-bounds write in trie_get_next_key()"

This reverts commit a1c4f565bb00b05ab3734a64451c08b0b965ce42.

Revert "bpf: Fix exact match conditions in trie_get_next_key()"

This reverts commit 4356a64dad3d38372147457b3004930c6e2e9c51.

Revert "bpf: fix kernel page fault in lpm map trie_get_next_key"

This reverts commit df4649b5d6cb374edbb67e5a5ecbd102a2e6c897.

Revert "bpf: implement MAP_GET_NEXT_KEY command for LPM_TRIE map"

This reverts commit fe6656a5d48df6144fe9929399c648957166edd0.

Revert "bpf: allow helpers to return PTR_TO_SOCK_COMMON"

This reverts commit b24d1ae9ccbf3ebe6f4baa50d2d48c03be02bc17.

Revert "bpf: implement lookup-free direct value access for maps"

This reverts commit de1959fcd3df0629380894d9c47ebb253c920ad1.

Revert "bpf: Add bpf_verifier_vlog() and bpf_verifier_log_needed()"

This reverts commit b777824607bd3eb8c9130f4639d97d15bcac9af5.

Revert "bpf: Don't return EINVAL from {get,set}sockopt when optlen > PAGE_SIZE"

This reverts commit 4cfef728c1eac6cce34f4fff1fbab3e66dc430d9.

Revert "bpf: always allocate at least 16 bytes for setsockopt hook"

This reverts commit 59817f83c964c753e93a75128ecaad4eeaa769fc.

Revert "bpf, sockmap: convert to generic sk_msg interface"

This reverts commit fe4ef742e22924b21749de333211941d0205501e.

Revert "bpf: sockmap, convert bpf_compute_data_pointers to bpf_*_sk_skb"

This reverts commit d17c8c2c2f623e087d6c297de50c173a006e6e55.

Revert "bpf: sockmap: fix typos"

This reverts commit 07e31378d7795371cdbccce06b4125b27ffce536.

Revert "sockmap: convert refcnt to an atomic refcnt"

This reverts commit c1fa11ec9da5dc0e8cae4334c550264cff77eef9.

Revert "bpf: sockmap, add hash map support"

This reverts commit 3f43379c38e329e9a7d4b5a1640670de37ba317b.

Revert "bpf: sockmap, refactor sockmap routines to work with hashmap"

This reverts commit 41a2b6e925db031978eb2484835f60908de884d7.

Revert "bpf: implement getsockopt and setsockopt hooks"

This reverts commit 9526fe6ff3e06939c12bb781e0dda01a8f3017ec.

Revert "bpf: Introduce bpf sk local storage"

This reverts commit ffedc38a46ddaca40de672fafe78c45fbfae9839.

Revert "bpf: introduce BPF_F_LOCK flag"

This reverts commit e7f5758fbcb1674e17c645837f7bff3b1febbad5.

Revert "bpf: Introduce ARG_PTR_TO_{INT,LONG} arg types"

This reverts commit e29b4e3c2bdd3b5d0d34668836ae8e5115cb31af.

Revert "bpf/verifier: add ARG_PTR_TO_UNINIT_MAP_VALUE"

This reverts commit f25c66c27cd6a774fb73769d804f91e969dd5f7b.

Revert "bpf: allow map helpers access to map values directly"

This reverts commit 7af696635219d0c5cdf1a166bb7543cae9e50328.

Revert "bpf: add writable context for raw tracepoints"

This reverts commit a546d8f0433039cee0de6ce96d5d35c4033a7b98.

Revert "bpf: Add struct bpf_tcp_sock and BPF_FUNC_tcp_sock"

This reverts commit 03093478c52e79c94791a04f8138d5c019119087.

Revert "bpf: Support socket lookup in CGROUP_SOCK_ADDR progs"

This reverts commit 8047013945361fbff0e449c8a212cb6fc93a5245.

Revert "bpf: Extend the sk_lookup() helper to XDP hookpoint."

This reverts commit 8315368983086e70ccc6f103d710903c63cca7df.

Revert "xdp: generic XDP handling of xdp_rxq_info"

This reverts commit 11d9514e6e6801941abf1c0485fd4ef53082d970.

Revert "xdp: move struct xdp_buff from filter.h to xdp.h"

This reverts commit a1795f54e4d99e02d5cb84a46fac0240cf29e206.

Revert "net: avoid including xdp.h in filter.h"

This reverts commit a39c59398f3ab64de44e5953ee0bd23c5136bb48.

Revert "xdp: base API for new XDP rx-queue info concept"

This reverts commit 49fb5bae77ab2041a2ad9f9f87ad7e0a6e215fdf.

Revert "net: Add asynchronous callbacks for xfrm on layer 2."

This reverts commit d0656f64d7719993d5634a9fc6600026e9a805ee.

Revert "xfrm: Separate ESP handling from segmentation for GRO packets."

This reverts commit c8afadf7f5ed8786652d307558345ef90ea91726.

Revert "net: move secpath_exist helper to sk_buff.h"

This reverts commit 0e5483057121dad47567b01845c656955e51989e.

Revert "sk_buff: add skb extension infrastructure"

This reverts commit 3a9ae74b075757495c4becf4dd1eec056d364801.

Revert "fixup: add back code missed during BPF picking"

This reverts commit 74ec8cef7051b5af72f2a6d83ca8c51c3c61c444.

Revert "bpf: undo prog rejection on read-only lock failure"

This reverts commit af2dc6e4993c4221603dbe6e81a3d0c8269f3171.

Revert "bpf: Add helper to retrieve socket in BPF"

This reverts commit 53495e3bc33cb46d9961ea122f576faded058aa1.

Revert "SQUASH! bpf: Add a bpf_sock pointer to __sk_buff and a bpf_sk_fullsock helpe"

This reverts commit 3b25fbf81c041af954d9f5ac1c7867eb07c40b07.

Revert "bpf: introduce bpf_spin_lock"

This reverts commit 0095fb54160e4f8b326fa8df103e334f90c5ab56.

Revert "bpf: enable cgroup local storage map pretty print with kind_flag"

This reverts commit 3fe92cb79b5eae557b113c37b03e78efee2280db.

Revert "bpf: btf: fix struct/union/fwd types with kind_flag"

This reverts commit 2bd4856277f459974dd6234a849cbe20fd475b8f.

Revert "bpf: add bpffs pretty print for cgroup local storage maps"

This reverts commit e07d8c8279f37cee8471846a63acc51f1ab7ce03.

Revert "bpf: pass struct btf pointer to the map_check_btf() callback"

This reverts commit 78a8140faf32710799c19495db28d71693c98030.

Revert "bpf: Define cgroup_bpf_enabled for CONFIG_CGROUP_BPF=n"

This reverts commit aada945d89950c67099e490af1c4c25eef7f31e6.

Revert "bpf: introduce per-cpu cgroup local storage"

This reverts commit d37432968663559f06c7fd7df44197a807fb84ca.

Revert "bpf: btf: Rename btf_key_id and btf_value_id in bpf_map_info"

This reverts commit 063c5a25e5f47e8b82b6c43a44ed7be851884abb.

Revert "bpf: fix a compilation error when CONFIG_BPF_SYSCALL is not defined"

This reverts commit bcf5bfaf50bb6f1f981d5c538f87e6da7aab78f2.

Revert "bpf: Create a new btf_name_by_offset() for non type name use case"

This reverts commit 52b4739d0bdd763e1b00feb50bef8a821f5c7570.

Revert "bpf: reject any prog that failed read-only lock"

This reverts commit 30d1bfec06a3bcaa773213113904580e3046a57a.

Revert "bpf: Add bpf_line_info support"

This reverts commit 50b094eeeb1ced32c62b3a10045bbf43126de760.

Revert "bpf: don't leave partial mangled prog in jit_subprogs error path"

This reverts commit a466f85be89f5daab4bd748f92915ea713d63934.

Revert "bpf: btf: support proper non-jit func info"

This reverts commit 492a556de94c502376ec3b0d5a724ec9fe9f6996.

Revert "bpf: Introduce bpf_func_info"

This reverts commit 39cade88686b0d9b7befc1f14e9d2c2cad19a769.

Revert "bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO"

This reverts commit 2010b6bacc271a48e74942506f3cf45268b6c264.

Revert "bpf: fix bpf_prog_get_info_by_fd to return 0 func_lens for unpriv"

This reverts commit a0ea14ac88a0f5529a635fc6e20277942fc6bb99.

Revert "bpf: Expose check_uarg_tail_zero()"

This reverts commit 1190aaae686534c2854838b3d642dac45d26b1f4.

Revert "bpf: Append prog->aux->name in bpf_get_prog_name()"

This reverts commit 8b82528df4a11a8501393c854978662fc218014e.

Revert "bpf: get JITed image lengths of functions via syscall"

This reverts commit 0722dbc626915fcb9acb952ebc1fcb0c4554cb07.

Revert "bpf: get kernel symbol addresses via syscall"

This reverts commit 6736ec7558dd262fef6669eec02a9797c7c4ecb7.

Revert "bpf: Add gpl_compatible flag to struct bpf_prog_info"

This reverts commit b60c7a51fd3692259c93413f3e87150078be1dac.

Revert "bpf: centre subprog information fields"

This reverts commit b5186fdf6f3e1bb38d7e4abfed5bf7dd6f85a6c3.

Revert "bpf: unify main prog and subprog"

This reverts commit e8e2ad5d9ae98bc7b85b99c0712a5dfbfc151a41.

Revert "bpf: fix maximum stack depth tracking logic"

This reverts commit 10c7127615dc2c00b724069a1620b2232d905113.

Revert "bpf, x64: fix memleak when not converging on calls"

This reverts commit 6bc867f718ef2656266f984b605151971026cc98.

Revert "bpf: decouple btf from seq bpf fs dump and enable more maps"

This reverts commit 3036e2c4384d3f43c695b88c8a1cf97b8337e3bd.

Revert "bpf: Add reference tracking to verifier"

This reverts commit 3a4900a188ac4de817dc6f114f01159d7bdd2f3e.

Revert "bpf: properly enforce index mask to prevent out-of-bounds speculation"

This reverts commit ef85925d5c07b46f7447487605da601fc7be026e.

Revert "bpf, verifier: detect misconfigured mem, size argument pair"

This reverts commit c3853ee3cb96833e907f18bf90e78040fe4cf06f.

Revert "bpf: introduce ARG_PTR_TO_MEM_OR_NULL"

This reverts commit 58560e13f545f2a079bbce17ac1b731d8b94fec7.

Revert "bpf: Macrofy stack state copy"

This reverts commit 88d98d8c2ae320ab248150eb86e1c89427e5017c.

Revert "bpf: Generalize ptr_or_null regs check"

This reverts commit d2cbc2e57b8624699a1548e67b7b3ce992b396fc.

Revert "bpf: Add iterator for spilled registers"

This reverts commit d956e1ba51a7e5ce86bb35002e26d4c1e0a2497c.

Revert "bpf/verifier: refine retval R0 state for bpf_get_stack helper"

This reverts commit ceaf6d678ccb60da107b0455da64c7bf90c5102d.

Revert "bpf: Remove struct bpf_verifier_env argument from print_bpf_insn"

This reverts commit 058fd54c07a289f9b506f2d2326434e411fa65fe.

Revert "bpf: annotate bpf_insn_print_t with __printf"

This reverts commit 9b07d2ccf07855d62446e274d817672713f15be4.

Revert "bpf: allow for correlation of maps and helpers in dump"

This reverts commit af690c2e2d177352f7270f77d8a6bc9e9f60c98c.

Revert "bpf: Add bpf_patch_call_args prototype to include/linux/bpf.h"

This reverts commit 8a2c588b3ab98916147fe4a449312ce8db70c471.

Revert "bpf: x64: add JIT support for multi-function programs"

This reverts commit 752f261e545f80942272c6becf82def1729f84be.

Revert "bpf: fix net.core.bpf_jit_enable race"

This reverts commit 4720901114c20204aa3ffa2076265d2c8cc9e81b.

Revert "bpf: add support for bpf_call to interpreter"

This reverts commit c79b2e547adc8e50dabc72244370cfd37ac6a6bd.

Revert "bpf: introduce function calls (verification)"

This reverts commit f779fda96c7d9e921525f48d67fa2e9c68b4bd48.

Revert "bpf: cleanup register_is_null()"

This reverts commit 1c81f751670b4feb3102e4de136e25fa24e303fe.

Revert "bpf: print liveness info to verifier log"

This reverts commit fdc851301b33b9d646bd1d37124cbd45cedcd62b.

Revert "bpf: also improve pattern matches for meta access"

This reverts commit 9aa150d07927b911f26e0db2af0efd6aa07b8707.

Revert "bpf: add meta pointer for direct access"

This reverts commit 94f3f502ef9ef150ed687113cfbd38e91b5edc44.

Revert "bpf: rename bpf_compute_data_end into bpf_compute_data_pointers"

This reverts commit 9573c6feb301346cd1493eea4e363c6d8345e899.

Revert "bpf: squash of log related commits"

This reverts commit b08f2111e030a72a92eec4ebd6201165d03a20b8.

Revert "bpf: move instruction printing into a separate file"

This reverts commit 8fcbd39afb58847914f3f84d9c076000e09d2fb9.

Revert "bpf: btf: Introduce BTF ID"

This reverts commit 423c40d67dfc783c3b0cb227d9da53e725e0f35c.

Revert "bpf: btf: Add pretty print support to the basic arraymap"

This reverts commit 6cd4d5bba662ca0d8980e5806ef37e0341eab929.

Revert "nsfs: clean-up ns_get_path() signature to return int"

This reverts commit ec1ce41701f411c5dee396cec2931fb651f447cc.

Revert "bpf_obj_do_pin(): switch to vfs_mkobj(), quit abusing ->mknod()"

This reverts commit 8fbcb4ebf5a751f4685cdd2757cff2264032a5d9.

Revert "bpf: offload: report device information about offloaded maps"

This reverts commit 1105e63f25a9db675671288b583a5ce2c7d10b1f.

Revert "bpf: offload: add map offload infrastructure"

This reverts commit 20cdf9df3d5bd010d799ea3c80219f625c998307.

Revert "bpf: add map_alloc_check callback"

This reverts commit 6feb4121ea083053ac9587ac426195efe9fb143d.

Revert "bpf: offload: factor out netdev checking at allocation time"

This reverts commit 1425fb5676b8fe9d761f2f6545e4be8880ce0ac8.

Revert "bpf: rename bpf_dev_offload -> bpf_prog_offload"

This reverts commit a03ae0ec508200433fd6c35b87e342df4de0b320.

Revert "bpf: offload: allow netdev to disappear while verifier is running"

This reverts commit f6cf7214fd1ff3a018009ba90c33eac1d8de21de.

Revert "bpf: offload: free program id when device disappears"

This reverts commit b12b5e56b799cfe900ab8f0ee4177c6c08a904c6.

Revert "bpf: offload: report device information for offloaded programs"

This reverts commit c73c9a0ffa332eeb49927a48780f5537597e2d42.

Revert "bpf: offload: don't require rtnl for dev list manipulation"

This reverts commit 1993f08662f07581a370899a2da209ba0c996dbb.

Revert "bpf: offload: ignore namespace moves"

This reverts commit 9fefb21d8aa2691019f9c4f0b8025fb45ba60b49.

Revert "bpf: Add PTR_TO_SOCKET verifier type"

This reverts commit 55fdbc844801cd4007237fa6c5842b46985a5c9a.

Revert "bpf: extend cgroup bpf core to allow multiple cgroup storage types"

This reverts commit a6d82e371ef32fb24d493cff32765b4607581dd4.

Revert "bpf: permit CGROUP_DEVICE programs accessing helper bpf_get_current_cgroup_id()"

This reverts commit 1bfd0a07a8317004a89d6de736e24861db8281b5.

Revert "bpf: implement bpf_get_current_cgroup_id() helper"

This reverts commit 23603ed6d7df86392701a7ea7d9a1dba66f28d4b.

Revert "bpf: introduce the bpf_get_local_storage() helper function"

This reverts commit 3d777256b1c9f34975c5230d836023ea3e0d4cfd.

Revert "bpf/verifier: introduce BPF_PTR_TO_MAP_VALUE"

This reverts commit 93c12733dc97984f7bf57a77160eacc480bfc3de.

Revert "bpf: extend bpf_prog_array to store pointers to the cgroup storage"

This reverts commit b26baff1fb34607938c9ac0e421e3f4b5fedad4d.

Revert "BACKPORT: bpf: allocate cgroup storage entries on attaching bpf programs"

This reverts commit 804605c21a3be3277c0031504dcd3fdd1be64290.

Revert "bpf: include errno.h from bpf-cgroup.h"

This reverts commit 6b4df332b357e9a5942ca4c6f985cd33dfc30e25.

Revert "bpf: pass a pointer to a cgroup storage using pcpu variable"

This reverts commit c8af92dc9fc00e49f06f6997969284ef5e5c5af5.

Revert "bpf: introduce cgroup storage maps"

This reverts commit c61c2271cb8a1e47678bddc8cdfae83035a07fec.

Revert "bpf: add ability to charge bpf maps memory dynamically"

This reverts commit 3a430745e9f675b450477fffead5568046432f29.

Revert "bpf: add helper for copying attrs to struct bpf_map"

This reverts commit 6d7be0ae93371692e564c00003ce184cbaefbb8d.

Revert "bpf: introduce new bpf cpu map type BPF_MAP_TYPE_CPUMAP"

This reverts commit 15f584d2d3d4814cfbd3059ab810db02af8773a0.

Revert "bpf/tracing: fix a deadlock in perf_event_detach_bpf_prog"

This reverts commit fc9bf5e48985f7c3a39bf34a27477a2607a5dc6d.

Revert "bpf: set maximum number of attached progs to 64 for a single perf tp"

This reverts commit 0d5fc9795d824fbca21b81c8d91748ba21313d4c.

Revert "bpf: avoid rcu_dereference inside bpf_event_mutex lock region"

This reverts commit 948e200e3173dd959de907e326f2a2c90eda4b28.

Revert "bpf: fix bpf_prog_array_copy_to_user() issues"

This reverts commit 66811698b8de9b3cf13c09730d287b6d1d5d3699.

Revert "bpf: fix pointer offsets in context for 32 bit"

This reverts commit 99661813c136c52e56b328a2a8ecd2bc0e187eba.

Revert "BACKPORT: bpf: create tcp_bpf_ulp allowing BPF to monitor socket TX/RX data"

This reverts commit 36f0ea00dd121b13f80617e5b2eb93ba160df85a.

Revert "BACKPORT: bpf: Sysctl hook"

This reverts commit 4a543990e03b5de4a2c23777abd0f77afd61cc2d.

Revert "BACKPORT: flow_dissector: implements flow dissector BPF hook"

This reverts commit de610a8a4324170a0deaf12e2e64c2ff068785fb.

Revert "BACKPORT: bpf: Add base proto function for cgroup-bpf programs"

This reverts commit f3ac0a6cbec3472ff2e3808a436891881f3cbf87.

Revert "FROMLIST: [net-next,v2,1/2] bpf: Allow CGROUP_SKB eBPF program to access sk_buff"

This reverts commit 6d4dcc0e3de628003d91075e4b1ab1a128b8892e.

Revert "BACKPORT: bpf: introduce BPF_RAW_TRACEPOINT"

This reverts commit b2a5c6b4958c8250e58ddb6c334018a5f7ee5437.

Revert "bpf/tracing: fix kernel/events/core.c compilation error"

This reverts commit 70249d4eb7359e9dc59e044951beb99d0d8725cd.

Revert "BACKPORT: bpf/tracing: allow user space to query prog array on the same tp"

This reverts commit 08a6d8c01372940bfec78fdc6cb8a47e08c745b0.

Revert "bpf: sockmap, add sock close() hook to remove socks"

This reverts commit e6b363b8d09d9740dff309fb4dc88e7a1e90726b.

Revert "BACKPORT: bpf: remove the verifier ops from program structure"

This reverts commit 94c2f61efa741bf6a97415f42cfbfb9ec83dfd8e.

Revert "bpf, cgroup: implement eBPF-based device controller for cgroup v2"

This reverts commit 22faa9c56550a34488e607ca3aca59c68b1f7938.

Revert "BACKPORT: bpf: split verifier and program ops"

This reverts commit d2b1388504c1129d5756bb9b20af9bd64e75d015.

Revert "bpf: btf: Break up btf_type_is_void()"

This reverts commit 052989c47b68feaf381d371ec1e6a169edc26d30.

Revert "bpf: btf: refactor btf_int_bits_seq_show()"

This reverts commit 8cc3fb30656cfab91205194a8ee7661bdd95e005.

Revert "BACKPORT: bpf: fix unconnected udp hooks"

This reverts commit b108e725aa70e39cfd37296d1a1d31e8896fa7b7.

Revert "BACKPORT: bpf: enforce return code for cgroup-bpf programs"

This reverts commit 10215080915bfbdaa9f666a95ffda02cc1ef7a29.

Revert "bpf: Hooks for sys_sendmsg"

This reverts commit cd847db1be8a37e0e7e9c813b5d8f93697dc5af0.

Revert "BACKPORT: devmap: Allow map lookups from eBPF"

This reverts commit 37da95fde647e8967b362e0769136bfbebc03628.

Revert "BACKPORT: xdp: Add devmap_hash map type for looking up devices by hashed index"

This reverts commit ae6a87f44c4ef20ac290ce68c4d5b542cf46f3d7.

Revert "kernel: bpf: devmap: Create __dev_map_alloc_node"

This reverts commit 15928a97ed93cf9f606a21bf869ff421b997a2c5.

Revert "BACKPORT: bpf: Post-hooks for sys_bind"

This reverts commit c221d44e76c3ab69285c9986680e5eb726cf157b.

Revert "BACKPORT: bpf: Hooks for sys_connect"

This reverts commit 003311ea43163c77e4e0c1921b81438286925baa.

Revert "BACKPORT: net: Introduce __inet_bind() and __inet6_bind"

This reverts commit 74f1eb60012c13bd606e4dc718e63aec7f8cce8f.

Revert "BACKPORT: bpf: Hooks for sys_bind"

This reverts commit cef0bd97f2fec8363c3ef58b2cb508deaa9bc5b2.

Revert "BACKPORT: bpf: introduce BPF_PROG_QUERY command"

This reverts commit a4ef81ce48cb25843ddb4d4331dacf2742215909.

Revert "BACKPORT: bpf: Check attach type at prog load time"

This reverts commit 750a3f976c75797e572a6dfdd2e8865b8b49964a.

Revert "bpf: offload: rename the ifindex field"

This reverts commit 921e6becfb28fbe505603bf927f195d1d72a0eea.

Revert "BACKPORT: bpf: offload: add infrastructure for loading programs for a specific netdev"

This reverts commit cb1607a58d026a4ac1d9e71f6c3cd1dc23820e2f.

Revert "BACKPORT: net: bpf: rename ndo_xdp to ndo_bpf"

This reverts commit 932d47ebc5910bb1ec954002206b1ce8749a9cd6.

Revert "bpf: btf: fix truncated last_member_type_id in btf_struct_resolve"

This reverts commit e7af669fe00a8e2030913088836189a9f65a04d8.

Revert "bpf/btf: Fix BTF verification of enum members in struct/union"

This reverts commit a098516b98fe35e8f0e89709443fff8b37eb04b8.

Revert "bpf: fix BTF limits"

This reverts commit 794ad07fab9540989f96351c11b039e2229c2a8e.

Revert "bpf, btf: fix a missing check bug in btf_parse"

This reverts commit 27c4178ecc8edbb2306fa479f275ffd35f5b57c9.

Revert "bpf: btf: Fix a missing check bug"

This reverts commit 71f5a7d140aa5a37d164e217b2fefcb2d409b894.

Revert "bpf: btf: Fix end boundary calculation for type section"

This reverts commit 549615befd671b6877677acb009b66cd374408d3.

Revert "bpf: fix bpf_skb_load_bytes_relative pkt length check"

This reverts commit 5f3d68c4da18dfbcde4c02cb34c63599709fcf3c.

Revert "bpf: btf: Ensure the member->offset is in the right order"

This reverts commit 4f9d26cbc747a4728c4944b7dc9725fc2737f892.

Revert "bpf: btf: Clean up BTF_INT_BITS() in uapi btf.h"

This reverts commit 480c6f80a14431f6d680a687363dcb0d9cd1d7a8.

Revert "bpf: btf: Fix bitfield extraction for big endian"

This reverts commit 0463c259aa21e99d1bf798c8cf54da18b5906938.

Revert "bpf: btf: Ensure t->type == 0 for BTF_KIND_FWD"

This reverts commit ecc54be6970a3484eb163ac09996856c9ece5727.

Revert "bpf: btf: Check array t->size"

This reverts commit 3cda848b9be9fbb6dfa8912a425801c263bcbff7.

Revert "bpf: btf: avoid -Wreturn-type warning"

This reverts commit fd7fede5952004dcacb39f318249c4cf8e5c51e0.

Revert "bpf: btf: Avoid variable length array"

This reverts commit 2826641eb171c705d0b2db86d8834eff33945d0e.

Revert "bpf: btf: Remove unused bits from uapi/linux/btf.h"

This reverts commit 2d9e7a574f7e47a027974ec616ac812ad6a2d086.

Revert "bpf: btf: Check array->index_type"

This reverts commit f9ee68f7e8a471450536a70b43bd96d4bdfbfb81.

Revert "bpf: btf: Change how section is supported in btf_header"

This reverts commit 63a4474da4bf56c8a700d542bcf3a57a4b737ed6.

Revert "bpf: Fix compiler warning on info.map_ids for 32bit platform"

This reverts commit a4f706ea7d2b874ef739168a12a30ae5454487a6.

Revert "BACKPORT: bpf: Use char in prog and map name"

This reverts commit 8d4ad88eabb5d1500814c5f5b76a11f80346669c.

Revert "bpf: Change bpf_obj_name_cpy() to better ensure map's name is init by 0"

This reverts commit c4acfd3c9f5a97123c240676750f3e4ae2a2c24c.

Revert "BACKPORT: bpf: Add map_name to bpf_map_info"

This reverts commit 0e03a4e584eabe3f4c448f06f271753cdaae3aab.

Revert "BACKPORT: bpf: Add name, load_time, uid and map_ids to bpf_prog_info"

This reverts commit 16872f60e6c1fc6b10e905ff18c14d8aaeb4e09d.

Revert "bpf: btf: Avoid WARN_ON when CONFIG_REFCOUNT_FULL=y"

This reverts commit 0b618ec6e162e650aaa583a31f4de4c4558148bf.

Revert "BACKPORT: bpf: btf: Clean up btf.h in uapi"

This reverts commit ea0c0ad08c18ddf62dbb6c8edc814c75cbb3e8b9.

Revert "bpf: btf: Add BPF_OBJ_GET_INFO_BY_FD support to BTF fd"

This reverts commit f51fe1d1edb742176c622bc93301e98a1cbf2e63.

Revert "BACKPORT: bpf: btf: Add BPF_BTF_LOAD command"

This reverts commit 85db8f764069f15d1b181bea67336ce4d66a58c1.

Revert "bpf: btf: Add pretty print capability for data with BTF type info"

This reverts commit 0a8aae433c53b1f441cab70979517660fb6a6038.

Revert "bpf: btf: Check members of struct/union"

This reverts commit ce2e8103ac1a977ce32db51ec042faea6f100a3d.

Revert "bpf: btf: Validate type reference"

This reverts commit a1aa96e6dae2b4c8c0b0a4dedab3006d3f697460.

Revert "bpf: Update logging functions to work with BTF"

This reverts commit b9289460f0a6b5c261ec0b6dcafa6fcd09d4957e.

Revert "BACKPORT: bpf: btf: Introduce BPF Type Format (BTF)"

This reverts commit ceebd58f6470e8ec6d9d694ab382fe88f43b998b.

Revert "BACKPORT: bpf: Rename bpf_verifer_log"

This reverts commit 50bdc7513d966811fb418d24a0e5797ffd8c907c.

Revert "BACKPORT: bpf: encapsulate verifier log state into a structure"

This reverts commit 0bcb397bde4675fdeb977d9debed20ed213f9ecd.

Change-Id: Iecaa276b078c6d2db773a8071e7da9e6195277d6
2025-10-02 22:12:00 +08:00

89 lines
2.6 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* procfs namespace bits
*/
#ifndef _LINUX_PROC_NS_H
#define _LINUX_PROC_NS_H
#include <linux/ns_common.h>
struct pid_namespace;
struct nsproxy;
struct path;
struct task_struct;
struct inode;
struct proc_ns_operations {
const char *name;
const char *real_ns_name;
int type;
struct ns_common *(*get)(struct task_struct *task);
void (*put)(struct ns_common *ns);
int (*install)(struct nsproxy *nsproxy, struct ns_common *ns);
struct user_namespace *(*owner)(struct ns_common *ns);
struct ns_common *(*get_parent)(struct ns_common *ns);
} __randomize_layout;
extern const struct proc_ns_operations netns_operations;
extern const struct proc_ns_operations utsns_operations;
extern const struct proc_ns_operations ipcns_operations;
extern const struct proc_ns_operations pidns_operations;
extern const struct proc_ns_operations pidns_for_children_operations;
extern const struct proc_ns_operations userns_operations;
extern const struct proc_ns_operations mntns_operations;
extern const struct proc_ns_operations cgroupns_operations;
/*
* We always define these enumerators
*/
enum {
PROC_ROOT_INO = 1,
PROC_IPC_INIT_INO = 0xEFFFFFFFU,
PROC_UTS_INIT_INO = 0xEFFFFFFEU,
PROC_USER_INIT_INO = 0xEFFFFFFDU,
PROC_PID_INIT_INO = 0xEFFFFFFCU,
PROC_CGROUP_INIT_INO = 0xEFFFFFFBU,
};
#ifdef CONFIG_PROC_FS
extern int pid_ns_prepare_proc(struct pid_namespace *ns);
extern void pid_ns_release_proc(struct pid_namespace *ns);
extern int proc_alloc_inum(unsigned int *pino);
extern void proc_free_inum(unsigned int inum);
#else /* CONFIG_PROC_FS */
static inline int pid_ns_prepare_proc(struct pid_namespace *ns) { return 0; }
static inline void pid_ns_release_proc(struct pid_namespace *ns) {}
static inline int proc_alloc_inum(unsigned int *inum)
{
*inum = 1;
return 0;
}
static inline void proc_free_inum(unsigned int inum) {}
#endif /* CONFIG_PROC_FS */
static inline int ns_alloc_inum(struct ns_common *ns)
{
atomic_long_set(&ns->stashed, 0);
return proc_alloc_inum(&ns->inum);
}
#define ns_free_inum(ns) proc_free_inum((ns)->inum)
extern struct file *proc_ns_fget(int fd);
#define get_proc_ns(inode) ((struct ns_common *)(inode)->i_private)
extern void *ns_get_path(struct path *path, struct task_struct *task,
const struct proc_ns_operations *ns_ops);
typedef struct ns_common *ns_get_path_helper_t(void *);
extern void *ns_get_path_cb(struct path *path, ns_get_path_helper_t ns_get_cb,
void *private_data);
extern int ns_get_name(char *buf, size_t size, struct task_struct *task,
const struct proc_ns_operations *ns_ops);
extern void nsfs_init(void);
#endif /* _LINUX_PROC_NS_H */