Skip to content

fix(driver): export euid, egid and loginuid from init user ns#3000

Merged
poiana merged 1 commit into
masterfrom
ekoops/fix-kmod-uids
May 19, 2026
Merged

fix(driver): export euid, egid and loginuid from init user ns#3000
poiana merged 1 commit into
masterfrom
ekoops/fix-kmod-uids

Conversation

@ekoops

@ekoops ekoops commented May 19, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind test

/kind feature

/kind sync

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area automation

/area drivers

/area driver-kmod

/area driver-modern-bpf

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

The kernel module currently exports euids, egids and loginuids as seen from the task's user namespace: this is inconsistent with the (expected) behaviour implemented by the modern eBPF probe, that exports the ones seen from the init user namespace. This PR makes the kernel module consistent by fixing its code to export the ones seen from the init user namespace.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

/milestone next-driver

Does this PR introduce a user-facing change?:

NONE

The kernel module currently exports euids, egids and loginuids as seen
from the task's user namespace: this is inconsistent with the
(expected) behaviour implemented by the modern eBPF probe, that
exports the ones seen from the init user namespace. Make the kernel
module consistent by fixing its code to export the ones seen from the
init user namespace.

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
@poiana poiana added this to the next-driver milestone May 19, 2026
@poiana poiana added the area/drivers Anything that cannot be associated to any other `area/driver-` label label May 19, 2026
@poiana poiana requested review from hbrueckner and terror96 May 19, 2026 14:18
@poiana poiana added the lgtm label May 19, 2026
@irozzo-1A irozzo-1A self-requested a review May 19, 2026 14:22

@irozzo-1A irozzo-1A left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@github-project-automation github-project-automation Bot moved this from Todo to In progress in Falco Roadmap May 19, 2026
@poiana

poiana commented May 19, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ekoops, gnosek, irozzo-1A

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ekoops

ekoops commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

/hold
Let's see if the kernel testing CI complains

@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.75%. Comparing base (9755c62) to head (5d218c7).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3000   +/-   ##
=======================================
  Coverage   75.75%   75.75%           
=======================================
  Files         299      299           
  Lines       33131    33131           
  Branches     5159     5159           
=======================================
  Hits        25098    25098           
  Misses       8033     8033           
Flag Coverage Δ
libsinsp 75.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown

Perf diff from master - unit tests

    10.31%     +1.30%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_lock_nothrow()
    21.20%     -1.22%  [.] std::__shared_ptr<sinsp_threadinfo, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__weak_ptr<sinsp_threadinfo, (__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t)
     4.26%     +0.68%  [.] thread_group_info::get_first_thread() const
    10.38%     -0.61%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()
     9.46%     -0.59%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::_M_get_use_count() const
    14.65%     +0.56%  [.] sinsp_threadinfo::get_main_thread()
    12.75%     -0.29%  [.] sinsp_thread_manager::create_thread_dependencies(std::shared_ptr<sinsp_threadinfo> const&)
     3.95%     -0.24%  [.] sinsp_threadinfo::get_fd_table()
     0.08%     +0.11%  [.] sinsp_filter_check::parse_field_name(std::basic_string_view<char, std::char_traits<char> >, bool, bool)
     0.04%     +0.09%  [.] sinsp_with_test_input_plugin_tables_Test::TestBody()

