<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/security/apparmor/policy.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>2023-01-18T10:30:21Z</updated>
<entry>
<title>apparmor: fix lockdep warning when removing a namespace</title>
<updated>2023-01-18T10:30:21Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2022-09-06T10:39:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c3189c7f2a22e78c705fb51c02af0a93e8d9fc7b'/>
<id>urn:sha1:c3189c7f2a22e78c705fb51c02af0a93e8d9fc7b</id>
<content type='text'>
[ Upstream commit 9c4557efc558a68e4cd973490fd936d6e3414db8 ]

Fix the following lockdep warning

[ 1119.158984] ============================================
[ 1119.158988] WARNING: possible recursive locking detected
[ 1119.158996] 6.0.0-rc1+ #257 Tainted: G            E    N
[ 1119.158999] --------------------------------------------
[ 1119.159001] bash/80100 is trying to acquire lock:
[ 1119.159007] ffff88803e79b4a0 (&amp;ns-&gt;lock/1){+.+.}-{4:4}, at: destroy_ns.part.0+0x43/0x140
[ 1119.159028]
               but task is already holding lock:
[ 1119.159030] ffff8881009764a0 (&amp;ns-&gt;lock/1){+.+.}-{4:4}, at: aa_remove_profiles+0x3f0/0x640
[ 1119.159040]
               other info that might help us debug this:
[ 1119.159042]  Possible unsafe locking scenario:

[ 1119.159043]        CPU0
[ 1119.159045]        ----
[ 1119.159047]   lock(&amp;ns-&gt;lock/1);
[ 1119.159051]   lock(&amp;ns-&gt;lock/1);
[ 1119.159055]
                *** DEADLOCK ***

Which is caused by an incorrect lockdep nesting notation

Fixes: feb3c766a3ab ("apparmor: fix possible recursive lock warning in __aa_create_ns")
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 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 memory leak when deduping profile load</title>
<updated>2018-06-07T08:51:01Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2018-04-14T05:33:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ddae9876a7045a8d08ab372eff232a5da5199b8'/>
<id>urn:sha1:3ddae9876a7045a8d08ab372eff232a5da5199b8</id>
<content type='text'>
AppArmor is leaking the newly loaded profile and its proxy when
the profile is an exact match to the currently loaded version.

In this case the dedup check results in the profile being skipped and
put without dealing with the proxy ref thus not breaking a circular
refcount and causing a leak.

BugLink: http://bugs.launchpad.net/bugs/1750594
Fixes: 5d5182cae401 ("apparmor: move to per loaddata files, instead of replicating in profiles")
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
</content>
</entry>
<entry>
<title>apparmor: fix typo "preconfinement"</title>
<updated>2018-05-03T07:50:46Z</updated>
<author>
<name>Zygmunt Krynicki</name>
</author>
<published>2018-04-12T10:34:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3107e8cb9219cff359b93dde257c030b500e74b7'/>
<id>urn:sha1:3107e8cb9219cff359b93dde257c030b500e74b7</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: add support for mapping secids and using secctxes</title>
<updated>2018-05-02T07:48:55Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2017-08-01T00:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c092921219d227b13cb80dbecd3545ee66ab89b3'/>
<id>urn:sha1:c092921219d227b13cb80dbecd3545ee66ab89b3</id>
<content type='text'>
Use a radix tree to provide a map between the secid and the label,
and along with it a basic ability to provide secctx conversion.

Shared/cached secctx will be added later.

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>
<entry>
<title>apparmor: Add support for attaching profiles via xattr, presence and value</title>
<updated>2018-02-09T19:30:02Z</updated>
<author>
<name>Matthew Garrett</name>
</author>
<published>2018-02-08T20:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8e51f9087f4024d20f70f4d9831e1f45d8088331'/>
<id>urn:sha1:8e51f9087f4024d20f70f4d9831e1f45d8088331</id>
<content type='text'>
Make it possible to tie Apparmor profiles to the presence of one or more
extended attributes, and optionally their values. An example usecase for
this is to automatically transition to a more privileged Apparmor profile
if an executable has a valid IMA signature, which can then be appraised
by the IMA subsystem.

Signed-off-by: Matthew Garrett &lt;mjg59@google.com&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
</content>
</entry>
<entry>
<title>apparmor: move context.h to cred.h</title>
<updated>2018-02-09T19:30:01Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2017-10-11T08:04:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d8889d49e414b371eb235c08c3a759ab3e0cfa51'/>
<id>urn:sha1:d8889d49e414b371eb235c08c3a759ab3e0cfa51</id>
<content type='text'>
Now that file contexts have been moved into file, and task context
fns() and data have been split from the context, only the cred context
remains in context.h so rename to cred.h to better reflect what it
deals with.

Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
</content>
</entry>
<entry>
<title>apparmor: cleanup fixup description of aa_replace_profiles</title>
<updated>2018-02-09T19:30:01Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2017-01-27T12:36:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e1a03f627b5254fa1ee83bd0761490f31ea2e382'/>
<id>urn:sha1:e1a03f627b5254fa1ee83bd0761490f31ea2e382</id>
<content type='text'>
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
</content>
</entry>
<entry>
<title>apparmor: rename task_ctx to the more accurate cred_ctx</title>
<updated>2018-02-09T19:30:01Z</updated>
<author>
<name>John Johansen</name>
</author>
<published>2017-01-19T22:08:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d2f8ba3e3b76e34f84ae1de456934713e9e59af'/>
<id>urn:sha1:4d2f8ba3e3b76e34f84ae1de456934713e9e59af</id>
<content type='text'>
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
</content>
</entry>
</feed>
