Commit Graph

7336 Commits

Author SHA1 Message Date
David 'Digit' Turner 818d641c42 adb: Check sender's socket id when receiving packets.
handle_packet() in adb.c didn't check that when an A_WRTE packet is
received, the sender's local-id matches the socket's peer id.

This meant that a compromised adbd server could sent packets to
the host adb server, spoofing the identity of another connected
device if it could "guess" the right host socket id.

This patch gets rid of the issue by enforcing even more checks
to ensure that all packets comply with the description in
protocol.txt.

+ Fix a bug where closing a local socket associated with a
  remote one would always send an A_CLSE(0, remote-id, "")
  message, though protocol.txt says that should only happen
  for failed opens.

  The issue was that local_socket_close() called
  remote_socket_close() after clearing the remote socket's
  'peer' field.

  The fix introduces a new asocket optional callback,
  named 'shutdown' that is called before that, and is
  used to send the A_CLSE() message with the right ID
  in remote_socket_shutdown().

  Also add some code in handle_packet() to detect
  invalid close commands.

Change-Id: I9098bc8c6e81f8809334b060e5dca4fc92e6fbc9
2013-12-16 17:58:08 +01:00
Elliott Hughes f73c009a3d am aa8dc146: am 41e9ee24: am feb539b6: am e1a475c0: Merge "Force alignment of data buffer used to process netlink messages"
* commit 'aa8dc14665003abbbeebed3b113c3083b3f342c7':
  Force alignment of data buffer used to process netlink messages
2013-12-14 00:27:09 +00:00
Elliott Hughes aa8dc14665 am 41e9ee24: am feb539b6: am e1a475c0: Merge "Force alignment of data buffer used to process netlink messages"
* commit '41e9ee2477071265a0dfab87cece27a38c9c2f69':
  Force alignment of data buffer used to process netlink messages
2013-12-14 00:23:41 +00:00
Elliott Hughes 41e9ee2477 am feb539b6: am e1a475c0: Merge "Force alignment of data buffer used to process netlink messages"
* commit 'feb539b6e3d81a7f0ab86b6b48056a531c4cb4ed':
  Force alignment of data buffer used to process netlink messages
2013-12-14 00:20:11 +00:00
Elliott Hughes feb539b6e3 am e1a475c0: Merge "Force alignment of data buffer used to process netlink messages"
* commit 'e1a475c0b4b73ec72fae12ea310b038d87a71b0e':
  Force alignment of data buffer used to process netlink messages
2013-12-13 16:17:24 -08:00
Elliott Hughes e1a475c0b4 Merge "Force alignment of data buffer used to process netlink messages" 2013-12-14 00:13:32 +00:00
Nick Kralevich 354e9edbd7 Relabel /data/misc/zoneinfo
The files in zoneinfo changed from system_data_file to
zoneinfo_data_file. Fixup pre-existing files.

Change-Id: Idddbd6c2ecf66cd16b057a9ff288cd586a109949
2013-12-13 16:03:48 -08:00
Narayan Kamath cec7e7e3ea am 153c03ac: am df39ce39: am d61266d0: am 4928d8d0: Merge "Fix ExtractEntryToFile."
* commit '153c03acc247ef283ed27d83e9286425b651a816':
  Fix ExtractEntryToFile.
2013-12-13 22:19:37 +00:00
Elliott Hughes 714521fc86 am d27f65ba: am d2aea929: am f595365f: am d5f97db5: Merge "libion: Use %zu for size_t"
* commit 'd27f65badafaf48001fd532e188e20122330f44d':
  libion: Use %zu for size_t
2013-12-13 22:19:34 +00:00
Narayan Kamath 153c03acc2 am df39ce39: am d61266d0: am 4928d8d0: Merge "Fix ExtractEntryToFile."
* commit 'df39ce3929b2fe08ecc09740680af258a51aed63':
  Fix ExtractEntryToFile.
2013-12-13 18:22:05 +00:00
Narayan Kamath df39ce3929 am d61266d0: am 4928d8d0: Merge "Fix ExtractEntryToFile."
* commit 'd61266d0167816e653141f7f3c6579f2a65944db':
  Fix ExtractEntryToFile.
2013-12-13 18:19:20 +00:00
Narayan Kamath d61266d016 am 4928d8d0: Merge "Fix ExtractEntryToFile."
* commit '4928d8d072b5fab695f88437987c4be10781f40c':
  Fix ExtractEntryToFile.
2013-12-13 10:16:19 -08:00
Narayan Kamath 4928d8d072 Merge "Fix ExtractEntryToFile." 2013-12-13 18:13:01 +00:00
Narayan Kamath 00a258cec7 Fix ExtractEntryToFile.
We would always write uncompressed data at offset 0 instead
of the current filedescriptor offset.

Also adds a unit-test & a clarifying comment on the API.

Change-Id: If44757e96dde504ce63d81b4dec7115fc6f6d5fb
2013-12-13 17:56:57 +00:00
Elliott Hughes d27f65bada am d2aea929: am f595365f: am d5f97db5: Merge "libion: Use %zu for size_t"
* commit 'd2aea929bfccf00dc0242e24ca13b29f6eaeb892':
  libion: Use %zu for size_t
2013-12-13 17:50:54 +00:00
Elliott Hughes d2aea929bf am f595365f: am d5f97db5: Merge "libion: Use %zu for size_t"
* commit 'f595365fefab6abe2a0429eb9b0b519704c8b5fc':
  libion: Use %zu for size_t
2013-12-13 17:47:51 +00:00
Elliott Hughes f595365fef am d5f97db5: Merge "libion: Use %zu for size_t"
* commit 'd5f97db507f47b0db0d15c8a809ce33c46391228':
  libion: Use %zu for size_t
2013-12-13 09:45:20 -08:00
Elliott Hughes d5f97db507 Merge "libion: Use %zu for size_t" 2013-12-13 17:38:23 +00:00
Vineeta Srivastava 32212f2688 Merge "libnetutils: Expect 1's complement if computed UDP checksum is zero" 2013-12-12 22:19:05 +00:00
Elliott Hughes 260854c0b0 am ed20fef0: am a99f0b6e: am 5b8daae0: am a67b39cb: Merge "Pixelflinger: Fix issue of pointers being stored in ints"
* commit 'ed20fef0630d02395abab6a073a5717ddfbfaa8d':
  Pixelflinger: Fix issue of pointers being stored in ints
2013-12-12 21:33:04 +00:00
Elliott Hughes ed20fef063 am a99f0b6e: am 5b8daae0: am a67b39cb: Merge "Pixelflinger: Fix issue of pointers being stored in ints"
* commit 'a99f0b6e386f71ecfb8aca429693b4b44e346be4':
  Pixelflinger: Fix issue of pointers being stored in ints
2013-12-12 21:30:40 +00:00
Elliott Hughes a99f0b6e38 am 5b8daae0: am a67b39cb: Merge "Pixelflinger: Fix issue of pointers being stored in ints"
* commit '5b8daae0440330097ed9d5f7bee24eea0ac0bb31':
  Pixelflinger: Fix issue of pointers being stored in ints
2013-12-12 21:28:02 +00:00
Elliott Hughes 5b8daae044 am a67b39cb: Merge "Pixelflinger: Fix issue of pointers being stored in ints"
* commit 'a67b39cb612744764ad9cd9a78aabd6b5742a384':
  Pixelflinger: Fix issue of pointers being stored in ints
