Skip to content

Conversation

@renovate
Copy link

@renovate renovate bot commented Mar 22, 2023

Mend Renovate

Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


Detected Package Files

  • .github/actions/vmtest/action.yml (github-actions)
  • .github/workflows/build.yml (github-actions)
  • .github/workflows/cifuzz.yml (github-actions)
  • .github/workflows/codeql.yml (github-actions)
  • .github/workflows/coverity.yml (github-actions)
  • .github/workflows/lint.yml (github-actions)
  • .github/workflows/ondemand.yml (github-actions)
  • .github/workflows/pahole.yml (github-actions)
  • .github/workflows/test.yml (github-actions)
  • docs/sphinx/requirements.txt (pip_requirements)

Configuration Summary

Based on the default config's presets, Renovate will:

  • Start dependency updates only once this onboarding PR is merged
  • Enable Renovate Dependency Dashboard creation.
  • If Renovate detects semantic commits, it will use semantic commit type fix for dependencies and chore for all others.
  • Ignore node_modules, bower_components, vendor and various test/tests directories.
  • Group known monorepo packages together.
  • Use curated list of recommended non-monorepo package groupings.
  • apollo-server packages became scoped.
  • babel-eslint was renamed under the @babel scope.
  • Replace containerbase dependencies.
  • cucumber became scoped.
  • fastify packages became scoped.
  • hapi became scoped.
  • Jade was renamed to Pug.
  • joi became scoped under the hapi organization.
  • joi was moved out of the hapi organization.
  • The Kubernetes container registry has changed from k8s.gcr.io to registry.k8s.io.
  • The Kubernetes container registry has changed from k8s.gcr.io to registry.k8s.io.
  • The material-ui monorepo org was renamed from @material-ui to @mui.
  • The messageformat monorepo package naming scheme changed from messageFormat-{{package}}-to-@messageformat/{{package}}.
  • middie became scoped.
  • now was renamed to vercel.
  • @parcel/css was renamed to lightningcss.
  • react-query/devtools became scoped under the tanstack organization.
  • react-query became scoped under the tanstack organization.
  • react-scripts supports TypeScript since version 2.1.0.
  • The @renovate/pep440 package was renamed to @renovatebot/pep440.
  • The node-resolve plugin for rollup became scoped.
  • The vso-task-lib package is now published as azure-pipelines-task-lib.
  • The vsts-task-lib package is now published as azure-pipelines-task-lib.
  • The xmldom package is now published as @xmldom/xmldom.
  • A collection of workarounds for known problems with packages.

🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


What to Expect

With your current configuration, Renovate will create 2 Pull Requests:

chore(deps): update uraimo/run-on-arch-action action to v2.5.0
  • Schedule: ["at any time"]
  • Branch name: renovate/uraimo-run-on-arch-action-2.x
  • Merge into: master
  • Upgrade uraimo/run-on-arch-action to v2.5.0
chore(deps): update actions/upload-artifact action to v3
  • Schedule: ["at any time"]
  • Branch name: renovate/actions-upload-artifact-3.x
  • Merge into: master
  • Upgrade actions/upload-artifact to v3

❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section.
If you need any further assistance then you can also request help here.


This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot changed the title Configure Renovate Configure Renovate - autoclosed Apr 4, 2023
@renovate renovate bot closed this Apr 4, 2023
@renovate renovate bot deleted the renovate/configure branch April 4, 2023 00:08
thiagoftsm pushed a commit that referenced this pull request Jan 24, 2024
An issue occurred while reading an ELF file in libbpf.c during fuzzing:

	Program received signal SIGSEGV, Segmentation fault.
	0x0000000000958e97 in bpf_object.collect_prog_relos () at libbpf.c:4206
	4206 in libbpf.c
	(gdb) bt
	#0 0x0000000000958e97 in bpf_object.collect_prog_relos () at libbpf.c:4206
	#1 0x000000000094f9d6 in bpf_object.collect_relos () at libbpf.c:6706
	#2 0x000000000092bef3 in bpf_object_open () at libbpf.c:7437
	#3 0x000000000092c046 in bpf_object.open_mem () at libbpf.c:7497
	#4 0x0000000000924afa in LLVMFuzzerTestOneInput () at fuzz/bpf-object-fuzzer.c:16
	libbpf#5 0x000000000060be11 in testblitz_engine::fuzzer::Fuzzer::run_one ()
	libbpf#6 0x000000000087ad92 in tracing::span::Span::in_scope ()
	libbpf#7 0x00000000006078aa in testblitz_engine::fuzzer::util::walkdir ()
	libbpf#8 0x00000000005f3217 in testblitz_engine::entrypoint::main::{{closure}} ()
	libbpf#9 0x00000000005f2601 in main ()
	(gdb)

