Commit Graph

64780 Commits

Author SHA1 Message Date
Yifan Hong 2ec92cfc28 libdebuggerd_handler_fallback: make vendor_ramdisk_available.
Test: builds
Bug: 156098440
Change-Id: I11466de73bbb3a30c10a7a9088954e37772b7a00
2020-10-28 10:57:51 -07:00
Yifan Hong 55015ffb82 libcutils: make vendor_ramdisk_available.
Test: builds
Bug: 156098440
Change-Id: I663a3839e402a83ebf31b8a680c61f1e269548f6
2020-10-28 10:57:51 -07:00
Yifan Hong f3b2b96925 libpropertyinfoparser: make vendor_ramdisk_available.
Test: pass
Bug: 156098440
Change-Id: I9c9e74c431ac0f8c382bea0ecd290968aa3f4448
2020-10-28 10:57:51 -07:00
Treehugger Robot df17454a84 Merge "Fix lseek() check" 2020-10-26 17:24:31 +00:00
Greg Kaiser 74b8449f58 Fix lseek() check
Since 'pos' is unsigned, we need to tweak the check.

Test: TreeHugger
Change-Id: I97dcb50fb86196b09b11ba725593e6c83c5586d9
2020-10-26 06:37:32 -07:00
Yo Chiang 346e6792b4 Merge "Call GetDsuMetadataKeyDir() for DSU metadata encryption dir" 2020-10-26 05:27:36 +00:00
David Anderson 45662c8941 Merge "snapuserd: Refactor client to allow persistent connections." 2020-10-23 22:01:42 +00:00
David Anderson 8425f6e6e6 Merge "snapuserd: Refactor daemon/server." 2020-10-23 18:33:15 +00:00
Colin Cross b527e66392 Merge "Make the connection between implementation and llndk_library explicit" 2020-10-23 18:09:42 +00:00
Primiano Tucci 24a21867e7 Merge "Introduce security.lower_kptr_restrict property" 2020-10-23 18:03:30 +00:00
Treehugger Robot d0ce499873 Merge "fs_mgr.cpp: fix the problem that the casefold feature not enabled for the data partition" 2020-10-23 16:47:43 +00:00
Baligh Uddin 3f52272883 Merge "Migrate system/core/adb to packages/modules/adb" 2020-10-23 16:16:32 +00:00
Daniel Rosenberg 323060840a Merge changes I3339d552,I126e1583,Iccc6580a
* changes:
  Add GetLastLabel and InitializeAppend
  Switch up Cow Format to be resumable
  reland: Rename Flush to Finalize
2020-10-23 11:08:46 +00:00
Yongqin Liu c007c43335 fs_mgr.cpp: fix the problem that the casefold feature not enabled for the data partition
The value of entry.mount_point for data partition is "/data"

Fixes: 5ba5b90cd6 ("fs_mgr: try tune2fs for casefolding on /data only")

Test: got "Can't mount with encoding and encryption" problem reported
      by the db845c build with the default 5.4.38 prebuilt kernel

Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Change-Id: I226a2275f5f2ee18503c5a3863ef5a1d2c2ed7be
2020-10-23 13:34:49 +08:00
David Anderson fe7585a8b0 snapuserd: Refactor client to allow persistent connections.
This refactors SnapuserdClient so it retains a connection for its
lifetime. This allows SnapshotManager to ensure the daemon is running
and hold a connection open across all of its operations.

The main impetus of this change is to remove the ambiguity between first
and second-stage sockets. SnapshotManager should only ever connect to
the first-stage socket during first-stage init, or, to initiate the
"transition" step during second-stage init.

The transition steps are roughly:
 (1) Start second-stage daemon.
 (2) Load new device-mapper tables.
 (3) Connect second-stage daemon to new dm-user devices.
 (4) Activate the new tables, flushing IO to the first-stage daemon.
 (5) Send a signal to the first-stage daemon to exit.

This patch makes it easier to hold these two separate connections.

Bug: 168554689
Test: manual test
Change-Id: I51cb9adecffb19143ed685e0c33456177ec3d81f
2020-10-22 22:07:23 -07:00
David Anderson cff35f67ad snapuserd: Refactor daemon/server.
This is in preparation for moving to a traditional client/server model
where clients stay connected and the server multiplexes multiple
connections.

Client has been renamed to DmUserClient to differentiate it from local
socket clients.

poll() responsibilities have been moved into SnapuserdServer. In
addition, the server now tracks all open clients and polls them
together with the listen socket.

SnapuserDaemon is now only responsible for signal masking. These two
classes can probably be merged together - I didn't do that here because
the patch was already large.

Bug: 168554689
Test: manual test
Change-Id: Ibc06f6287d49e832a8e25dd936ec07747a1b0555
2020-10-22 22:00:17 -07:00
Daniel Rosenberg 3d17cb9a57 Add GetLastLabel and InitializeAppend
GetLastLabel returns the last Label that a reader is confident about.
InitializeAppend starts a writer up to append data after the last given
label, assuming all later labels are not relevant data.

Change-Id: I3339d5527bae833d9293cbbc63126136b94bd976
Bug: 168829493
Test: cow_api_test
2020-10-22 21:26:27 -07:00
Daniel Rosenberg 2d2fd72502 Switch up Cow Format to be resumable
This switches up the format to alternate ops with data, followed by a
footer containing additional meta information. This allows the file to
be resumed at arbitrary points if writing gets interrupted by power
loss.
Also adds a label op, which allows labeling future ops as connected.
If the footer is missing, Append will treat the last label as possibly
corrupt, and ignore it.

Change-Id: I126e15837d710776f9396e7afc9b0cd595e26b59
Bug: 168829493
Test: cow_api_test
2020-10-22 21:26:27 -07:00
Baligh Uddin 795c2c222c Migrate system/core/adb to packages/modules/adb
BUG: 167963357
Test: TH
Merged-In: Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d
Change-Id: I810a109116247af2af9a8628680620cb683d48a9
2020-10-23 03:43:43 +00:00
David Anderson 7d55df2895 Merge "libsnapshot: Add .rc file for snapuserd." 2020-10-22 18:21:18 +00:00
Primiano Tucci 253289fe07 Introduce security.lower_kptr_restrict property
This is to allow the tracing service to temporarily
lower kptr_restrict for the time it takes to build
its internal symbolization map (~200ms), only on
userdebug/eng builds.
kptr_restrict unfortunately cannot be lowered by
the tracing service itself. The main reason for that
is the fact that the kernel enforces a CAP_SYS_ADMIN
capability check at write() time, so the usual pattern
of opening the file in init and passing the FD to the
service won't work.

For more details see the design doc go/perfetto-kallsyms.
Bug: 136133013
Test: perfetto_integrationtests --gtest_filter=PerfettoTest.KernelAddressSymbolization in r.android.com/1454882

Change-Id: Ib2a8c69ed5348cc436223ff5e3eb8fd8df4ab860
2020-10-22 16:18:41 +01:00
Daniel Rosenberg b4a81ccd5a reland: Rename Flush to Finalize
As we change to a more resumable format, flush mostly writes the final
parts of the file that are needed, which would write extra data that is
not needed to continue writing, and would immediately be overwritten.

Additionally, in the next patch we will fsync the file after adding an
op, making the flush built in, and the Finalize name more appropriate.

Bug: 168829493
Test: builds
Change-Id: Iccc6580ac72ff066cfeeb32e3cdaf69c5ba615fc
2020-10-22 02:34:26 -07:00
Treehugger Robot 1ef094a890 Merge "Use the "marketing names" for Q and R." 2020-10-22 01:00:54 +00:00
Christopher Ferris 758e52551f Merge "Update for new kernel headers." 2020-10-22 00:54:16 +00:00
Elliott Hughes 86777107c0 Use the "marketing names" for Q and R.
Even though they're numbers.

Test: treehugger
Change-Id: I0872853c98eacdd789fc83f59de82334e1e82ab9
2020-10-21 16:36:14 -07:00
Yifan Hong 634a3dc179 Merge "Always create ramdisk/first_stage_ramdisk." 2020-10-21 18:35:22 +00:00
Jason Chiu 7e93bd24b2 Merge "Disable callstack for mac too." 2020-10-21 08:14:23 +00:00
David Anderson 26878da29b libsnapshot: Add .rc file for snapuserd.
Bug: 168554689
Test: setprop ctl.start snapuserd
Change-Id: I9b8f20a364249135a1edb0ee69f039059c4deaf3
2020-10-21 00:41:45 -07:00
Chiachang Wang ba8a309773 Merge "Prevent using abstract terms in the property name" 2020-10-21 07:00:56 +00:00
David Anderson 7d66a60012 Merge "libsnapshot: Add a source_partition parameter to OpenSnapshotWriter." 2020-10-21 06:55:03 +00:00
Christopher Ferris 8377b10f29 Disable callstack for mac too.
Bug: 171353386

Test: Builds.
Change-Id: Id8a5cce170682ea43aa641c187c22cb31b6fd017
2020-10-21 06:04:00 +00:00
Daniel Rosenberg bc7a365bbe Merge "Revert "Rename Flush to Finalize"" 2020-10-21 03:50:40 +00:00
Jason Chiu ebfbf7d920 Revert "Rename Flush to Finalize"
This reverts commit 6177f6f6c4.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=sdk_x86-sdk&lkgb=6919873&lkbb=6919923&fkbb=6919923, bug b/171353958

Change-Id: Iea3059b4bf64a7cac930c40b8b312b5b26b0baea
BUG: 168829493
2020-10-21 03:16:42 +00:00
Daniel Rosenberg 6b6a2b9442 Merge "Rename Flush to Finalize" 2020-10-21 02:38:10 +00:00
David Anderson e3a715a9c5 Merge "ueventd: Put dm-user devices in a folder" 2020-10-20 23:01:42 +00:00
Christopher Ferris 5c573b45ec Merge "Remove include/backtrace symlink." 2020-10-20 22:44:14 +00:00
Yifan Hong 42c55f5ce9 Always create ramdisk/first_stage_ramdisk.
Always create ramdisk/first_stage_ramdisk directory at build time.
Generic boot image always need this directory to work on devices
w/ and w/o a dedicated recovery partition. By default, the ramdisk is
mounted as readonly, unless on x86 platforms. If the ramdisk is mounted as
readonly, the directory cannot be created at runtime.

