Commit graph

562992 commits

Author SHA1 Message Date
Amit Pundir
66daa5f5e2 Revert "SELinux: Enable setting security contexts on rootfs inodes."
This reverts commit 78d36d2111.

Drop this duplicate patch. This patch is already upstreamed in v4.4. Commits
5c73fceb8c (SELinux: Enable setting security contexts on rootfs inodes.),
12f348b9dc (SELinux: rename SE_SBLABELSUPP to SBLABEL_MNT), and
b43e725d8d (SELinux: use a helper function to determine seclabel),
for reference.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-26 16:24:47 +05:30
Amit Pundir
5a0725f49f Revert "SELinux: build fix for 4.1"
This reverts commit 43e1b4f528.

This patch is part of code which is already upstreamed in v4.4. Commits
5c73fceb8c (SELinux: Enable setting security contexts on rootfs inodes.),
12f348b9dc (SELinux: rename SE_SBLABELSUPP to SBLABEL_MNT), and
b43e725d8d (SELinux: use a helper function to determine seclabel).
for reference.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-26 16:24:43 +05:30
Daniel Rosenberg
00ee836d89 fuse: Add support for d_canonical_path
Allows FUSE to report to inotify that it is acting
as a layered filesystem. The userspace component
returns a string representing the location of the
underlying file. If the string cannot be resolved
into a path, the top level path is returned instead.

bug: 23904372
Change-Id: Iabdca0bbedfbff59e9c820c58636a68ef9683d9f
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2016-04-25 19:16:11 -07:00
Daniel Rosenberg
4b7de83752 vfs: change d_canonical_path to take two paths
bug: 23904372
Change-Id: I4a686d64b6de37decf60019be1718e1d820193e6
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2016-04-25 19:15:48 -07:00
Amit Pundir
5e00c3098b android: recommended.cfg: remove CONFIG_UID_STAT
Remove UID Stat driver.

Change-Id: Ifc9d2c6fe27900f30e6407398f5b24222518bffc
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-25 12:55:23 -07:00
Amit Pundir
7c79aca516 netfilter: xt_qtaguid: seq_printf fixes
Update seq_printf() usage in xt_qtaguid to align
with changes from mainline commit 6798a8caaf
"fs/seq_file: convert int seq_vprint/seq_printf/etc...
returns to void".

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-25 22:19:46 +05:30
Amit Pundir
ece28ad441 Revert "misc: uidstat: Adding uid stat driver to collect network statistics."
This reverts commit 6b6d5fbf9a.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-25 22:19:46 +05:30
Amit Pundir
42d9422a80 Revert "net: activity_stats: Add statistics for network transmission activity"
This reverts commit afedd7beba.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-25 22:19:46 +05:30
Amit Pundir
5c0d8ae10a Revert "net: activity_stats: Stop using obsolete create_proc_read_entry api"
This reverts commit 7c121720fa.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-25 22:19:46 +05:30
Amit Pundir
cded5596a3 Revert "misc: uidstat: avoid create_stat() race and blockage."
This reverts commit f7a8121740.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-25 22:19:46 +05:30
Amit Pundir
1ada37dc07 Revert "misc: uidstat: Remove use of obsolete create_proc_read_entry api"
This reverts commit fccab646d3.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-25 22:19:46 +05:30
Amit Pundir
cdb6973ae1 Revert "misc seq_printf fixes for 4.4"
This reverts commit 5c7566a29b.

This patch revert some changes in net/netfilter/xt_qtaguid.c as well.
I'll submit another patch to restore those changes.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-25 22:19:46 +05:30
Amit Pundir
a7eabf90ae Revert "misc: uid_stat: Include linux/atomic.h instead of asm/atomic.h"
This reverts commit 8d3a6c1538.

This series of patches revert AOSP UID_STAT and NET_ACTIVITY_STATS drivers.
I could not find any meaningful usage of these interfaces in AOSP master.

UID_STAT driver expose "/proc/uid_stat/*" interfaces but it is only
used in AOSP master as in what appears be an out of date bandwidth
test in frameworks/base and in somewhat recent battery utils test
in external/chromium-trace project.

NET_ACTIVITY_STATS driver expose "/proc/net/stat/activity" interface
but I can not track its usage anywhere in AOSP at all.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-25 22:19:46 +05:30
Dmitry Shmidt
8591a83cae Revert "net: socket ioctl to reset connections matching local address"
Use SOCK_DESTROY from now instead of SIOCKILLADDR

This reverts commit 38f0ec724f.

Change-Id: I2dcd833b66c88a48de8978dce9d72ab78f9af549
2016-04-22 11:04:14 -07:00
Dmitry Shmidt
20de1c6bc4 Revert "net: fix iterating over hashtable in tcp_nuke_addr()"
This reverts commit 4747299b2c.
2016-04-21 15:44:25 -07:00
Dmitry Shmidt
9826b2ec83 Revert "net: fix crash in tcp_nuke_addr()"
This reverts commit 08f7c4280c.
2016-04-21 15:44:11 -07:00
Dmitry Shmidt
215856823c Revert "Don't kill IPv4 sockets when killing IPv6 sockets was requested."
This reverts commit 8bf4413b4f.
2016-04-21 15:43:58 -07:00
Dmitry Shmidt
24c4a0f75c Revert "tcp: Fix IPV6 module build errors"
This reverts commit 3823c8136f.
2016-04-21 15:43:29 -07:00
Dmitry Shmidt
a9de512978 android: base-cfg: remove CONFIG_SWITCH
Change-Id: I3fd1aa7a54fe3a8d3ad5537cbc61386e52f41ea0
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2016-04-20 10:38:12 -07:00
Dmitry Shmidt
00c13787f8 Revert "switch: switch class and GPIO drivers."
Drivers should use extcon moving forward.
Documentation/extcon/porting-android-switch-class describes
how to port existing switch class drivers to extcon.

This reverts commit e4b8e66e0a.

Change-Id: I5b622c7ab4c0cb9670f8903f259a99888f503c1a
2016-04-20 10:38:12 -07:00
Dmitry Shmidt
ea20f758a0 Revert "drivers: switch: remove S_IWUSR from dev_attr"
This reverts commit dc66dee02d.
2016-04-20 10:38:12 -07:00
Amit Pundir
9f6bbb427f ANDROID: base-cfg: enable CONFIG_IP_NF_NAT
IP_NF_TARGET_{MASQUERADE,NETMAP,REDIRECT} configs,
already enabled in android-base.cfg for tethering,
are of no use if CONFIG_IP_NF_NAT is not enabled.

Don't rely on platform config for that and enable
CONFIG_IP_NF_NAT in android-base.cfg as well.

Change-Id: Ic72bcebbd925b142b09539466bf963188c83108a
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-04-19 23:43:37 +05:30
Jeff Vander Stoep
00526cde6b BACKPORT: selinux: restrict kernel module loading
Backport notes:
Backport uses kernel_module_from_file not kernel_read_file hook.
kernel_read_file replaced kernel_module_from_file in the 4.6 kernel.
There are no inode_security_() helper functions (also introduced in
4.6) so the inode lookup is done using the file_inode() helper which
is standard for kernel version < 4.6.

(Cherry picked from commit 61d612ea731e57dc510472fb746b55cdc017f371)

Utilize existing kernel_read_file hook on kernel module load.
Add module_load permission to the system class.

Enforces restrictions on kernel module origin when calling the
finit_module syscall. The hook checks that source type has
permission module_load for the target type.
Example for finit_module:

allow foo bar_file:system module_load;

Similarly restrictions are enforced on kernel module loading when
calling the init_module syscall. The hook checks that source
type has permission module_load with itself as the target object
because the kernel module is sourced from the calling process.
Example for init_module:

allow foo foo:system module_load;

Bug: 27824855
Change-Id: I64bf3bd1ab2dc735321160642dc6bbfa996f8068
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
2016-04-07 12:21:59 -07:00
Rom Lemarchand
a354cef980 android: base-cfg: enable CONFIG_QUOTA
Bug: 28032718
Change-Id: I7cb6b641f72085e69b90dca11d2ea68adcd02390
(cherry picked from commit e1b53a388e9cfcf870520a6899a37456cf1ae2c6)
2016-04-07 07:27:22 -07:00
Mark Salyzyn
d68354b3b7 ANDROID: mmc: Add CONFIG_MMC_SIMULATE_MAX_SPEED
When CONFIG_MMC_SIMULATE_MAX_SPEED is enabled, Expose max_read_speed,
max_write_speed and cache_size default module parameters and sysfs
controls to simulate a slow eMMC device. Default values are 0 (off),
0 (off) and 4 MB respectively.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 26976972
Change-Id: I342bfbd8b85f9b790e3f0e1e4e51a900ae07e05d
2016-03-31 21:02:57 +00:00
Dmitry Shmidt
03fbd079ba android: base-cfg: Add CONFIG_INET_DIAG_DESTROY
Change-Id: I67430b05eca8fd520d2795d3db60faf2ec0fab9e
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2016-03-31 13:24:05 -07:00
Daniel Kurtz
440a57717b cpufreq: interactive: only apply interactive boost when enabled
Only apply the interactive boost when the interactive governor is
enabled.  This seems like the right thing to do.

This was originally reviewed on
	https://chromium-review.googlesource.com/273501

Change-Id: I5f4a7320683eada099f9a4253e3d6b0f03057fe8
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Dmitry Torokhov <dtor@google.com>
2016-03-31 11:31:10 -07:00
Dmitry Torokhov
2ebb4d97e0 cpufreq: interactive: fix policy locking
cpufreq_interactive_speedchange_task() is running as a separate kernel
thread and is calling __cpufreq_driver_target(), which requires callers
to hold policy->rwsem for writing to prevent racing with other parts of
the kernel trying to adjust the frequency, for example kernel thermal
throttling. Let's change the code to take policy->rwsem and while at it
refactor the code a bit.

This was originally 2 changes reviewed at:
	https://chromium-review.googlesource.com/246273
	https://chromium-review.googlesource.com/256120

Change-Id: Icc2d97c6c1b929acd2ee32e8c81d81fd2af778ab
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Dmitry Torokhov <dtor@google.com>
2016-03-31 11:31:09 -07:00
Sami Tolvanen
e7d40d2bf8 ANDROID: dm verity fec: add sysfs attribute fec/corrected
Add a sysfs entry that allows user space to determine whether dm-verity
has come across correctable errors on the underlying block device.

Bug: 22655252
Bug: 27928374
Change-Id: I80547a2aa944af2fb9ffde002650482877ade31b
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
(cherry picked from commit 7911fad5f0a2cf5afc2215657219a21e6630e001)
2016-03-31 09:13:28 -07:00
Sami Tolvanen
fcd614efb6 ANDROID: android: base-cfg: enable CONFIG_DM_VERITY_FEC
Bug: 21893453
Change-Id: Idd0dfe4e3e527df2eff2f0d734effc40dce294c7
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
(cherry picked from commit 9408350ed80005174918ce5147490035b2cf451b)
2016-03-31 09:13:01 -07:00
Sami Tolvanen
f75998fe84 UPSTREAM: dm verity: add ignore_zero_blocks feature
If ignore_zero_blocks is enabled dm-verity will return zeroes for blocks
matching a zero hash without validating the content.

Change-Id: I728fa4b2586b29f2793ea5cb014289892819d249
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
(cherry picked from commit 0cc37c2df4fa0aa702f9662edce4b7ce12c86b7a)
2016-03-31 09:12:15 -07:00
Sami Tolvanen
83c1827e58 UPSTREAM: dm verity: add support for forward error correction
Add support for correcting corrupted blocks using Reed-Solomon.

This code uses RS(255, N) interleaved across data and hash
blocks. Each error-correcting block covers N bytes evenly
distributed across the combined total data, so that each byte is a
maximum distance away from the others. This makes it possible to
recover from several consecutive corrupted blocks with relatively
small space overhead.

In addition, using verity hashes to locate erasures nearly doubles
the effectiveness of error correction. Being able to detect
corrupted blocks also improves performance, because only corrupted
blocks need to corrected.

