Skip to content

Commit 3d0f442

Browse files
committed
interfaces: Add /sys/kernel/tracing to system-trace
Systemd has mounted tracefs under /sys/kernel/tracing since version 245 [0]. Simultaneously, the kernel started at version 4.1 to automount /sys/kernel/debug/tracing on access for backwards compatibiliy. The builtin system-trace currently only allows the old path. Applications exist who will assume /sys/kernel/tracing as the preferred location, only to fall back to /sys/kernel/debug/tracing if the path does not exist. Currently said applications will fail to work in snaps, because they will find /sys/kernel/tracing to exist only to fail later in execution when trying to access contents of files within. 0: systemd/systemd@aaaf42cb44d4 Signed-off-by: Frode Nordahl <[email protected]>
1 parent e141aec commit 3d0f442

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

interfaces/builtin/system_trace.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ const systemTraceConnectedPlugAppArmor = `
4545
/sys/kernel/debug/tracing/ r,
4646
/sys/kernel/debug/tracing/** rw,
4747
48+
/sys/kernel/tracing/ r,
49+
/sys/kernel/tracing/** rw,
50+
4851
# Access to kernel headers required for iovisor/bcc. This is typically
4952
# detected with 'ls -l /lib/modules/$(uname -r)/build/' which is a symlink
5053
# to /usr/src on Ubuntu and so only /usr/src is needed.

interfaces/builtin/system_trace_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func (s *SystemTraceInterfaceSuite) TestUsedSecuritySystems(c *C) {
7979
c.Assert(err, IsNil)
8080
c.Assert(apparmorSpec.SecurityTags(), DeepEquals, []string{"snap.other.app"})
8181
c.Check(apparmorSpec.SnippetForTag("snap.other.app"), testutil.Contains, "/sys/kernel/debug/tracing/ r,")
82+
c.Check(apparmorSpec.SnippetForTag("snap.other.app"), testutil.Contains, "/sys/kernel/tracing/ r,")
8283
}
8384

8485
func (s *SystemTraceInterfaceSuite) TestInterfaces(c *C) {

0 commit comments

Comments
 (0)