Commit cc9d191
committed
refactor: remove drop_privileges() and capability management from main.c
dvledtx delegates all VFIO and hugepage operations to mtl_init()
inside the MTL library. Whether those operations require elevated
privileges is purely a system configuration concern, not an
application concern.
With the recommended pre-configuration on the host:
- udev rule granting the service user ownership of /dev/vfio/<group>
- LimitMEMLOCK=infinity in the systemd unit (or /etc/security/limits.conf)
mtl_init() succeeds without any elevated capabilities. The application
should run as a plain unprivileged service user with no capability
management needed.
Removes:
- drop_privileges() function and its E-1 comment block
- #include <linux/capability.h>
- #include <sys/prctl.h>
- #include <sys/syscall.h>
- #include <sys/mman.h> (unused after removal)1 parent 7a366c2 commit cc9d191
1 file changed
Lines changed: 0 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
| |||
52 | 48 | | |
53 | 49 | | |
54 | 50 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | 51 | | |
94 | 52 | | |
95 | 53 | | |
| |||
333 | 291 | | |
334 | 292 | | |
335 | 293 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | 294 | | |
341 | 295 | | |
342 | 296 | | |
| |||
0 commit comments