2013-12-12 13:25:36 -08:00
Elliott Hughes a67b39cb61 Merge "Pixelflinger: Fix issue of pointers being stored in ints" 2013-12-12 21:22:33 +00:00
Ajay Dudani 1c87ae05b3 libnetutils: Expect 1's complement if computed UDP checksum is zero
Per http://tools.ietf.org/html/rfc768:
If the computed  checksum  is zero,  it is transmitted  as all ones (the
equivalent  in one's complement  arithmetic).   An all zero  transmitted
checksum  value means that the transmitter  generated  no checksum  (for
debugging or for higher level protocols that don't care).

Bug: 10642341
Change-Id: Ib6296dcf3f420f87227047a645c99d9f7ea0d437
2013-12-12 11:24:26 -08:00
Narayan Kamath 79582f1a61 am b4d662dc: am de39957b: am 3a5ab80d: am 7d92b7cc: Merge "Get rid of some log spam."
* commit 'b4d662dc0acaa1c7b00fe278222d1acfb4e5695f':
  Get rid of some log spam.
2013-12-12 17:31:41 +00:00
Ashok Bhat 658f89dc5c Pixelflinger: Add AArch64 support to pixelflinger JIT.
See the comment-block at the top of Aarch64Assembler.cpp
for overview on how AArch64 support has been implemented

In addition, this commit contains
[x] AArch64 inline asm versions of gglmul series of
    functions and a new unit test bench to test the
    functions

[x] Assembly implementations of scanline_col32cb16blend
    and scanline_t32cb16blend for AArch64, with unit
    test bench

Change-Id: I915cded9e1d39d9a2a70bf8a0394b8a0064d1eb4
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2013-12-12 17:30:13 +00:00
Ashok Bhat bfc6dc4ca8 Pixelflinger: Support for handling 64-bit addresses in GGL Assembler
GGLAssembler assumes addresses to be 32-bit and uses ARM 32-bit
instructions to load/store/manipulate addresses. To support, 64-bit
architectures, following changes has been done

1. ARMAssemblerInterface has been extended to support four new
   operations ADDR_LDR, ADDR_STR, ADDR_SUB, ADDR_ADD. Base class
   implements these virtual functions to use 32bit  equivalent
   function. This avoids existing 32-bit Assembler backend
   implementations like ARMAssembler and MIPSAssembler  from
   mapping the new functions to existing equivalent routines.
   This also allows 64-bit Architectures like AArch64 to override
   the function in their assembler backend implementations.

2. GGLAssembler code (spread over GGLAssembler.cpp, GGLAssembler.h
   and texturing.cpp) has been changed to use the new operations
   for address operations.

Change-Id: I3d7eace4691e3e47cef737d97ac67ce6ef4fb18d
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2013-12-12 17:30:13 +00:00
Ashok Bhat d10afb1748 Pixelflinger: Fix issue of pointers being stored in ints
Pixelflinger's code makes assumptions, at certain places,
that pointers can be stored as ints. This patch makes use
of uintptr_t wherever pointers are stored as int or cast
to int.

Change-Id: Ie76f425cbc82ac038a747f77a95bd31774f4a8e8
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2013-12-12 17:30:13 +00:00
Narayan Kamath b4d662dc0a am de39957b: am 3a5ab80d: am 7d92b7cc: Merge "Get rid of some log spam."
* commit 'de39957ba115b1e31b3b991fa09c958a0ba601c5':
  Get rid of some log spam.
2013-12-12 17:29:07 +00:00
Narayan Kamath de39957ba1 am 3a5ab80d: am 7d92b7cc: Merge "Get rid of some log spam."
* commit '3a5ab80d0f2a70b2e39ffcc6eebf876b04ff5cdd':
  Get rid of some log spam.
2013-12-12 17:27:53 +00:00
Narayan Kamath 3a5ab80d0f am 7d92b7cc: Merge "Get rid of some log spam."
* commit '7d92b7cc6580285ab7f8ef86be7512eafda89354':
  Get rid of some log spam.
2013-12-12 09:25:29 -08:00
Narayan Kamath 7d92b7cc65 Merge "Get rid of some log spam." 2013-12-12 17:19:40 +00:00
Narayan Kamath f6a196522a Get rid of some log spam.
We don't need a warning if an entry isn't found in a zip
file. It can happen as part of normal operation.

Change-Id: I86c132a040371f36f0dd981b49c02b3173821439
2013-12-12 10:29:31 +00:00
Nick Kralevich 2f06ba6122 am bfb1d8a2: am af9e9d97: am f0a68b54: am 8779c4ea: Merge "Minor cleanups."
* commit 'bfb1d8a27532180dd08fc48190aed464abbdd8b8':
  Minor cleanups.
2013-12-11 23:05:12 +00:00
Nick Kralevich bfb1d8a275 am af9e9d97: am f0a68b54: am 8779c4ea: Merge "Minor cleanups."
* commit 'af9e9d97ee7a53fd5f315ac16b63cc41a3207c33':
  Minor cleanups.
2013-12-11 22:56:29 +00:00
Nick Kralevich af9e9d97ee am f0a68b54: am 8779c4ea: Merge "Minor cleanups."
* commit 'f0a68b54be5ba78466a7075a6d9a72438c25e645':
  Minor cleanups.
2013-12-11 22:53:39 +00:00
Nick Kralevich f0a68b54be am 8779c4ea: Merge "Minor cleanups."
* commit '8779c4eab43956ecf626bbece3f6f3bc54970d6a':
  Minor cleanups.
2013-12-11 14:50:20 -08:00
Nick Kralevich 8779c4eab4 Merge "Minor cleanups." 2013-12-11 22:46:35 +00:00
Narayan Kamath f5f50b727c am 5d7cd375: am bac8ae4d: am 841ef3bd: am bcf1454c: Merge "Use FileMap from libcutil instead of rolling our own."
* commit '5d7cd375e853aca670d01d92308f178145e0d0e8':
  Use FileMap from libcutil instead of rolling our own.
2013-12-11 21:09:54 +00:00
Narayan Kamath 5d7cd375e8 am bac8ae4d: am 841ef3bd: am bcf1454c: Merge "Use FileMap from libcutil instead of rolling our own."
* commit 'bac8ae4d1de90e4d01f3782465a02e1ef989e030':
  Use FileMap from libcutil instead of rolling our own.
2013-12-11 21:06:37 +00:00
Narayan Kamath bac8ae4d1d am 841ef3bd: am bcf1454c: Merge "Use FileMap from libcutil instead of rolling our own."
* commit '841ef3bd2081a74bf95be83211e92a653df61541':
  Use FileMap from libcutil instead of rolling our own.
2013-12-11 21:02:22 +00:00
Chris Dearman 5299857825 Dwarf backtrace for MIPS
The Dwarf parsing code was copied from backtrace-x86.c
and modified for MIPS

Change-Id: I62c698fbbea28be39320a921dd778269dc478528
2013-12-11 12:50:46 -08:00
Narayan Kamath 841ef3bd20 am bcf1454c: Merge "Use FileMap from libcutil instead of rolling our own."
* commit 'bcf1454cf6a2fadc30c5189c3756b3cb96149745':
  Use FileMap from libcutil instead of rolling our own.
2013-12-11 09:40:03 -08:00
Narayan Kamath bcf1454cf6 Merge "Use FileMap from libcutil instead of rolling our own." 2013-12-11 17:33:58 +00:00
Narayan Kamath eaf988532b Use FileMap from libcutil instead of rolling our own.
Adds windows support as a side effect.

Change-Id: I912c1f980f284d01d4f3936291999646ddf6250a
2013-12-11 15:17:06 +00:00
Sasha Levitskiy 1dd77487ab Merge "Getevent: make sure the monotonic timestamp is displayed; warning cleanup." 2013-12-11 02:43:08 +00:00
Todd Poynor cd7c10438a healthd: charger mode dump previous console from pstore
Change-Id: Id65ffe4f80aa870a1d1f3f3d67c3bb687490c27f
2013-12-10 22:22:43 +00:00
Todd Poynor 4b2a57697d am fc092653: (-s ours) am 0af90f6f: (-s ours) charger: dump pstore ram console DO NOT MERGE
* commit 'fc092653856579437da9807aea2567e90a2ffb09':
  charger: dump pstore ram console DO NOT MERGE
2013-12-10 22:05:21 +00:00
Todd Poynor fc09265385 am 0af90f6f: (-s ours) charger: dump pstore ram console DO NOT MERGE
* commit '0af90f6f750300e54409c251682e86d90401d0ab':
  charger: dump pstore ram console DO NOT MERGE
2013-12-10 22:01:40 +00:00