History log of /external/libselinux/src/android.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cb92504c2b9439b2c9bb745a3727f58e8c44c224 26-Jul-2013 Stephen Smalley <sds@tycho.nsa.gov> Fix logging of sepolicy pathname on policy load.

I9d83122e276a25d2e7c928b724344d5f3420af73 eliminated a temporary path
variable but ended up using the wrong index in the sepolicy_file[] array,
thereby indexing off the end of the array or logging the
wrong path.

Change-Id: If1b61c938bdcf53aef000d45e9415ded68a96585
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/external/libselinux/src/android.c
8792a5ce72fdb903cc1f90e63605df78455ba55a 12-Jul-2013 Nick Kralevich <nnk@google.com> am b1ae15ab: Clean up code

* commit 'b1ae15abf1d3a47b0e993d1a4daa228f73d12bb9':
Clean up code
ca0811112e819f5351a31b1cd8509c4d2cf98eb0 12-Jul-2013 Nick Kralevich <nnk@google.com> am 9ca4088e: android.c: fix free of uninitialized memory

* commit '9ca4088ee4d8378e9f01df67a8df3f0cb5071bed':
android.c: fix free of uninitialized memory
b1ae15abf1d3a47b0e993d1a4daa228f73d12bb9 12-Jul-2013 Nick Kralevich <nnk@google.com> Clean up code

Clean up the code, so it compiles with -Wall -Wextra -Werror

Change-Id: I78ad5941a45208e1a82181cedb5853753f58ff0d
/external/libselinux/src/android.c
9ca4088ee4d8378e9f01df67a8df3f0cb5071bed 12-Jul-2013 Nick Kralevich <nnk@google.com> android.c: fix free of uninitialized memory

Under certain error conditions, freecon is called with a pointer
to uninitialized memory. Make sure everything is initialized.

Move variable declaration before any goto statements. Variable
declaration after a goto statement produces weird runtime artifacts.

Change-Id: Ie1db5a8466bbf259f09a612a1c97afc3713e33df
/external/libselinux/src/android.c
0daa62c1dd9bd27f0f955f4bdebf3c537e6232eb 21-May-2013 gcondra@google.com <gcondra@google.com> am dae85f9e: Revert "Hack to fix selinux crashes on Manta"

* commit 'dae85f9e3e7f0e531138a57f1b13e646b78b1919':
Revert "Hack to fix selinux crashes on Manta"
bc3d58d53bda40d788f31e6db71451c2854736cd 21-May-2013 gcondra@google.com <gcondra@google.com> am 8c6e5f8e: Revert "Call lsetfilecon directly in fixcon."

* commit '8c6e5f8ee923ef72e550d76e855a1d6f3df4b693':
Revert "Call lsetfilecon directly in fixcon."
dae85f9e3e7f0e531138a57f1b13e646b78b1919 17-May-2013 repo sync <gcondra@google.com> Revert "Hack to fix selinux crashes on Manta"

This reverts commit 1d857f3e2e739c001b7cbbd1e37b92a038e46b98.
/external/libselinux/src/android.c
8c6e5f8ee923ef72e550d76e855a1d6f3df4b693 17-May-2013 repo sync <gcondra@google.com> Revert "Call lsetfilecon directly in fixcon."

This reverts commit 0f3a5e88ddc12f033edd8f3bbe0457ff2d3146e4.
/external/libselinux/src/android.c
4d53ee61f68921dd08d4428b7af1ba30a806f412 17-May-2013 gcondra@google.com <gcondra@google.com> am 0f3a5e88: Call lsetfilecon directly in fixcon.

* commit '0f3a5e88ddc12f033edd8f3bbe0457ff2d3146e4':
Call lsetfilecon directly in fixcon.
0f3a5e88ddc12f033edd8f3bbe0457ff2d3146e4 15-May-2013 repo sync <gcondra@google.com> Call lsetfilecon directly in fixcon.

