New issue
Advanced search Search tips

Issue 875971 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Aug 28
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug
Build-Toolchain

Blocked on:
issue 876830



Sign in to add a comment

Start testing ubsan in Chrome OS builds

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

Issue description

We current test asan in Chrome OS builds (limited packages).

Should add ubsan as well to improve Chrome OS quality and pre-emptively find bugs.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 20

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

commit a6b00968f69daea2e656257e062be27ec33c357c
Author: Manoj Gupta <manojgupta@google.com>
Date: Mon Aug 20 20:28:43 2018

chromeos_config: Start testing ubsan builds.

We want to start testing ubsan in Chrome OS in addition
to asan testing we have right now.

BUG= chromium:875971 
TEST=chromite unit tests pass.

Change-Id: I3a47a49bbf536396c87d921c9cc8c869c10c23de
Reviewed-on: https://chromium-review.googlesource.com/1182121
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>

[modify] https://crrev.com/a6b00968f69daea2e656257e062be27ec33c357c/config/chromeos_config.py
[modify] https://crrev.com/a6b00968f69daea2e656257e062be27ec33c357c/config/waterfall_layout_dump.txt
[modify] https://crrev.com/a6b00968f69daea2e656257e062be27ec33c357c/config/config_dump.json
[modify] https://crrev.com/a6b00968f69daea2e656257e062be27ec33c357c/config/luci-scheduler.cfg

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/2ffcdb5634a3c4910165b30d689a950324d0217a

commit 2ffcdb5634a3c4910165b30d689a950324d0217a
Author: Manoj Gupta <manojgupta@google.com>
Date: Tue Aug 21 08:35:31 2018

Migrate packages to use sanitizers-setup-env.

Call sanitizers-setup-env instead of asan-setup-env.
This will let us test more packages with ubsan/msan etc.

BUG= chromium:875971 
BUG=chromium:874179
TEST=packages still build wth USE=asan

Change-Id: I2fcfecbcb900ba0d335a0c25e2343fb36f36c654
Reviewed-on: https://chromium-review.googlesource.com/1181945
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>

