<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/audit.c, branch v3.18.62</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.18.62</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.18.62'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-01-08T18:30:27Z</updated>
<entry>
<title>audit: use supplied gfp_mask from audit_buffer in kauditd_send_multicast_skb</title>
<updated>2015-01-08T18:30:27Z</updated>
<author>
<name>Richard Guy Briggs</name>
<email>rgb@redhat.com</email>
</author>
<published>2014-12-19T04:09:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1110f3504d4697ef459fe9a4a1b1704649e2a444'/>
<id>urn:sha1:1110f3504d4697ef459fe9a4a1b1704649e2a444</id>
<content type='text'>
commit 54dc77d974a50147d6639dac6f59cb2c29207161 upstream.

Eric Paris explains: Since kauditd_send_multicast_skb() gets called in
audit_log_end(), which can come from any context (aka even a sleeping context)
GFP_KERNEL can't be used.  Since the audit_buffer knows what context it should
use, pass that down and use that.

See: https://lkml.org/lkml/2014/12/16/542

BUG: sleeping function called from invalid context at mm/slab.c:2849
in_atomic(): 1, irqs_disabled(): 0, pid: 885, name: sulogin
2 locks held by sulogin/885:
  #0:  (&amp;sig-&gt;cred_guard_mutex){+.+.+.}, at: [&lt;ffffffff91152e30&gt;] prepare_bprm_creds+0x28/0x8b
  #1:  (tty_files_lock){+.+.+.}, at: [&lt;ffffffff9123e787&gt;] selinux_bprm_committing_creds+0x55/0x22b
CPU: 1 PID: 885 Comm: sulogin Not tainted 3.18.0-next-20141216 #30
Hardware name: Dell Inc. Latitude E6530/07Y85M, BIOS A15 06/20/2014
  ffff880223744f10 ffff88022410f9b8 ffffffff916ba529 0000000000000375
  ffff880223744f10 ffff88022410f9e8 ffffffff91063185 0000000000000006
  0000000000000000 0000000000000000 0000000000000000 ffff88022410fa38
Call Trace:
  [&lt;ffffffff916ba529&gt;] dump_stack+0x50/0xa8
  [&lt;ffffffff91063185&gt;] ___might_sleep+0x1b6/0x1be
  [&lt;ffffffff910632a6&gt;] __might_sleep+0x119/0x128
  [&lt;ffffffff91140720&gt;] cache_alloc_debugcheck_before.isra.45+0x1d/0x1f
  [&lt;ffffffff91141d81&gt;] kmem_cache_alloc+0x43/0x1c9
  [&lt;ffffffff914e148d&gt;] __alloc_skb+0x42/0x1a3
  [&lt;ffffffff914e2b62&gt;] skb_copy+0x3e/0xa3
  [&lt;ffffffff910c263e&gt;] audit_log_end+0x83/0x100
  [&lt;ffffffff9123b8d3&gt;] ? avc_audit_pre_callback+0x103/0x103
  [&lt;ffffffff91252a73&gt;] common_lsm_audit+0x441/0x450
  [&lt;ffffffff9123c163&gt;] slow_avc_audit+0x63/0x67
  [&lt;ffffffff9123c42c&gt;] avc_has_perm+0xca/0xe3
  [&lt;ffffffff9123dc2d&gt;] inode_has_perm+0x5a/0x65
  [&lt;ffffffff9123e7ca&gt;] selinux_bprm_committing_creds+0x98/0x22b
  [&lt;ffffffff91239e64&gt;] security_bprm_committing_creds+0xe/0x10
  [&lt;ffffffff911515e6&gt;] install_exec_creds+0xe/0x79
  [&lt;ffffffff911974cf&gt;] load_elf_binary+0xe36/0x10d7
  [&lt;ffffffff9115198e&gt;] search_binary_handler+0x81/0x18c
  [&lt;ffffffff91153376&gt;] do_execveat_common.isra.31+0x4e3/0x7b7
  [&lt;ffffffff91153669&gt;] do_execve+0x1f/0x21
  [&lt;ffffffff91153967&gt;] SyS_execve+0x25/0x29
  [&lt;ffffffff916c61a9&gt;] stub_execve+0x69/0xa0

