Commit graph

763 commits

Author SHA1 Message Date
Nick Kralevich
cdcffc0d29 am 3393bb65: Merge "fstrim.c: use open(O_DIRECTORY) instead of stat"
* commit '3393bb650fd931e494a0280fc13717f36aea22fc':
  fstrim.c: use open(O_DIRECTORY) instead of stat
2015-03-05 21:03:15 +00:00
Nick Kralevich
3393bb650f Merge "fstrim.c: use open(O_DIRECTORY) instead of stat" 2015-03-05 20:57:54 +00:00
Nick Kralevich
24751743d7 fstrim.c: use open(O_DIRECTORY) instead of stat
open(O_DIRECTORY) returns an error if the open attempt
is against anything other than a directory. This basically
duplicates the check that the stat() call was trying to do.
Eliminate the unnecessary stat() call and use O_DIRECTORY
instead.

Change-Id: I1821abbed325f29a7214fdc41ed27cd9e26817d0
2015-03-05 12:50:23 -08:00
Shawn Willden
47bc0ffadd am 5054f7ee: Merge "Rename keymaster_device_t to keymaster0_device_t."
* commit '5054f7ee4fa6e747eb8d08f60ec91ba6a9363878':
  Rename keymaster_device_t to keymaster0_device_t.
2015-02-26 23:31:10 +00:00
Shawn Willden
5054f7ee4f Merge "Rename keymaster_device_t to keymaster0_device_t." 2015-02-26 23:24:54 +00:00
JP Abgrall
aac44855ca am c19c6738: Merge "vold: acquire wakelock on fstrim thread"
* commit 'c19c67388cca4bda7b2042f065a7dc596f72fee8':
  vold: acquire wakelock on fstrim thread
2015-02-26 19:03:35 +00:00
JP Abgrall
c19c67388c Merge "vold: acquire wakelock on fstrim thread" 2015-02-26 18:56:16 +00:00
Young-ho Cha
e72cd592b3 vold: acquire wakelock on fstrim thread
If fstrim thread creation or detachment is failed, wakelock can be leaked.
So move wakelock acquire to do_fstrim_filesystems function

Change-Id: I4da3164343af83fae3e5b01700f43d1752661276
Signed-off-by: Young-ho Cha <ganadist@gmail.com>
2015-02-26 18:45:52 +00:00
Shawn Willden
d1fd8468d0 Rename keymaster_device_t to keymaster0_device_t.
This is to accomodate the new keymaster1_device_t, which has an entirely
different interface.

Soon I'll provide a libkeymaster which provides a unified (and nicer)
interface for dealing with both v0 and v1 keymaster implementations
using a v1 keymaster API.  For now this change is just so that vold will
build and run.

Change-Id: I5c54282c12d1c4b8b22ed4929b6e6c724a94ede4
2015-02-24 09:55:04 -07:00
Elliott Hughes
33b6de4b94 am d55d8dac: Merge "prevent ioctl_init() to write outside buffer"
* commit 'd55d8dac45dc60cb2cc9e599d3e89532db0cfc39':
  prevent ioctl_init() to write outside buffer
2015-02-07 07:38:37 +00:00
Elliott Hughes
d773fc118a am 8c0a0db1: Merge "Change strncpy to strlcpy"
* commit '8c0a0db1ad217f3238e31c291afa6b5e6a6fc98d':
  Change strncpy to strlcpy
2015-02-07 07:38:37 +00:00
Elliott Hughes
d55d8dac45 Merge "prevent ioctl_init() to write outside buffer" 2015-02-07 07:29:43 +00:00
Elliott Hughes
8c0a0db1ad Merge "Change strncpy to strlcpy" 2015-02-07 07:28:06 +00:00
Paul Lawrence
38394c7d2d am 223fd1ca: Revert "Make encryption configurable"
* commit '223fd1cad8d627dc36e11da8cdd342c1a810d226':
  Revert "Make encryption configurable"
2015-02-07 00:11:29 +00:00
Paul Lawrence
223fd1cad8 Revert "Make encryption configurable"
This reverts commit 6a69cfc411.

The original fix seems to have led to boot failures in QA. Rather than
risk shipping, revert the change. Bug 18764230 reopened.

Requires change
    https://googleplex-android-review.git.corp.google.com/#/c/629950/

Bug: 19278390
Bug: 19199624

Change-Id: Ia858c4db0abb917f9364ec8048f59ca4fb48e233
2015-02-06 17:32:56 +00:00
Nick Kralevich
cf694550b2 am d9f2082f: Merge "VolumeManager: don\'t use faccessat(AT_SYMLINK_NOFOLLOW)"
* commit 'd9f2082fd798e77cc15735bc582507abb64c8ed4':
  VolumeManager: don't use faccessat(AT_SYMLINK_NOFOLLOW)