This avoids the spurious double-lookup from calling restorecon.

Bug: 8967715
Change-Id: I3e92804dca245501ca974bda7a0d7d1c459c58da
/external/libselinux/src/android.c
2ed00e3edeb68c6728aa54e1b428cb702eb9880d 09-May-2013 Ken Sumrall <ksumrall@android.com> am 1d857f3e: Hack to fix selinux crashes on Manta

* commit '1d857f3e2e739c001b7cbbd1e37b92a038e46b98':
Hack to fix selinux crashes on Manta
1d857f3e2e739c001b7cbbd1e37b92a038e46b98 09-May-2013 Ken Sumrall <ksumrall@android.com> Hack to fix selinux crashes on Manta

Due to previous issues with make_ext4fs not zeroing out inode
tables and Nexus 10 not erasing partitions before flashing, some
devices during development were flashed with garbage in the
inode tables for unused inodes. The kernel did not care, and
ignore the unused inodes, but if e2fsck ran for any reason, it
would find what it thought were lost inodes, and put them in
lost+found.

When selinux was enabled, it would reload the policy
on all files in /data, and when it traversed /lost+found, the
kernel would crash with weird ext4 errors. We are pretty sure
this is due to bugs in the xattr code not handling potentially
bogus inodes, but we have not yet found the actual bug. In
order to get the release out the door on time, this hack will
skip searching in lost+found directories. This will be
fixed properly before the next release.

Bug: 8801548
Change-Id: If4cd78cf587cefa4cd2d41c4424034c5d5878b78
/external/libselinux/src/android.c
b7100dc38750ed5780202d5a584d170a68b345c8 06-May-2013 Nick Kralevich <nnk@google.com> am 9c30ac60: selinux_android_reload_policy: get rid of useless temp var

* commit '9c30ac60791fe561816017c96a2931d17a7cb103':
selinux_android_reload_policy: get rid of useless temp var
baa9a6253aa4d231a050f0fe0ef839717428b73c 06-May-2013 Nick Kralevich <nnk@google.com> am 397359d0: fixcon_recursive: avoid fixed size buffers

* commit '397359d043e5763f955b31e4421dcf15be8e3237':
fixcon_recursive: avoid fixed size buffers
9c30ac60791fe561816017c96a2931d17a7cb103 06-May-2013 Nick Kralevich <nnk@google.com> selinux_android_reload_policy: get rid of useless temp var

Change-Id: I9d83122e276a25d2e7c928b724344d5f3420af73
/external/libselinux/src/android.c
397359d043e5763f955b31e4421dcf15be8e3237 06-May-2013 Nick Kralevich <nnk@google.com> fixcon_recursive: avoid fixed size buffers

Change-Id: I980d526e999e602b6ab6ebfb7a5ddc7a4bd13785
/external/libselinux/src/android.c
3885884d61759de36e928fcaf40e7ac32baf1aaa 02-May-2013 Geremy Condra <gcondra@google.com> am 7f90cf46: Merge "Eliminate a memory leak."

* commit '7f90cf46569f4ca2429b7e843c3816d816c0fd36':
Eliminate a memory leak.
6750780433d7f989b56ac61b655ca982ad9027d4 27-Apr-2013 repo sync <gcondra@google.com> Fix typo in location of seapp_contexts.

Bug: 8116902
Change-Id: I066b32029ca6631d51e1d319477f5536c4fccbd5
/external/libselinux/src/android.c
300bebb3883f92dc642be4546963ffd9d152ffa8 16-Apr-2013 Stephen Smalley <sds@tycho.nsa.gov> Eliminate a memory leak.

Need to free the old seapp_contexts if any before reloading.

Change-Id: I66a9c2895518c6224920c9728157a84dc572d31a
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/external/libselinux/src/android.c
01cccbfd1b00dad6ec23383fb14cc3a2db5d144d 15-Apr-2013 Geremy Condra <gcondra@google.com> Special case fixups for unlabled files and directories.