Heap diff from master - unit tests

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                                               Time             CPU      Time Old      Time New       CPU Old       CPU New
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                                                  -0.0543         -0.0544           281           266           281           266
BM_sinsp_split_median                                                                -0.0520         -0.0523           281           266           281           266
BM_sinsp_split_stddev                                                                -0.6702         -0.6663             4             1             4             1
BM_sinsp_split_cv                                                                    -0.6513         -0.6471             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                                        -0.0083         -0.0083            82            82            82            82
BM_sinsp_concatenate_paths_relative_path_median                                      -0.0155         -0.0152            83            81            83            81
BM_sinsp_concatenate_paths_relative_path_stddev                                      -0.4707         -0.4769             1             1             1             1
BM_sinsp_concatenate_paths_relative_path_cv                                          -0.4662         -0.4725             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                                           +0.0001         +0.0002            44            44            44            44
BM_sinsp_concatenate_paths_empty_path_median                                         +0.0002         +0.0002            44            44            44            44
BM_sinsp_concatenate_paths_empty_path_stddev                                         -0.2887         -0.3065             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                                             -0.2888         -0.3066             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                                        -0.0026         -0.0026            82            82            82            82
BM_sinsp_concatenate_paths_absolute_path_median                                      -0.0060         -0.0059            83            82            83            82
BM_sinsp_concatenate_paths_absolute_path_stddev                                      -0.0090         +0.0003             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_cv                                          -0.0064         +0.0029             0             0             0             0
BM_sinsp_sanitize_string_fast_path_ascii_short_mean                                  +0.0016         +0.0016            19            19            19            19
BM_sinsp_sanitize_string_fast_path_ascii_short_median                                +0.0007         +0.0007            19            19            19            19
BM_sinsp_sanitize_string_fast_path_ascii_short_stddev                                -0.8871         -0.9040             0             0             0             0
BM_sinsp_sanitize_string_fast_path_ascii_short_cv                                    -0.8873         -0.9041             0             0             0             0
BM_sinsp_sanitize_string_fast_path_ascii_long_mean                                   +0.0011         +0.0011           165           165           165           165
BM_sinsp_sanitize_string_fast_path_ascii_long_median                                 -0.0002         -0.0003           165           165           165           165
BM_sinsp_sanitize_string_fast_path_ascii_long_stddev                                 -0.7489         -0.7899             0             0             0             0
BM_sinsp_sanitize_string_fast_path_ascii_long_cv                                     -0.7491         -0.7901             0             0             0             0
BM_sinsp_sanitize_string_fast_path_multibyte_short_mean                              +0.1238         +0.1239            14            15            14            15
BM_sinsp_sanitize_string_fast_path_multibyte_short_median                            +0.1304         +0.1305            14            15            14            15
BM_sinsp_sanitize_string_fast_path_multibyte_short_stddev                           +86.0973       +141.7310             0             1             0             1
BM_sinsp_sanitize_string_fast_path_multibyte_short_cv                               +76.5032       +125.9943             0             0             0             0
BM_sinsp_sanitize_string_fast_path_multibyte_long_mean                               +0.0210         +0.0210          4867          4969          4865          4967
BM_sinsp_sanitize_string_fast_path_multibyte_long_median                             +0.0147         +0.0147          4867          4938          4865          4936
BM_sinsp_sanitize_string_fast_path_multibyte_long_stddev                            +58.5576        +83.4149             2            97             1            97
BM_sinsp_sanitize_string_fast_path_multibyte_long_cv                                +57.3347        +81.6826             0             0             0             0
BM_sinsp_sanitize_string_fast_path_mixed_long_mean                                   +0.1558         +0.1558          2025          2341          2025          2340
BM_sinsp_sanitize_string_fast_path_mixed_long_median                                 +0.1567         +0.1568          2026          2343          2025          2342
BM_sinsp_sanitize_string_fast_path_mixed_long_stddev                                 +0.4425         +0.4292             3             5             3             5
BM_sinsp_sanitize_string_fast_path_mixed_long_cv                                     +0.2480         +0.2365             0             0             0             0
BM_sinsp_sanitize_string_slow_path_c1_controls_long_alloc_mean                       -0.1263         -0.1263          7029          6142          7027          6140
BM_sinsp_sanitize_string_slow_path_c1_controls_long_alloc_median                     -0.1141         -0.1141          6931          6141          6929          6139
BM_sinsp_sanitize_string_slow_path_c1_controls_long_alloc_stddev                     -0.9708         -0.9727           129             4           129             4
BM_sinsp_sanitize_string_slow_path_c1_controls_long_alloc_cv                         -0.9666         -0.9687             0             0             0             0
BM_sinsp_sanitize_string_slow_path_c1_controls_long_noalloc_mean                     -0.1488         -0.1488          7074          6022          7072          6020
BM_sinsp_sanitize_string_slow_path_c1_controls_long_noalloc_median                   -0.1487         -0.1488          7074          6021          7071          6019
BM_sinsp_sanitize_string_slow_path_c1_controls_long_noalloc_stddev                   -0.2947         -0.1852             2             2             2             1
BM_sinsp_sanitize_string_slow_path_c1_controls_long_noalloc_cv                       -0.1714         -0.0427             0             0             0             0
BM_sinsp_sanitize_string_slow_path_sparse_invalid_long_alloc_mean                    -0.0429         -0.0428           339           324           339           324
BM_sinsp_sanitize_string_slow_path_sparse_invalid_long_alloc_median                  -0.0433         -0.0432           338           323           338           323
BM_sinsp_sanitize_string_slow_path_sparse_invalid_long_alloc_stddev                  -0.1809         -0.1860             3             3             3             3
BM_sinsp_sanitize_string_slow_path_sparse_invalid_long_alloc_cv                      -0.1442         -0.1495             0             0             0             0
BM_sinsp_sanitize_string_slow_path_sparse_invalid_long_noalloc_mean                  -0.0664         -0.0663           235           219           235           219
BM_sinsp_sanitize_string_slow_path_sparse_invalid_long_noalloc_median                -0.0686         -0.0687           235           219           235           219
BM_sinsp_sanitize_string_slow_path_sparse_invalid_long_noalloc_stddev                -0.2683         -0.2742             1             1             1             1
BM_sinsp_sanitize_string_slow_path_sparse_invalid_long_noalloc_cv                    -0.2163         -0.2227             0             0             0             0
BM_sinsp_sanitize_string_slow_path_all_invalid_long_alloc_mean                       -0.1175         -0.1177         13030         11498         13025         11493
BM_sinsp_sanitize_string_slow_path_all_invalid_long_alloc_median                     -0.1374         -0.1376         13064         11269         13060         11263
BM_sinsp_sanitize_string_slow_path_all_invalid_long_alloc_stddev                     +2.0239         +2.0274           157           474           157           475
BM_sinsp_sanitize_string_slow_path_all_invalid_long_alloc_cv                         +2.4265         +2.4311             0             0             0             0
BM_sinsp_sanitize_string_slow_path_all_invalid_long_noalloc_mean                     +0.0097         +0.0095         12120         12237         12116         12231
BM_sinsp_sanitize_string_slow_path_all_invalid_long_noalloc_median                   +0.0167         +0.0166         12035         12236         12031         12230
BM_sinsp_sanitize_string_slow_path_all_invalid_long_noalloc_stddev                   -0.9700         -0.9761           219             7           220             5
BM_sinsp_sanitize_string_slow_path_all_invalid_long_noalloc_cv                       -0.9703         -0.9763             0             0             0             0