scn_data was null at this code(tools/lib/bpf/src/libbpf.c):

	if (rel->r_offset % BPF_INSN_SZ || rel->r_offset >= scn_data->d_size) {

The scn_data is derived from the code above:

	scn = elf_sec_by_idx(obj, sec_idx);
	scn_data = elf_sec_data(obj, scn);

	relo_sec_name = elf_sec_str(obj, shdr->sh_name);
	sec_name = elf_sec_name(obj, scn);
	if (!relo_sec_name || !sec_name)// don't check whether scn_data is NULL
		return -EINVAL;

In certain special scenarios, such as reading a malformed ELF file,
it is possible that scn_data may be a null pointer

Signed-off-by: Mingyi Zhang <[email protected]>
Signed-off-by: Xin Liu <[email protected]>
Signed-off-by: Changye Wu <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
thiagoftsm pushed a commit that referenced this pull request May 20, 2025
As shown in [1], it is possible to corrupt a BPF ELF file such that
arbitrary BPF instructions are loaded by libbpf. This can be done by
setting a symbol (BPF program) section offset to a large (unsigned)
number such that <section start + symbol offset> overflows and points
before the section data in the memory.

Consider the situation below where:
- prog_start = sec_start + symbol_offset    <-- size_t overflow here
- prog_end   = prog_start + prog_size

    prog_start        sec_start        prog_end        sec_end
        |                |                 |              |
        v                v                 v              v
    .....................|################################|............

The report in [1] also provides a corrupted BPF ELF which can be used as
a reproducer:

    $ readelf -S crash
    Section Headers:
      [Nr] Name              Type             Address           Offset
           Size              EntSize          Flags  Link  Info  Align
    ...
      [ 2] uretprobe.mu[...] PROGBITS         0000000000000000  00000040
           0000000000000068  0000000000000000  AX       0     0     8

    $ readelf -s crash
    Symbol table '.symtab' contains 8 entries:
       Num:    Value          Size Type    Bind   Vis      Ndx Name
    ...
         6: ffffffffffffffb8   104 FUNC    GLOBAL DEFAULT    2 handle_tp

Here, the handle_tp prog has section offset ffffffffffffffb8, i.e. will
point before the actual memory where section 2 is allocated.

This is also reported by AddressSanitizer:

    =================================================================
    ==1232==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7c7302fe0000 at pc 0x7fc3046e4b77 bp 0x7ffe64677cd0 sp 0x7ffe64677490
    READ of size 104 at 0x7c7302fe0000 thread T0
        #0 0x7fc3046e4b76 in memcpy (/lib64/libasan.so.8+0xe4b76)
        #1 0x00000040df3e in bpf_object__init_prog /src/libbpf/src/libbpf.c:856
        #2 0x00000040df3e in bpf_object__add_programs /src/libbpf/src/libbpf.c:928
        #3 0x00000040df3e in bpf_object__elf_collect /src/libbpf/src/libbpf.c:3930
        #4 0x00000040df3e in bpf_object_open /src/libbpf/src/libbpf.c:8067
        libbpf#5 0x00000040f176 in bpf_object__open_file /src/libbpf/src/libbpf.c:8090
        libbpf#6 0x000000400c16 in main /poc/poc.c:8
        libbpf#7 0x7fc3043d25b4 in __libc_start_call_main (/lib64/libc.so.6+0x35b4)
        libbpf#8 0x7fc3043d2667 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x3667)
        libbpf#9 0x000000400b34 in _start (/poc/poc+0x400b34)

    0x7c7302fe0000 is located 64 bytes before 104-byte region [0x7c7302fe0040,0x7c7302fe00a8)
    allocated by thread T0 here:
        #0 0x7fc3046e716b in malloc (/lib64/libasan.so.8+0xe716b)
        #1 0x7fc3045ee600 in __libelf_set_rawdata_wrlock (/lib64/libelf.so.1+0xb600)
        #2 0x7fc3045ef018 in __elf_getdata_rdlock (/lib64/libelf.so.1+0xc018)
        #3 0x00000040642f in elf_sec_data /src/libbpf/src/libbpf.c:3740

The problem here is that currently, libbpf only checks that the program
end is within the section bounds. There used to be a check
`while (sec_off < sec_sz)` in bpf_object__add_programs, however, it was
removed by commit 6245947c1b3c ("libbpf: Allow gaps in BPF program
sections to support overriden weak functions").

Add a check for detecting the overflow of `sec_off + prog_sz` to
bpf_object__init_prog to fix this issue.

[1] https://github.com/lmarch2/poc/blob/main/libbpf/libbpf.md

Fixes: 6245947c1b3c ("libbpf: Allow gaps in BPF program sections to support overriden weak functions")
Reported-by: lmarch2 <[email protected]>
Signed-off-by: Viktor Malik <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Reviewed-by: Shung-Hsi Yu <[email protected]>
Link: https://github.com/lmarch2/poc/blob/main/libbpf/libbpf.md
Link: https://lore.kernel.org/bpf/[email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant