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

Issue 891970 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit 29 days ago
Closed: Oct 10
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

security.SELinuxFileLabel test fails due to missing /etc/hosts.d

Project Member Reported by derat@chromium.org, Oct 4

Issue description

The security.SELinuxFileLabel Tast test is failing due to /etc/hosts.d not being present on some DUTs. The test possibly needs to be updated to permit it to not exist:

2018/10/03 00:12:36 Started test security.SELinuxFileLabel
2018/10/03 00:12:36 [00:12:35.744] Error at file_label_utils.go:70: Failed file context check for /etc/hosts.d: failed to get file context: no such file or directory

http://stainless/browse/chromeos-autotest-results/244590777-chromeos-test/

The test panics after this due to a nil pointer dereference:

2018/10/03 00:12:36 [00:12:35.744] Error at test.go:175: Panic: runtime error: invalid memory address or nil pointer dereference
2018/10/03 00:12:36 [00:12:35.744] Stack trace:
chromiumos/tast/testing.runAndRecover.func1(0xc420312a50)
	/build/asuka/tmp/portage/chromeos-base/tast-local-tests-cros-0.0.1-r199/work/tast-local-tests-cros-0.0.1/tast-base/src/chromiumos/tast/testing/test.go:175 +0xa3
panic(0x6506398aef00, 0x650639bf4be0)
	/usr/lib/go/x86_64-cros-linux-gnu/src/runtime/panic.go:502 +0x22d
chromiumos/tast/local/bundles/cros/security/selinux.CheckContext(0xc420312a50, 0x65063971c3b4, 0xc, 0x65063973168a, 0x24, 0x1, 0x650639972438)
	/build/asuka/tmp/portage/chromeos-base/tast-local-tests-cros-0.0.1-r199/work/tast-local-tests-cros-0.0.1/src/chromiumos/tast/local/bundles/cros/security/selinux/file_label_utils.go:74 +0xd7
chromiumos/tast/local/bundles/cros/security.SELinuxFileLabel(0x65063997f260, 0xc4201c8cc0, 0xc420312a50)
	/build/asuka/tmp/portage/chromeos-base/tast-local-tests-cros-0.0.1-r199/work/tast-local-tests-cros-0.0.1/src/chromiumos/tast/local/bundles/cros/security/selinux_file_label.go:142 +0x5b3

The fix for the panic seems trivial; I'll upload a one-line change.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/93f7c301ac41fe72b8428362af2e0bf3c5fc9fa0

commit 93f7c301ac41fe72b8428362af2e0bf3c5fc9fa0
Author: Daniel Erat <derat@chromium.org>
Date: Fri Oct 05 18:37:37 2018

tast-tests: Fix panic in selinux.CheckContext.

Avoid a panic caused by a nil pointer dereference in
the selinux.CheckContext function.

Also rename the go-selinux import to "selinux" as preferred
by goimports.

BUG= chromium:891970 
TEST=verified that test no longer panics when it encounters
     a missing directory that it's supposed to descend

Change-Id: Ia93f31c6b6cfcd09f7c3308708557e6a42a67244
Reviewed-on: https://chromium-review.googlesource.com/1260061
Commit-Ready: Shuhei Takahashi <nya@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Shuhei Takahashi <nya@chromium.org>

[modify] https://crrev.com/93f7c301ac41fe72b8428362af2e0bf3c5fc9fa0/src/chromiumos/tast/local/bundles/cros/security/selinux/file_label_utils.go

Project Member

Comment 2 by bugdroid1@chromium.org, Oct 10

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/15cd0118d5a24bf85a01bac51b93fbd4f6f5d518

commit 15cd0118d5a24bf85a01bac51b93fbd4f6f5d518
Author: Qijiang Fan <fqj@chromium.org>
Date: Wed Oct 10 04:14:27 2018

tast-tests: skip /etc/hosts.d if not found.

Also removes skipNotExists for /etc/hosts since it's a mistake.

BUG=b:114172200, chromium:891970 
CQ-DEPEND=CL:1267776
TEST=tast run

Change-Id: If05c96168c5beaaa91edb0f2f375b0e5bdf38c81
Reviewed-on: https://chromium-review.googlesource.com/1270417
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Qijiang Fan <fqj@google.com>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Shuhei Takahashi <nya@chromium.org>

[modify] https://crrev.com/15cd0118d5a24bf85a01bac51b93fbd4f6f5d518/src/chromiumos/tast/local/bundles/cros/security/selinux_file_label.go

Status: Fixed (was: Assigned)
Should be fixed in 11144

Sign in to add a comment