@github-actions

Copy link
Copy Markdown

X64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-5.10 🟢 🟢 🟢 🟢
amazonlinux2-5.15 🟢 🟢 🟢 🟢
amazonlinux2-5.4 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢
amazonlinux2023-6.1 🟢 🟢 🟢 🟢
archlinux-6.0 🟢 🟢 🟢 🟢
archlinux-6.7 🟢 🟢 🟢 🟢
centos-3.10 🟢 🟢 🟢 🟡
centos-4.18 🟢 🟢 🟢 🟢
centos-5.14 🟢 🟢 🟢 🟢
fedora-5.17 🟢 🟢 🟢 🟢
fedora-5.8 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢
oraclelinux-3.10 🟢 🟢 🟢 🟡
oraclelinux-4.14 🟢 🟢 🟢 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢
oraclelinux-5.4 🟢 🟢 🟢 🟡
ubuntu-5.8 🟢 🟢 🟢 🟡
ubuntu-6.5 🟢 🟢 🟢 🟢

ARM64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-5.4 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢
oraclelinux-4.14 🟢 🟢 🟢 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢
ubuntu-6.5 🟢 🟢 🟢 🟢

@ekoops

ekoops commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

CI is green.
/hold cancel

@poiana poiana merged commit 97b0868 into master May 19, 2026
57 checks passed
@poiana poiana deleted the ekoops/fix-kmod-uids branch May 19, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved area/driver-kmod area/drivers Anything that cannot be associated to any other `area/driver-` label dco-signoff: yes kind/bug Something isn't working lgtm release-note-none size/S

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants