<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/security/apparmor/domain.c, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-08-25T09:15:36Z</updated>
<entry>
<title>apparmor: fix overlapping attachment computation</title>
<updated>2022-08-25T09:15:36Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2022-03-26T08:58:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7af35951404b134731926cf80a218db7b1795ae9'/>
<id>urn:sha1:7af35951404b134731926cf80a218db7b1795ae9</id>
<content type='text'>
commit 2504db207146543736e877241f3b3de005cbe056 upstream.

When finding the profile via patterned attachments, the longest left
match is being set to the static compile time value and not using the
runtime computed value.

Fix this by setting the candidate value to the greater of the
precomputed value or runtime computed value.

Fixes: 21f606610502 ("apparmor: improve overlapping domain attachment resolution")
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>apparmor: fix nnp subset test for unconfined</title>
<updated>2020-06-25T13:32:52Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2019-09-25T15:02:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3cc2aec68e7db2df9f053d4548c57e3bf1e3ebf9'/>
<id>urn:sha1:3cc2aec68e7db2df9f053d4548c57e3bf1e3ebf9</id>
<content type='text'>
[ Upstream commit 3ed4aaa94fc07db3cd0c91be95e3e1b9782a2710 ]

The subset test is not taking into account the unconfined exception
which will cause profile transitions in the stacked confinement
case to fail when no_new_privs is applied.

This fixes a regression introduced in the fix for
https://bugs.launchpad.net/bugs/1839037

BugLink: https://bugs.launchpad.net/bugs/1844186
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>apparmor: fix potential label refcnt leak in aa_change_profile</title>
<updated>2020-05-27T15:37:37Z</updated>
<author>
<name>Xiyu Yang</name>
</author>
<published>2020-04-05T05:11:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dd73adb161fec02d9303ce98e0e5bf844c5d791e'/>
<id>urn:sha1:dd73adb161fec02d9303ce98e0e5bf844c5d791e</id>
<content type='text'>
commit a0b845ffa0d91855532b50fc040aeb2d8338dca4 upstream.

aa_change_profile() invokes aa_get_current_label(), which returns
a reference of the current task's label.

According to the comment of aa_get_current_label(), the returned
reference must be put with aa_put_label().
However, when the original object pointed by "label" becomes
unreachable because aa_change_profile() returns or a new object
is assigned to "label", reference count increased by
aa_get_current_label() is not decreased, causing a refcnt leak.

Fix this by calling aa_put_label() before aa_change_profile() return
and dropping unnecessary aa_get_current_label().

Fixes: 9fcf78cca198 ("apparmor: update domain transitions that are subsets of confinement at nnp")
Signed-off-by: Xiyu Yang &lt;xiyuyang19@fudan.edu.cn&gt;
Signed-off-by: Xin Tan &lt;tanxin.ctf@gmail.com&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>apparmor: fix aa_xattrs_match() may sleep while holding a RCU lock</title>
<updated>2020-01-09T09:19:02Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2020-01-02T13:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f3248d6dce684a98641bd69e14a5efc8dc4b4593'/>
<id>urn:sha1:f3248d6dce684a98641bd69e14a5efc8dc4b4593</id>
<content type='text'>
commit 8c62ed27a12c00e3db1c9f04bc0f272bdbb06734 upstream.

aa_xattrs_match() is unfortunately calling vfs_getxattr_alloc() from a
context protected by an rcu_read_lock. This can not be done as
vfs_getxattr_alloc() may sleep regardles of the gfp_t value being
passed to it.

Fix this by breaking the rcu_read_lock on the policy search when the
xattr match feature is requested and restarting the search if a policy
changes occur.

Fixes: 8e51f9087f40 ("apparmor: Add support for attaching profiles via xattr, presence and value")
Reported-by: Jia-Ju Bai &lt;baijiaju1990@gmail.com&gt;
Reported-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>apparmor: Fix aa_label_build() error handling for failed merges</title>
<updated>2019-03-13T21:02:32Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2019-01-24T21:53:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7807b62276efdb49d9ade2af39fcc409c568f7b'/>
<id>urn:sha1:d7807b62276efdb49d9ade2af39fcc409c568f7b</id>
<content type='text'>
[ Upstream commit d6d478aee003e19ef90321176552a8ad2929a47f ]

aa_label_merge() can return NULL for memory allocations failures
make sure to handle and set the correct error in this case.

Reported-by: Peng Hao &lt;peng.hao2@zte.com.cn&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>apparmor: Fix failure to audit context info in build_change_hat</title>
<updated>2018-07-20T10:25:25Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2018-07-20T10:25:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24b87a16fee0ebd49b66e8523186ace7ea09ad12'/>
<id>urn:sha1:24b87a16fee0ebd49b66e8523186ace7ea09ad12</id>
<content type='text'>
Cleans up clang warning:
warning: variable 'info' set but not used [-Wunused-but-set-variable]

Fixes: 89dbf1962aa63 ("apparmor: move change_hat mediation to using labels")
Reported-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
</content>
</entry>
<entry>
<title>apparmor: fix typo "loosen"</title>
<updated>2018-05-03T07:47:56Z</updated>
<author>
<name>Zygmunt Krynicki</name>
</author>
<published>2018-04-12T10:34:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b2c2086c3984d96045e758d984d859caae6f96ca'/>
<id>urn:sha1:b2c2086c3984d96045e758d984d859caae6f96ca</id>
<content type='text'>
Signed-off-by: Zygmunt Krynicki &lt;zygmunt.krynicki@canonical.com&gt;
Acked-by: Christian Boltz &lt;apparmor@cboltz.de&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
</content>
</entry>
<entry>
<title>apparmor: fix error returns checks by making size a ssize_t</title>
<updated>2018-03-24T00:25:25Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2018-03-23T23:34:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a61ecd329cfa951b7d36c13e9e2a07e7761c0e89'/>
<id>urn:sha1:a61ecd329cfa951b7d36c13e9e2a07e7761c0e89</id>
<content type='text'>
Currently variable size is a unsigned size_t, hence comparisons to
see if it is less than zero (for error checking) will always be
false.  Fix this by making size a ssize_t

Detected by CoverityScan, CID#1466080 ("Unsigned compared against 0")

Fixes: 8e51f9087f40 ("apparmor: Add support for attaching profiles via xattr, presence and value")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
</content>
</entry>
<entry>
<title>apparmor: improve overlapping domain attachment resolution</title>
<updated>2018-02-09T19:30:02Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2017-11-19T03:43:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=21f606610502ef56f9180b1529fc7e02957564c8'/>
<id>urn:sha1:21f606610502ef56f9180b1529fc7e02957564c8</id>
<content type='text'>
Overlapping domain attachments using the current longest left exact
match fail in some simple cases, and with the fix to ensure consistent
behavior by failing unresolvable attachments it becomes important to
do a better job.

eg. under the current match the following are unresolvable where
the alternation is clearly a better match under the most specific
left match rule.
  /**
  /{bin/,}usr/

Use a counting match that detects when a loop in the state machine is
enter, and return the match count to provide a better specific left
match resolution.

Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
</content>
</entry>
<entry>
<title>apparmor: convert attaching profiles via xattrs to use dfa matching</title>
<updated>2018-02-09T19:30:02Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2017-12-12T23:28:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=73f488cd903938e78979d50e081a0314ad142351'/>
<id>urn:sha1:73f488cd903938e78979d50e081a0314ad142351</id>
<content type='text'>
This converts profile attachment based on xattrs to a fixed extended
conditional using dfa matching.

This has a couple of advantages
- pattern matching can be used for the xattr match

- xattrs can be optional for an attachment or marked as required

- the xattr attachment conditional will be able to be combined with
  other extended conditionals when the flexible extended conditional
  work lands.

The xattr fixed extended conditional is appended to the xmatch
conditional. If an xattr attachment is specified the profile xmatch
will be generated regardless of whether there is a pattern match on
the executable name.

Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Acked-by: Seth Arnold &lt;seth.arnold@canonical.com&gt;
</content>
</entry>
</feed>