Reported-by: Valdis Kletnieks &lt;Valdis.Kletnieks@vt.edu&gt;
Signed-off-by: Richard Guy Briggs &lt;rgb@redhat.com&gt;
Tested-by: Valdis Kletnieks &lt;Valdis.Kletnieks@vt.edu&gt;
Signed-off-by: Paul Moore &lt;pmoore@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge branch 'stable-3.18' of git://git.infradead.org/users/pcmoore/audit</title>
<updated>2014-11-13T17:36:39Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-11-13T17:36:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=911883759fed56c32b97d73154039b5f8ffcba93'/>
<id>urn:sha1:911883759fed56c32b97d73154039b5f8ffcba93</id>
<content type='text'>
Pull audit fixes from Paul Moore:
 "After he sent the initial audit pull request for 3.18, Eric asked me
  to take over the management of the audit tree, hence this pull request
  to fix a couple of problems with audit.

  As you can see below, the changes are minimal: adding some whitespace
  to a string so userspace parses it correctly, and fixing a problem
  with audit's usage of fsnotify that was causing audit watch rules to
  be lost.  Neither of these patches were very controversial on the
  mailing lists and they fix real problems, getting them into 3.18 would
  be a good thing"

* 'stable-3.18' of git://git.infradead.org/users/pcmoore/audit:
  audit: keep inode pinned
  audit: AUDIT_FEATURE_CHANGE message format missing delimiting space
</content>
</entry>
<entry>
<title>audit: AUDIT_FEATURE_CHANGE message format missing delimiting space</title>
<updated>2014-10-30T23:42:02Z</updated>
<author>
<name>Richard Guy Briggs</name>
<email>rgb@redhat.com</email>
</author>
<published>2014-10-30T15:22:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=897f1acbb6702ddaa953e8d8436eee3b12016c7e'/>
<id>urn:sha1:897f1acbb6702ddaa953e8d8436eee3b12016c7e</id>
<content type='text'>
Add a space between subj= and feature= fields to make them parsable.

Signed-off-by: Richard Guy Briggs &lt;rgb@redhat.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Paul Moore &lt;pmoore@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge git://git.infradead.org/users/eparis/audit</title>
<updated>2014-10-19T23:25:56Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-10-19T23:25:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ab074ade9c33b3585da86d62e87bcb3e897a3f54'/>
<id>urn:sha1:ab074ade9c33b3585da86d62e87bcb3e897a3f54</id>
<content type='text'>
Pull audit updates from Eric Paris:
 "So this change across a whole bunch of arches really solves one basic
  problem.  We want to audit when seccomp is killing a process.  seccomp
  hooks in before the audit syscall entry code.  audit_syscall_entry
  took as an argument the arch of the given syscall.  Since the arch is
  part of what makes a syscall number meaningful it's an important part
  of the record, but it isn't available when seccomp shoots the
  syscall...

  For most arch's we have a better way to get the arch (syscall_get_arch)
  So the solution was two fold: Implement syscall_get_arch() everywhere
  there is audit which didn't have it.  Use syscall_get_arch() in the
  seccomp audit code.  Having syscall_get_arch() everywhere meant it was
  a useless flag on the stack and we could get rid of it for the typical
  syscall entry.

  The other changes inside the audit system aren't grand, fixed some
  records that had invalid spaces.  Better locking around the task comm
  field.  Removing some dead functions and structs.  Make some things
  static.  Really minor stuff"

* git://git.infradead.org/users/eparis/audit: (31 commits)
  audit: rename audit_log_remove_rule to disambiguate for trees
  audit: cull redundancy in audit_rule_change
  audit: WARN if audit_rule_change called illegally
  audit: put rule existence check in canonical order
  next: openrisc: Fix build
  audit: get comm using lock to avoid race in string printing
  audit: remove open_arg() function that is never used
  audit: correct AUDIT_GET_FEATURE return message type
  audit: set nlmsg_len for multicast messages.
  audit: use union for audit_field values since they are mutually exclusive
  audit: invalid op= values for rules
  audit: use atomic_t to simplify audit_serial()
  kernel/audit.c: use ARRAY_SIZE instead of sizeof/sizeof[0]
  audit: reduce scope of audit_log_fcaps
  audit: reduce scope of audit_net_id
  audit: arm64: Remove the audit arch argument to audit_syscall_entry
  arm64: audit: Add audit hook in syscall_trace_enter/exit()
  audit: x86: drop arch from __audit_syscall_entry() interface
  sparc: implement is_32bit_task
  sparc: properly conditionalize use of TIF_32BIT
  ...
</content>
</entry>
<entry>
<title>audit: get comm using lock to avoid race in string printing</title>
<updated>2014-09-23T20:37:56Z</updated>
<author>
<name>Richard Guy Briggs</name>
<email>rgb@redhat.com</email>
</author>
<published>2014-03-15T22:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9eab339b197a6903043d272295dcb716ff739b21'/>
<id>urn:sha1:9eab339b197a6903043d272295dcb716ff739b21</id>
<content type='text'>
When task-&gt;comm is passed directly to audit_log_untrustedstring() without
getting a copy or using the task_lock, there is a race that could happen that
would output a NULL (\0) in the output string that would effectively truncate
the rest of the report text after the comm= field in the audit, losing fields.