[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/libscrypt/libscrypt-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/mttools/mttools-9999.ebuild
[rename] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/net-libs/librmnetctl/librmnetctl-1.0_p20180801-r2.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/dev-util/turbostat/turbostat-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/factory_installer/factory_installer-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/media-libs/libmtp/libmtp-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/dev-python/btsocket/btsocket-9999.ebuild
[rename] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/minijail/minijail-1-r20.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/dev-libs/dbus-c++/dbus-c++-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/tpm/tpm-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/net-misc/tlsdate/tlsdate-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/sys-apps/frecon/frecon-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/sys-apps/rootdev/rootdev-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/autotest-deps-glmark2/autotest-deps-glmark2-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/avtest_label_detect/avtest_label_detect-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/sys-apps/bootcache/bootcache-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/media-sound/adhd/adhd-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/gestures/gestures-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/app-crypt/trousers/trousers-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/net-misc/modemmanager-next/modemmanager-next-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/net-libs/libqmi/libqmi-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/gobi3k-sdk/gobi3k-sdk-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/sys-apps/frecon-lite/frecon-lite-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/net-wireless/gdmwimax/gdmwimax-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/net-wireless/bluez/bluez-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/net-libs/libmbim/libmbim-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/minijail/minijail-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/media-libs/minigbm/minigbm-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/media-libs/arc-camera-service/arc-camera-service-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/net-libs/libqrtr/libqrtr-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/smogcheck/smogcheck-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/touch_firmware_test/touch_firmware_test-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/audiotest/audiotest-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/chromeos-base/libevdev/libevdev-9999.ebuild
[modify] https://crrev.com/2ffcdb5634a3c4910165b30d689a950324d0217a/net-libs/librmnetctl/librmnetctl-1.0_p20180801.ebuild

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/6e91daef23607d39f3fe656831ad28c95447efcd

commit 6e91daef23607d39f3fe656831ad28c95447efcd
Author: Manoj Gupta <manojgupta@google.com>
Date: Tue Aug 21 08:35:57 2018

cros-sanitizers: Update ubsan flags.

Disable testing vptr behavior with ubsan since many packages
don't build.
Also update filter_sanitizers to filter compiler options
starting with "-fno-sanitize".

Also modify *SAN_OPTIONS to use stderr log path.

BUG= chromium:875971 
BUG=chromium:874179
TEST=packages build without USE=ubsan

Change-Id: I720201d3ca15a7d536fcd5fe4a21ed88580e7bfc
Reviewed-on: https://chromium-review.googlesource.com/1181938
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>

[modify] https://crrev.com/6e91daef23607d39f3fe656831ad28c95447efcd/profiles/base/profile.bashrc
[modify] https://crrev.com/6e91daef23607d39f3fe656831ad28c95447efcd/eclass/cros-sanitizers.eclass

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 21

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

commit dd0fe897461589844c9313444c6ee8d74a5fdf6f
Author: Manoj Gupta <manojgupta@google.com>
Date: Tue Aug 21 08:36:04 2018

common-mk: Update ubsan flags.

Disable vptr sanitization in ubsan.
This matches Chromium and ubsan-setup-env in CL:1181938.

BUG= chromium:875971 
BUG=chromium:874179
TEST=packages build without USE=ubsan

Change-Id: I660e454c970e910b1b4e8f9762300b6243ae7d33
Reviewed-on: https://chromium-review.googlesource.com/1182503
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/dd0fe897461589844c9313444c6ee8d74a5fdf6f/common-mk/common_fuzzer.gypi

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 21

Labels: cros-fuzzing
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 22

Project Member

Comment 8 by bugdroid1@chromium.org, Aug 22

Blockedon: 876830
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 23

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/b5435ef179f25b2cea9efb4b678cef6c895461d3

commit b5435ef179f25b2cea9efb4b678cef6c895461d3
Author: Manoj Gupta <manojgupta@google.com>
Date: Thu Aug 23 14:37:09 2018

amd64-generic: Drop use of -fsanitize=function fom ubsan.

Match the ubsan flags used in CL:1185881.

BUG= chromium:875971 
TEST=ubsan builds still work.

Change-Id: I70f5832a72bcbaedd8b37d46d0091e1b9f3bdf9d
Reviewed-on: https://chromium-review.googlesource.com/1185884
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Jonathan Metzman <metzman@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/b5435ef179f25b2cea9efb4b678cef6c895461d3/overlay-amd64-generic/profiles/ubsan-fuzzer/make.defaults

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 23

Project Member

Comment 12 by bugdroid1@chromium.org, Aug 23

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/23eb40e8c10d2fd71f623e900d2ae08e898c46cb

commit 23eb40e8c10d2fd71f623e900d2ae08e898c46cb
Author: Manoj Gupta <manojgupta@google.com>
Date: Thu Aug 23 20:20:40 2018

cros-sanitizers: Drop -fsanitize=function from ubsan

This is causing fails in libbrillo because of use of callback
functionality from libbase. May re-enable later on if deemed important.

BUG= chromium:875971 
TEST=libbrillo unit tests pass.

Change-Id: Ie6244823f8dc4d17106fc20053327e2c146730fe
Reviewed-on: https://chromium-review.googlesource.com/1185881
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Jonathan Metzman <metzman@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/23eb40e8c10d2fd71f623e900d2ae08e898c46cb/eclass/cros-sanitizers.eclass

Status: Verified (was: Untriaged)
Ubsan builder is running and found a few bugs already.

https://cros-goldeneye.corp.google.com/chromeos/legoland/builderHistory?buildConfig=amd64-generic-ubsan&buildBranch=master
Project Member

Comment 14 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

Sign in to add a comment