Bug: 8116902

(cherry picked from commit 67c2662296fc8dfa233ace58567eaeba1a646d11)

Change-Id: I2041b827240d1102060e2ec5a5de8ea1ff4e171c
/external/libselinux/src/android.c
6064643a2dbfa9649894f64d9457a0b6ee103113 11-Apr-2013 Geremy Condra <gcondra@google.com> Add logic to handle file context updates.

Bug: 8116902

(cherry picked from commit 527959d207b5eb852612e91efc4880bde701fd2d)

Change-Id: Ib1061e9b804e29a57116656626999cfc7b1513e4
/external/libselinux/src/android.c
59004581965932530bb582fd071cd426dbfa39ab 21-Mar-2013 William Roberts <w.roberts@sta.samsung.com> Drop /data/system as a location for policy files

/data/system is no longer supported as a possible
location for policy files, use /data/security instead.

Change-Id: I83e5014a9e2f64bd95c0f1be6cd463fd71a7025b
/external/libselinux/src/android.c
77e151b60201e31f8eed25d745f1c1a718f70e7d 23-Jan-2013 William Roberts <w.roberts@sta.samsung.com> Add new location for policy files

Add new location for policy, /data/security, which has
precedence over /data/system

Change-Id: If75da3889c75ca83eb7dbd6e5540657a4cf65831
/external/libselinux/src/android.c
a879598e8b1d7daad0222b0692b58963a40298d7 28-Nov-2012 Stephen Smalley <sds@tycho.nsa.gov> Generalize levelFromUid support.

Generalize levelFromUid support to support per-app, per-user,
or per-combination level assignment. Adds a new levelFrom=none|app|user|all
syntax for specifying the desired behavior in seapp_contexts.
levelFromUid=true|false is still supported but translated to
levelFrom=app|none.

No change in existing behavior for existing seapp_contexts configurations.

Change-Id: I0e9c18ecf3113fa7079d2101899c92a241ef80a0
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/external/libselinux/src/android.c
d2302ca4c4142f4b46df3d334288fb7f7f939ed2 05-Jan-2013 Alice Chu <alice.chu@sta.samsung.com> Check mkdir return value before calling mount.

Change-Id: If058da4431215fa4b6f895563ba13620b7d9a81a
/external/libselinux/src/android.c
d10c3437e60a40d49e9359e1de23b018859e5d45 05-Nov-2012 Stephen Smalley <sds@tycho.nsa.gov> Mount selinuxfs on /sys/fs/selinux when possible.

Linux 3.0 introduced /sys/fs/selinux as the preferred mount point
directory for selinuxfs. Upstream libselinux tries to mount selinuxfs
on /sys/fs/selinux first and falls back to /selinux if it doesn't exist.
Do likewise in Android.

Change-Id: Iec738ff7e2f13f809a271eb03f08ef6cd2582bd4
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/external/libselinux/src/android.c
20f62f358ff65dae9aac74d6d1ccf2a648a9e20d 23-Oct-2012 Kenny Root <kroot@google.com> Do not try to restorecon if selinux is disabled

debuggerd tries to restorecon on the tombstones directory which fails
when SELinux is not enabled in the kernel. That would return an error
condition to debuggerd which would then abort its attempt to dump the
stacks of the failing program.

Fix it here in case there are other places that might call this in the
future. Currently the only other caller is android_os_SELinux.cpp JNI
code.

Change-Id: Id73796a70174333b61fd04ee6b1d99fccbea8116
/external/libselinux/src/android.c
525a22446b011415038e3c4b213ba691286f28a5 24-Sep-2012 Stephen Smalley <sds@tycho.nsa.gov> Switch app_* and isolated to _app and _isolated in seapp_contexts.

The app_* syntax was a legacy of the original approach of looking up
the username returned by getpwuid() and the original username encoding
scheme by bionic. With the recent changes to move away from this approach,
there is no reason to retain that syntax. Instead, just use _app to match
app UIDs and _isolated to match isolated service UIDs. The underscore
prefix is to signify that these are not real usernames and to avoid
conflicts with any system usernames.

Requires a corresponding change to sepolicy.

Change-Id: I21f9f88415b653c1bf6332fc100d91d969c9da64
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/external/libselinux/src/android.c
d23b9e0198be5699623b4be8c12f02719c506ce0 21-Sep-2012 Stephen Smalley <sds@tycho.nsa.gov> Rework category mapping and perform some code cleanup.

Map the app IDs to a category pair rather than a single category.
With this scheme, we can represent up to 2^16 app IDs, which exceeds
the maximum of 10000 imposed by Android. This also only uses category
bits 0-511, so 512-1023 remain free for use for other purposes (or we
could shrink the number of categories defined in the policy).

Also perform other minor code cleanups previously suggested, e.g.
fix const declaration, use an enum rather than #define, correct %lu
to %u for format string, etc.

Change-Id: I5bb727bfb4297e3e13ba1ef078e41db3ea7d1b8f
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/external/libselinux/src/android.c
895b446e8b4844f2da7354e74d5d96cc7f4418f3 19-Sep-2012 Stephen Smalley <sds@tycho.nsa.gov> Clean up libselinux logic for looking up seapp contexts entries.

Re-factor the logic shared by selinux_android_setfilecon2 and
selinux_android_setcontext into a common helper and replace the
use of getpwuid and username string parsing with direct use of
android_filesystem_config.h definitions. Also map isolated UIDs
to a separate isolated key so that we can label them differently
in the future if desired.

Change-Id: If2f9def21222588b440a6cedcceec0434f6797fd
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/external/libselinux/src/android.c
4a655eca75a79149c25616c4a5a44f5b8d26b28f 18-Sep-2012 Stephen Smalley <sds@tycho.nsa.gov> Drop the use of a policy version suffix on the sepolicy file.

The policy version suffix support was carried over from conventional
Linux distributions, where we needed to support simultaneous installation
of multiple kernels and policies. This isn't required for Android, so
get rid of it and thereby simplify the policy pathname.

Requires a corresponding change to sepolicy.

Change-Id: I061607f5fe6457e469b4834da6fc659d7ddca6f9
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/external/libselinux/src/android.c
906742dfd76bf9f21bddbddc43966c2cc9b0da0e 23-Aug-2012 Stephen Smalley <sds@tycho.nsa.gov> Do not return the libselinux-private sehandle from selinux_android_file_context_handle().
/external/libselinux/src/android.c
ce4e2e6a0819b0a23d80fa137b5ee0e351aff855 23-Aug-2012 Stephen Smalley <sds@tycho.nsa.gov> Handle naming for system uids running as secondary users.

Commit bf9441e in bionic introduced a new scheme for naming system uids
as secondary users (as part of multi-user support). Update the libselinux
logic to correctly map these identities for lookup purposes in the
seapp_contexts configuration file.
/external/libselinux/src/android.c
bee88b2041e0c5cb51dd707a9e508d8573907515 06-Aug-2012 rpcraig <rpcraig@tycho.ncsc.mil> Fix once synchronization control structure for file_contexts.

This is not needed when used within the reload scenerio. We
actually need the file_contexts to be read multiple times.
/external/libselinux/src/android.c
f1724a371be1678ebf79474ab9a390dd6a5c96c7 01-Aug-2012 rpcraig <rpcraig@tycho.ncsc.mil> Add sepolicy loading functionality.

These changes reflect changes made to init.
The sepolicy reload now happens in libselinux.
/external/libselinux/src/android.c
e8b0fd8c21a68fd0a7fcf656a7b6eae10e61c8e5 31-Jul-2012 Stephen Smalley <sds@tycho.nsa.gov> Close the selinux netlink socket when we set the app context.
/external/libselinux/src/android.c
09f69843a9991d35888b35f0bfa8de0b11a824b2 28-Jul-2012 William Roberts <bill.c.roberts@gmail.com> Allow non-matched apps to launch when no match found