Note that devices with a dedicated recovery partition will never
switch root into the first_stage_ramdisk directory in first stage init.

Bug: 156098440
Test: manual by disabling init to mkdir first_stage_ramdisk

Change-Id: Ie272f4eedccc0b008fb538c1e0f3985ff70696cf
2020-10-20 13:44:09 -07:00
Christopher Ferris 0e69160ebc Remove include/backtrace symlink.
This requires a few other changes to support building libutils
properly. It does appear the windows versions of libutils is
referencing CallStack code, but it doesn't seem to cause any problems.
However, I removed those references completely for the windows build.

Also removed a few extra spaces that seem to have accumulated in the
RefBase.cpp.

Bug: 170465278

Test: Builds and libutils unit tests pass.
Change-Id: Ibeee7791b13636b34bdd592c5420fd91620f752a
2020-10-20 12:46:14 -07:00
David Anderson 862b01746e Merge "libsnapshot: Implement OpenSnapshotWriter for compressed snapshots." 2020-10-20 19:16:58 +00:00
David Anderson 515a5bdde0 ueventd: Put dm-user devices in a folder
When a device-mapper table contains a "user" entry, a corresponding
dm-user misc control device is created. The devices are put into a
separate folder by default, which currently confuses ueventd, and we
wind up with paths like:

    /dev/dm-user!blah

Special case these devices so they wind up as:

    /dev/dm-user/blah

Test: dmctl create blah user 0 100 test-device
      /dev/dm-user/test-device exists
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Change-Id: I313db07c3400f14f3ed0ffa20fdac2ac3e34b6d3
2020-10-20 12:13:51 -07:00
Elliott Hughes 2d697d330f Merge "Fix SharedBuffer tests to pass under hwasan." 2020-10-20 18:40:43 +00:00
Treehugger Robot 8013cc3d85 Merge "libmodprobe: Fail when modules.dep lacks colon" 2020-10-20 15:45:43 +00:00
Chiachang Wang 7396fed802 Prevent using abstract terms in the property name
In many cases, it's a common practice to use the name of the
domain type of a process or the type of the usage category
instead of using ambiguous terms like sys, system, etc.
Update the property name with net. prefix for better naming to
fit the usage of the system property.

Bug: 170917042
Test: 1. m -j10
      2. Check if /proc/sys/net/ipv4/tcp_default_init_rwnd is
         updated as expected
Change-Id: I0267880d62cc504a419827732780d2db97b2dfef
2020-10-20 19:45:02 +08:00
Yifan Hong 14096bd924 Merge "Move GSI AVB keys to vendor_boot if BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT" 2020-10-20 01:51:11 +00:00
Elliott Hughes f2f016e741 Fix SharedBuffer tests to pass under hwasan.
Allocating the entire address space is sufficiently unreasonable that
hwasan blows you out of the water if you try to do that. Half the
address space feels like it's large enough to be guaranteed to fail
(which is all I think this intended to test) without being quite so
obviously incorrect that tools like hwasan are going to object...

...except hwasan actually has a 2GiB limit. So let's keep the cleanup,
but also just disable these tests if they're running under hwasan for
now.

Bug: https://issuetracker.google.com/171054277
Test: treehugger
Change-Id: I41f3def5c3a43aa7f9ca3a130b4306ebed659d6a
2020-10-19 16:51:58 -07:00
David Anderson f70d801d4b Merge "libsnapshot: Implement OnlineKernelSnapshotWriter::OpenReader." 2020-10-19 20:58:55 +00:00
Colin Cross 6a2b16693c Make the connection between implementation and llndk_library explicit
Instead of assuming a module with the .llndk suffix exists, add an
llndk_stubs property to every cc_library module that has a
corresponding llndk_library.  Also rename the llndk_library to have
an explicit .llndk suffix.

Bug: 170784825
Test: no changes to build.ninja (excluding comments) or Android-${TARGET_PRODUCT}.mk
Change-Id: Ifba79a1ae64a67a9d7393dac2fb012cd8af8e149
2020-10-19 13:38:05 -07:00
Christopher Ferris 9bbb841ee4 Update for new kernel headers.
A new capabality was added, so update.

Test: Builds.
Change-Id: I385f5d2443376e6a4dca98c34de265357a58460e
2020-10-19 11:55:12 -07:00
Treehugger Robot 4fdc6f1328 Merge "Migrate system/core/adb to packages/modules/adb" 2020-10-19 17:56:36 +00:00
Tom Cherry 4489ee0a19 Merge "init.rc: create /data/vendor* earlier" am: dd5184f858
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1464703

Change-Id: I50e3f2f0dc6ed9f4c1f921ca4c948fda4817fc26
2020-10-19 15:11:40 +00:00