For a 2 GiB partition, RS(255, 253) (two parity bytes for each
253-byte block) can correct up to 16 MiB of consecutive corrupted
blocks if erasures can be located, and 8 MiB if they cannot, with
16 MiB space overhead.

Change-Id: Ife4f8889f7fbf0974bf3ed4be6d3322ae9b4cb0e
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
(cherry picked from commit a739ff3f543afbb4a041c16cd0182c8e8d366e70)
2016-03-31 09:11:43 -07:00
Sami Tolvanen
890b7865c5 UPSTREAM: dm verity: factor out verity_for_bv_block()
verity_for_bv_block() will be re-used by optional dm-verity object.

Change-Id: I80e0f8e7c9f234fce3fbdf21cb05aba3041d7f98
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
(cherry picked from commit bb4d73ac5e4f0a6c4853f35824f6cb2d396a2f9c)
2016-03-31 09:10:55 -07:00
Sami Tolvanen
3ec912f8ef UPSTREAM: dm verity: factor out structures and functions useful to separate object
Prepare for an optional verity object to make use of existing dm-verity
structures and functions.

Change-Id: Ib14c3834bfed222b33e068908fb5f71a53e1187b
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
(cherry picked from commit ffa393807cd69656d5b6bc9d9622e205071cbab8)
2016-03-31 09:10:15 -07:00
Sami Tolvanen
6558fe3cbe UPSTREAM: dm verity: move dm-verity.c to dm-verity-target.c
Prepare for extending dm-verity with an optional object.  Follows the
naming convention used by other DM targets (e.g. dm-cache and dm-era).

Change-Id: If6d2f27b290adf14fa77f3745fdc13aaa417c8dc
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
(cherry picked from commit 03045cbafa2d663ad8d0a583ac219d202d824344)
2016-03-31 09:09:40 -07:00
Sami Tolvanen
7475611cec UPSTREAM: dm verity: separate function for parsing opt args
Move optional argument parsing into a separate function to make it
easier to add more of them without making verity_ctr even longer.

Change-Id: I9cd9df41c3326824f8cca5764075501987e78a52
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
(cherry picked from commit 753c1fd02807cb43a1c5d01d75d454054d46bdad)
2016-03-31 09:09:02 -07:00
Sami Tolvanen
ab14138e10 UPSTREAM: dm verity: clean up duplicate hashing code
Handle dm-verity salting in one place to simplify the code.

Change-Id: If923a01dc63ae5123af13ba1b0863b73e33ddf46
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
(cherry picked from commit 6dbeda3469ced777bc3138ed5918f7ae79670b7b)
2016-03-31 09:08:26 -07:00
Mikulas Patocka
a9c7ddcf03 UPSTREAM: dm: don't save and restore bi_private
Device mapper used the field bi_private to point to dm_target_io. However,
since kernel 3.15, the bi_private field is unused, and so the targets do
not need to save and restore this field.

This patch removes code that saves and restores bi_private from dm-cache,
dm-snapshot and dm-verity.

Change-Id: Ic72905ccb6d58ff94eafaa47ba54b2688d92d3d1
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
(cherry picked from commit fe3265b180d6282648f03bc6ac3958c733df01c2)
2016-03-31 09:07:30 -07:00
Guenter Roeck
de679b3bbe mm: Export do_munmap
The 0-day build bot reports the following build error, seen if SDCARD_FS
is built as module.

ERROR: "do_munmap" undefined!

Fixes: 84a1b7d3d3 ("Included sdcardfs source code for kernel 3.0")
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Guenter Roeck <groeck@chromium.org>
2016-03-29 02:04:52 +00:00
Daniel Rosenberg
73fbdac211 sdcardfs: remove unneeded __init and __exit
Change-Id: I2a2d45d52f891332174c3000e8681c5167c1564f
2016-03-29 00:21:06 +00:00
Daniel Rosenberg
a5aa95121d sdcardfs: Remove unused code
Change-Id: Ie97cba27ce44818ac56cfe40954f164ad44eccf6
2016-03-29 00:20:52 +00:00
Guenter Roeck
cdaa7dcb05 fs: Export d_absolute_path
The 0-day build bot reports the following build error, seen if SDCARD_FS
is built as module.

