New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 878862 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Sep 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

shill misaligned reference binding in mIcmpTest.ComputeIcmpChecksum

Project Member Reported by manojgupta@chromium.org, Aug 29

Issue description

With ubsan enabled, shill is blowing up with this error in my local builds:

* ASAN error detected:
 * ../../../../../../../tmp/portage/chromeos-base/shill-0.0.3-r1460/work/shill-0.0.3/aosp/system/connectivity/shill/icmp_unittest.cc:213:3: runtime error: reference binding to misaligned address 0x55f46f0c1ace for type 'const struct icmphdr', which requires 4 byte alignment
 * 0x55f46f0c1ace: note: pointer points here
 *  00 00 4a ae 08 00  00 00 ac 51 00 00 00 00  01 00 00 00 00 00 00 00  4e 35 73 68 69 6c 6c 32  35 49
 *              ^
 *     #0 0x55f46d0357ff in shill::IcmpTest_ComputeIcmpChecksum_Test::TestBody() /build/amd64-generic/var/cache/portage/chromeos-base/shill/out/Default/../../../../../../../tmp/portage/chromeos-base/shill-0.0.3-r1460/work/shill-0.0.3/aosp/system/connectivity/shill/icmp_unittest.cc:213:3
 *     #1 0x7f5016d48299 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2402:10
 *     #2 0x7f5016d48299 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2438:0
 *     #3 0x7f5016d0ea78 in testing::Test::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2474:5
 *     #4 0x7f5016d112da in testing::TestInfo::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2656:11
 *     #5 0x7f5016d1281c in testing::TestCase::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2774:28
 *     #6 0x7f5016d23a4d in testing::internal::UnitTestImpl::RunAllTests() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:4649:43
 *     #7 0x7f5016d4aa29 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2402:10
 *     #8 0x7f5016d4aa29 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2438:0
 *     #9 0x7f5016d232a7 in testing::UnitTest::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:4257:10
 *     #10 0x55f46dad671b in RUN_ALL_TESTS() /build/amd64-generic/var/cache/portage/chromeos-base/shill/out/Default/../../../../../../../usr/include/gtest/gtest.h:2233:46
 *     #11 0x55f46dad671b in main /build/amd64-generic/var/cache/portage/chromeos-base/shill/out/Default/../../../../../../../tmp/portage/chromeos-base/shill-0.0.3-r1460/work/shill-0.0.3/aosp/system/connectivity/shill/testrunner.cc:51:0
 *     #12 0x7f5014e20735 in __libc_start_main /var/tmp/portage/cross-x86_64-cros-linux-gnu/glibc-2.23-r18/work/glibc-2.23/csu/../csu/libc-start.c:289:0
 *     #13 0x55f46c93c978 in _start ??:0:0

 
Cc: ejcaruso@chromium.org briannorris@chromium.org benchan@chromium.org abhishekbh@chromium.org kirtika@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Sep 1

The following revision refers to this bug:
  https://chromium.googlesource.com/aosp/platform/system/connectivity/shill/+/b37c8dbf46ceed78f480ac02dfdb051a4355406f

commit b37c8dbf46ceed78f480ac02dfdb051a4355406f
Author: Manoj Gupta <manojgupta@google.com>
Date: Sat Sep 01 17:40:01 2018

shill: Fix an alignment error reported by ubsan.

Fix an misaligned reference binding caught by turning on ubsan in
Chrome OS.

Fortunately, the error is in the unit test only.

Root cause is kIcmpEchoRequestOddLen is cast to struct icmphdr but
it doesn't match the alignment needed by struct icmphdr.

aosp/system/connectivity/shill/icmp_unittest.cc:213:3: runtime error:
 reference binding to misaligned address 0x55f46f0c1ace for
type 'const struct icmphdr', which requires 4 byte alignment
 * 0x55f46f0c1ace: note: pointer points here
 *  00 00 4a ae 08 00  00 00 ac 51 00 00 00 00  01 00 00 00 00 00 00 00  4e 35 73 68 69 6c 6c 32  35 49
 *              ^
 *     #0 0x55f46d0357ff in shill::IcmpTest_ComputeIcmpChecksum_Test::TestBody()
shill-0.0.3/aosp/system/connectivity/shill/icmp_unittest.cc:213:3

BUG= chromium:878862 
BUG= chromium:875971 

Change-Id: Id15b7f169668b9978520a5fdcfa0df91d4c2d5c6
Reviewed-on: https://chromium-review.googlesource.com/1195583
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>

[modify] https://crrev.com/b37c8dbf46ceed78f480ac02dfdb051a4355406f/icmp_test.cc

Status: Verified (was: Started)
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/d9f229fffcb7a3ec34e906362d0c6af711abccfe

commit d9f229fffcb7a3ec34e906362d0c6af711abccfe
Author: Manoj Gupta <manojgupta@google.com>
Date: Wed Oct 03 20:59:16 2018

shill: Fix an alignment error.

Fix an misaligned reference binding caught by ubsan.
This should have been fixed in CL:1195583 but I somehow missed it.

Root cause is kIcmpEchoRequestEvenLen is cast to struct icmphdr but
it doesn't match the alignment needed by struct icmphdr.

shill-0.0.3-r1497:  * ASAN error detected:
shill-0.0.3-r1497:  * ../../../../../../../../../mnt/host/source/src/platform2/shill/icmp_test.cc:199:3:
runtime error: reference binding to
misaligned address 0x7ffb065f8cf6 for type 'const struct icmphdr', which requires 4 byte alignment
shill-0.0.3-r1497:  * 0x7ffb065f8cf6: note: pointer points here
shill-0.0.3-r1497:  *  00 00 86 af 08 00  00 00 71 50 00 00 00 00  ff ff 00 00 27 63 6f 6e  73 74 20 73 74 72 75 63  74 20

BUG= chromium:878862 
TEST=shill unit test passes.

Change-Id: Ie8ee9fcac586dd58163b2000c20aa4c5a161b358
Reviewed-on: https://chromium-review.googlesource.com/1258412
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>

[modify] https://crrev.com/d9f229fffcb7a3ec34e906362d0c6af711abccfe/shill/icmp_test.cc

Sign in to add a comment