2015-02-06 17:20:23 +00:00
Nick Kralevich
d9f2082fd7 Merge "VolumeManager: don't use faccessat(AT_SYMLINK_NOFOLLOW)" 2015-02-06 17:11:00 +00:00
Nick Kralevich
25e581a11c VolumeManager: don't use faccessat(AT_SYMLINK_NOFOLLOW)
Don't use faccessat(AT_SYMLINK_NOFOLLOW). In Android, AT_SYMLINK_NOFOLLOW
is ignored. In glibc, it returns counter intuitive results when a
symbolic link is encountered, returning true all the time even though
an open(O_NOFOLLOW) will eventually fail.

Instead, stat the file and check to see if it's a regular file,
not a directory or symlink or some other weirdness.

In addition, fix a bug where isAsecInDirectory would return
true ("-1") if the asec directory didn't exist. It should return
false.

Bug: 18867827
Change-Id: I33d90e9095fad36ce0f83fde105b70f72e4eaef4
2015-02-06 08:55:08 -08:00
Henrik Baard
2152266deb Change strncpy to strlcpy
Change all function calls to strncpy to strlcpy.

Change-Id: I2bbefb7829d715847c5b26f4b9f0faddbd4c89d0
2015-02-06 09:24:14 +01:00
Marek Pola
5e6b9141c1 prevent ioctl_init() to write outside buffer
The strncpy operation does not write a 0 termination
if the name is larger than the target buffer.

Ensure that zero termination is always written using
safe strlcpy function.

Change-Id: Idb68cdff7cd1a860c1dfac7494fa99f3d382cb91
2015-02-06 08:01:43 +01:00
Elliott Hughes
71f8d86fdf am f805a8b3: Merge "Change lseek to lseek64"
* commit 'f805a8b3a917b163c789f1ad4b272560f98eb6f1':
  Change lseek to lseek64
2015-02-05 20:26:52 +00:00
Elliott Hughes
e22b21af3a am ebc83b3e: Merge "Fix memory leak in upgrade_crypt_ftr"
* commit 'ebc83b3e8ef6d0dbab84bec88e0231c7911e5378':
  Fix memory leak in upgrade_crypt_ftr
2015-02-05 18:51:07 +00:00
Elliott Hughes
f805a8b3a9 Merge "Change lseek to lseek64" 2015-02-05 17:36:02 +00:00
Elliott Hughes
ebc83b3e8e Merge "Fix memory leak in upgrade_crypt_ftr" 2015-02-05 17:08:59 +00:00
Björn Landström
96dbee7bd6 Change lseek to lseek64
Using lseek on 64-bit offset parameter caused failure
to write persistent data in crypto footer.

Changed calls to use lseek64 instead.

Change-Id: I4e4c397a6d36201b8b08be3017e17c9fac3b34e4
2015-02-05 15:18:44 +01:00
Henrik Baard
91064633ff Fix memory leak in upgrade_crypt_ftr
The structure crypt_persist_data was allocated,
but never freed.

Added free of allocated memory in normal and
error case.

Change-Id: I9aaa067e6f6501e8ce007f8659004b5dbcf2b246
2015-02-05 15:09:17 +01:00
Paul Lawrence
ef87a17a2a am fcca3faa: Merge "Make encryption configurable"
* commit 'fcca3faad48fc37be78a7307ee94b1b55cb89f16':
  Make encryption configurable
2015-01-28 21:21:30 +00:00
Paul Lawrence
fcca3faad4 Merge "Make encryption configurable" 2015-01-28 21:14:20 +00:00
Elliott Hughes
44a307b054 am 61c19efd: Merge "Add missing <string.h> include."
* commit '61c19efd0b9015eb0a7350f8ec6b7e61ae5a75ab':
  Add missing <string.h> include.
2015-01-28 20:14:17 +00:00
Elliott Hughes
61c19efd0b Merge "Add missing <string.h> include." 2015-01-28 20:04:02 +00:00
Elliott Hughes
38a73c6a20 Add missing <string.h> include.
Change-Id: I31f5cd6fb4ff55d7cfe213f66955e3dbcbdff101
2015-01-28 11:47:21 -08:00
Paul Lawrence
c19cb9c832 Make encryption configurable
Add maybeenabledefaultencryption function, that encrypts based
on the encryption flag and appropriate environment variable

Bug: 18764230
Change-Id: Id9a1967d09a7ae63a51240c0a5f3c41505af0e9a
2015-01-28 11:42:55 -08:00
Paul Lawrence
4a36ca0038 am 6a69cfc4: Make encryption configurable
* commit '6a69cfc411c086f15d59b7dc105763af16620414':
  Make encryption configurable