Allows the zygote to still spawn apps in the zygote's
context when no match is found in seapp_contexts. In
enforcing mode, apps that are not matched will not be
spawned. A "No match" message will (still) be printed
to logcat.

Change-Id: Ibe362cc8e168be7acae5162c9ff6a310233fcbe6
/external/libselinux/src/android.c
1b36ad00bfbea16ad4456a9fd715e594d57f2fd6 27-Jul-2012 William Roberts <bill.c.roberts@gmail.com> You can now specify a sebool= flag in seapp_contexts

The seapp rule will containing an sebool clause will
ONLY be applied on a match to that boolean,
and only if the boolean is set to true.

Change-Id: Ifdba35cd3a78ce1c8173786514db649203018e28
Signed-off-by: William Roberts <w.roberts@sta.samsung.com>
/external/libselinux/src/android.c
f77e60de67dbc84d06aa77adef6bdf80455ee9f5 27-Jul-2012 Stephen Smalley <sds@tycho.nsa.gov> Revert "Allow zygote to spawn non matched apps in permissive mode"

This reverts commit 0beab96891a9ee1808b113479f167148cab5c998.
/external/libselinux/src/android.c
0beab96891a9ee1808b113479f167148cab5c998 27-Jul-2012 William Roberts <bill.c.roberts@gmail.com> Allow zygote to spawn non matched apps in permissive mode

This patch will allow non-matched apps in seapp_contexts to
still be spawned via the zygote. An error message will be sent
to logcat.

Change-Id: I9fb5dcfeb384a26e6a01d69bffd2ef14af74c51c
Signed-off-by: William Roberts <w.roberts@sta.samsung.com>
/external/libselinux/src/android.c
9b10083ab40e78cce8cc2b940ce22db6d1095fc5 27-Jul-2012 rpcraig <rpcraig@tycho.ncsc.mil> Introduce new function to return sehandle.

Add function selinux_android_file_context_handle
that opens the correct file_contexts policy file
and returns the available sehandle object.
/external/libselinux/src/android.c
edfaad87e34e7a5bb691d45fd6df3e0b5ad0bb1a 12-Jul-2012 Stephen Smalley <sds@tycho.nsa.gov> Introduce selinux_android_setfilecon2 to support passing seinfo argument.
/external/libselinux/src/android.c
c9726aba339f3d935ff14c0734edf13116af3cbf 11-Jul-2012 Stephen Smalley <sds@tycho.nsa.gov> Fix handling of app id 0.
/external/libselinux/src/android.c
ba70ee4c5ab8026e97fce5c2452dfe588dfaac3e 10-Jul-2012 Stephen Smalley <sds@tycho.nsa.gov> Add support for the new username mapping in JB, and backward compatibility.
/external/libselinux/src/android.c
32ebfe869edfc32633cf4f2ee2b56b7d8ce97a19 20-Mar-2012 Stephen Smalley <sds@tycho.nsa.gov> Check for /data/system/file_contexts first in restorecon.
/external/libselinux/src/android.c
7446c917148c778315e511ad5c990492d3c8cdb8 19-Mar-2012 Stephen Smalley <sds@tycho.nsa.gov> Add selinux_android_seapp_context_reload() to support reloading of
seapp_contexts configuration upon updates, and introduce support for
loading it from /data/system or /.
/external/libselinux/src/android.c
0ca91b300c711079816fa67b4148cac3cd1eef8c 19-Mar-2012 Stephen Smalley <sds@tycho.nsa.gov> Add a selinux_android_restorecon interface for use by the frameworks.
/external/libselinux/src/android.c
f074036424618c130dacb3464465a8b40bffef58 04-Jan-2012 Stephen Smalley <sds@tycho.nsa.gov> Port of libselinux to Android.
/external/libselinux/src/android.c