Use get_task_comm() to get a copy while acquiring the task_lock to prevent
this and to prevent the result from being a mixture of old and new values of
comm.

Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Richard Guy Briggs &lt;rgb@redhat.com&gt;
</content>
</entry>
<entry>
<title>audit: correct AUDIT_GET_FEATURE return message type</title>
<updated>2014-09-23T20:37:55Z</updated>
<author>
<name>Richard Guy Briggs</name>
<email>rgb@redhat.com</email>
</author>
<published>2014-08-25T00:37:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9ef91514774a140e468f99d73d7593521e6d25dc'/>
<id>urn:sha1:9ef91514774a140e468f99d73d7593521e6d25dc</id>
<content type='text'>
When an AUDIT_GET_FEATURE message is sent from userspace to the kernel, it
should reply with a message tagged as an AUDIT_GET_FEATURE type with a struct
audit_feature.  The current reply is a message tagged as an AUDIT_GET
type with a struct audit_feature.

This appears to have been a cut-and-paste-eo in commit b0fed40.

Reported-by: Steve Grubb &lt;sgrubb@redhat.com&gt;
Signed-off-by: Richard Guy Briggs &lt;rgb@redhat.com&gt;
</content>
</entry>
<entry>
<title>audit: set nlmsg_len for multicast messages.</title>
<updated>2014-09-23T20:37:54Z</updated>
<author>
<name>Richard Guy Briggs</name>
<email>rgb@redhat.com</email>
</author>
<published>2014-08-21T17:40:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=54e05eddbe507d54f1df18c2680d4f614af9e133'/>
<id>urn:sha1:54e05eddbe507d54f1df18c2680d4f614af9e133</id>
<content type='text'>
Report:
	Looking at your example code in
	http://people.redhat.com/rbriggs/audit-multicast-listen/audit-multicast-listen.c,
	it seems that nlmsg_len field in the received messages is supposed to
	contain the length of the header + payload, but it is always set to the
	size of the header only, i.e. 16. The example program works, because
	the printf format specifies the minimum width, not "precision", so it
	simply prints out the payload until the first zero byte. This isn't too
	much of a problem, but precludes the use of recvmmsg, iiuc?

	(gdb) p *(struct nlmsghdr*)nlh
	$14 = {nlmsg_len = 16, nlmsg_type = 1100, nlmsg_flags = 0, nlmsg_seq = 0, nlmsg_pid = 9910}

The only time nlmsg_len would have been updated was at audit_buffer_alloc()
inside audit_log_start() and never updated after.  It should arguably be done
in audit_log_vformat(), but would be more efficient in audit_log_end().

Reported-by: Zbigniew Jędrzejewski-Szmek &lt;zbyszek@in.waw.pl&gt;
Signed-off-by: Richard Guy Briggs &lt;rgb@redhat.com&gt;
</content>
</entry>
<entry>
<title>audit: use atomic_t to simplify audit_serial()</title>
<updated>2014-09-23T20:37:52Z</updated>
<author>
<name>Richard Guy Briggs</name>
<email>rgb@redhat.com</email>
</author>
<published>2014-06-13T22:22:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=01478d7d60f654419ba863856cad0446bcb73a59'/>
<id>urn:sha1:01478d7d60f654419ba863856cad0446bcb73a59</id>
<content type='text'>
Since there is already a primitive to do this operation in the atomic_t, use it
to simplify audit_serial().

Signed-off-by: Richard Guy Briggs &lt;rgb@redhat.com&gt;
</content>
</entry>
<entry>
<title>kernel/audit.c: use ARRAY_SIZE instead of sizeof/sizeof[0]</title>
<updated>2014-09-23T20:37:51Z</updated>
<author>
<name>Fabian Frederick</name>
<email>fabf@skynet.be</email>
</author>
<published>2014-06-03T20:05:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6eed9b261334932c742458edd64b7b9fd0b981a9'/>
<id>urn:sha1:6eed9b261334932c742458edd64b7b9fd0b981a9</id>
<content type='text'>
Use kernel.h definition.

Cc: Eric Paris &lt;eparis@redhat.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: Richard Guy Briggs &lt;rgb@redhat.com&gt;
</content>
</entry>
<entry>
<title>audit: reduce scope of audit_log_fcaps</title>
<updated>2014-09-23T20:37:51Z</updated>
<author>
<name>Richard Guy Briggs</name>
<email>rgb@redhat.com</email>
</author>
<published>2014-05-26T15:02:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=691e6d59d2b6cdb4595e5f626503a1c9e98b8baf'/>
<id>urn:sha1:691e6d59d2b6cdb4595e5f626503a1c9e98b8baf</id>
<content type='text'>
audit_log_fcaps() isn't used outside kernel/audit.c.  Reduce its scope.

Signed-off-by: Richard Guy Briggs &lt;rgb@redhat.com&gt;
</content>
</entry>
</feed>