2015-01-26 15:53:01 +00:00
Kenny Root
ba5834dcea am 26970299: Merge "Remove superfluous OpenSSL include paths."
* commit '269702997153cdf92c65cfee277c76afed44e9e5':
  Remove superfluous OpenSSL include paths.
2015-01-23 01:17:16 +00:00
Kenny Root
2697029971 Merge "Remove superfluous OpenSSL include paths." 2015-01-23 01:05:47 +00:00
Adam Langley
41405bb3e5 Remove superfluous OpenSSL include paths.
The libcrypto and libssl modules (and their respective static and host
versions) use LOCAL_EXPORT_C_INCLUDE_DIRS thus just including the module
is sufficient.

Additionally, cryptfs.h was including an OpenSSL header just to get the
length of a SHA-256 hash. Rather than force all users of this header to
also depend on libcrypto, it's easier just to define that value in the
header file.

Change-Id: I3e3e0db906a212e1093944b298e4a8ff2e2fb07d
2015-01-22 16:45:28 -08:00
Paul Lawrence
6a69cfc411 Make encryption configurable
Add maybeenabledefaultencryption function, that encrypts based
on the encryption flag and appropriate environment variable

Bug: 18764230
Change-Id: Id9a1967d09a7ae63a51240c0a5f3c41505af0e9a
2015-01-21 10:00:17 -08:00
Yabin Cui
09cf7354a9 am f3b2637e: Merge "Use getmntent when accessing /proc/mounts."
* commit 'f3b2637e0611ac7953c18ce39a47b7c408a70160':
  Use getmntent when accessing /proc/mounts.
2015-01-06 18:21:52 +00:00
Yabin Cui
f3b2637e06 Merge "Use getmntent when accessing /proc/mounts." 2015-01-06 18:06:08 +00:00
Yabin Cui
d1104f75a7 Use getmntent when accessing /proc/mounts.
Bug: 18887435
Change-Id: Ibcb446fac954d9c42ebdfc4b684e6f3503337ab4
2015-01-06 09:53:12 -08:00
Elliott Hughes
20d2a0acd9 am ac2bbd08: Merge "Fix missing #includes in system/vold."
* commit 'ac2bbd08c61e7412912613605d3e561eb22c41c1':
  Fix missing #includes in system/vold.
2014-12-30 12:21:15 +00:00
Elliott Hughes
ac2bbd08c6 Merge "Fix missing #includes in system/vold." 2014-12-29 22:10:51 +00:00
Elliott Hughes
721c3d0fa9 Fix missing #includes in system/vold.
Change-Id: I53611cf8373daf638b0cc45b7b3d17e4d3e7247e
2014-12-29 14:09:42 -08:00
Brian Carlstrom
da91b1915c Remove unused local variable to fix the build
Change-Id: Ic0a77a754b649d360d07eaa9e6a93274e7eaf0a8
2014-12-18 17:01:40 -08:00
Dan Albert
210caabdb5 resolved conflicts for merge of 88aba541 to lmp-mr1-dev-plus-aosp
Change-Id: Ie5ef819dd8168cb6a73f84a881a92c116705fffc
2014-12-18 14:08:43 -08:00
Dan Albert
88aba541a0 Merge "Fix alignment of buffer used for dm_ioctl." 2014-12-18 18:42:16 +00:00
Dan Albert
c07fa3fa5a Fix alignment of buffer used for dm_ioctl.
Since the dm_ioctl struct was being allocated on the stack as a large
character array, it was getting character alignment rather than the
proper alignment for the struct. GCC had been getting away with this
so far, but it's undefined behavior that clang managed to expose.

Bug: 18736778
Change-Id: Ied275dfad7fcc41d712b2d02c8a185f499221f57
2014-12-18 10:24:23 -08:00
Tim Murray
6c78e7d772 resolved conflicts for merge of 4be36106 to lmp-mr1-dev-plus-aosp
Change-Id: If504710a618d8c3adf85297d5fd2909558ed57a3
2014-12-17 16:41:07 -08:00
Tim Murray
4be3610636 Merge "Make vold compile with -Werror -Wall." 2014-12-18 00:23:27 +00:00
Tim Murray
8439dc9fd5 Make vold compile with -Werror -Wall.
-Wno-missing-field-initializers is used as well, but that is an
overzealous warning from initializing structs with {0} and not a
real warning.

bug 18736778 and 16868177

Change-Id: Iffde89cd7200d9a11193e1614f1819f9fcace30a
2014-12-18 00:21:21 +00:00