]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'selinux' ("struct common_audit_data" sanitizer)
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Apr 2012 17:11:24 +0000 (10:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Apr 2012 17:11:24 +0000 (10:11 -0700)
commit7066da84dc4d8e0cac449fc707d958b105dc6774
tree7a2f0297d35c962040bdd90981376c4b41c40c0f
parent78f0be23589fb003442bb4112ede6c4c93ecbfa0
parente6161ad5696534da7a2e45a8c0cc7d3a4e0d3d93
Merge branch 'selinux' ("struct common_audit_data" sanitizer)

Merge common_audit_data cleanup patches from Eric Paris.

This is really too late, but it's a long-overdue cleanup of the costly
wrapper functions for the security layer.

The "struct common_audit_data" is used all over in critical paths,
allocated and initialized on the stack.  And used to be much too large,
causing not only unnecessarily big stack frames but the clearing of the
(mostly useless) data was also very visible in profiles.

As a particular example, in one microbenchmark for just doing "stat()"
over files a lot, selinux_inode_permission() used 7% of the CPU time.
That's despite the fact that it doesn't actually *do* anything: it is
just a helper wrapper function in the selinux security layer.

This patch-series shrinks "struct common_audit_data" sufficiently that
code generation for these kinds of wrapper functions is improved
noticeably, and we spend much less time just initializing data that we
will never use.

The functions still get called all the time, and it still shows up at
3.5+% in my microbenchmark, but it's quite a bit lower down the list,
and much less noticeable.

* Emailed patches from Eric Paris <eparis@redhat.com>:
  lsm_audit: don't specify the audit pre/post callbacks in 'struct common_audit_data'
  SELinux: do not allocate stack space for AVC data unless needed
  SELinux: remove avd from slow_avc_audit()
  SELinux: remove avd from selinux_audit_data
  LSM: shrink the common_audit_data data union
  LSM: shrink sizeof LSM specific portion of common_audit_data