ERROR: "d_absolute_path" undefined!

Fixes: 84a1b7d3d3 ("Included sdcardfs source code for kernel 3.0")
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Guenter Roeck <groeck@chromium.org>
2016-03-24 10:32:35 -07:00
Daniel Rosenberg
7581abb2ce sdcardfs: remove effectless config option
CONFIG_SDCARD_FS_CI_SEARCH only guards a define for
LOOKUP_CASE_INSENSITIVE, which is never used in the
kernel. Remove both, along with the option matching
that supports it.

Change-Id: I363a8f31de8ee7a7a934d75300cc9ba8176e2edf
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2016-03-23 17:48:27 -07:00
Daniel Rosenberg
2dea385190 inotify: Fix erroneous update of bit count
Patch "vfs: add d_canonical_path for stacked filesystem support"
erroneously updated the ALL_INOTIFY_BITS count. This changes it back

Change-Id: Idb04edc736da276159d30f04c40cff9d6b1e070f
2016-03-23 22:02:35 +00:00
Guenter Roeck
3f3b4c799d fs: sdcardfs: Declare LOOKUP_CASE_INSENSITIVE unconditionally
Attempts to build sdcardfs as module fail with

fs/sdcardfs/lookup.c: In function '__sdcardfs_lookup':
fs/sdcardfs/lookup.c:243:5: error: 'LOOKUP_CASE_INSENSITIVE' undeclared

This occurs because the define is enclosed with #ifdef
CONFIG_SDCARD_FS_CI_SEARCH. If SDCARD_FS_CI_SEARCH is configured to be
built as module, this does not work. Alternatives would be to use #if
IS_ENABLED(CONFIG_SDCARD_FS_CI_SEARCH), or to declare SDCARD_FS_CI_SEARCH
as bool, but that does not work because the define is used unconditionally
in the source.

Note that LOOKUP_CASE_INSENSITIVE is only set but not evaluated in the
current source code, so setting the flag has no real effect.

Fixes: 84a1b7d3d3 ("Included sdcardfs source code for kernel 3.0")
Cc: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Guenter Roeck <groeck@chromium.org>
2016-03-23 14:50:36 -07:00
Thierry Strudel
87977cb322 trace: cpufreq: fix typo in min/max cpufreq
Change-Id: Ieed402d3a912b7a318826e101efe2c24b07ebfe4
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2016-03-23 19:49:05 +00:00
Daniel Rosenberg
f06e869f93 sdcardfs: Add support for d_canonical_path
Change-Id: I5d6f0e71b8ca99aec4b0894412f1dfd1cfe12add
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2016-03-22 20:27:37 -07:00
Daniel Rosenberg
530d9c5fc2 vfs: add d_canonical_path for stacked filesystem support
Inotify does not currently know when a filesystem
is acting as a wrapper around another fs. This means
that inotify watchers will miss any modifications to
the base file, as well as any made in a separate
stacked fs that points to the same file.
d_canonical_path solves this problem by allowing the fs
to map a dentry to a path in the lower fs. Inotify
can use it to find the appropriate place to watch to
be informed of all changes to a file.

Change-Id: I09563baffad1711a045e45c1bd0bd8713c2cc0b6
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2016-03-22 20:27:13 -07:00
Daniel Rosenberg
1e2d3bbcf3 sdcardfs: Bring up to date with Android M permissions:
In M, the workings of sdcardfs were changed significantly.
This brings sdcardfs into line with the changes.

Change-Id: I10e91a84a884c838feef7aa26c0a2b21f02e052e
2016-03-22 20:27:13 -07:00
Daniel Campello
a1590fbeed Changed type-casting in packagelist management
Fixed existing type-casting in packagelist management code. All
warnings at compile time were taken care of.

Change-Id: I1ea97786d1d1325f31b9f09ae966af1f896a2af5
Signed-off-by: Daniel Campello <campello@google.com>
2016-03-22 20:27:13 -07:00