Merge ~fginther/+git/overlay-shiftfs-tests:fginther/shiftfs-hung-error-out into ~canonical-kernel-team/+git/overlay-shiftfs-tests:main

Proposed by Francis Ginther
Status: Merged
Merge reported by: Po-Hsu Lin
Merged at revision: a53620f9219373277084cb09f82a7907cedee5c1
Proposed branch: ~fginther/+git/overlay-shiftfs-tests:fginther/shiftfs-hung-error-out
Merge into: ~canonical-kernel-team/+git/overlay-shiftfs-tests:main
Diff against target: 19 lines (+2/-2)
1 file modified
tests/shiftfs-hung.sh (+2/-2)
Reviewer Review Type Date Requested Status
Po-Hsu Lin Approve
Review via email: mp+448284@code.launchpad.net

Commit message

tests/shiftfs-hung.sh: Exit on errors

The shiftfs-hung.sh test was not set to exit on errors. This caused an
incorrect pass on kernels which did not have shiftfs available.

Signed-off-by: Francis Ginther <email address hidden>

Description of the change

The shiftfs-hung.sh test does not fail as it should on kernels without the shiftfs module. With the `-e`, this test will silently pass. After this update, it will now output an error message and return an error code:

$ ./shiftfs-hung.sh
mount: /tmp/d2: unknown filesystem type 'shiftfs'.
$ echo $?
32

To post a comment you must log in.
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

LGTM.
Thanks!

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Applied and pushed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/shiftfs-hung.sh b/tests/shiftfs-hung.sh
2index fb41e15..8581a8e 100755
3--- a/tests/shiftfs-hung.sh
4+++ b/tests/shiftfs-hung.sh
5@@ -1,4 +1,4 @@
6-#!/bin/bash
7+#!/bin/bash -e
8 #
9 # CVE-2023-2612
10 # Trigger potential hung task timeout with shiftfs (locking unbalance)
11@@ -8,7 +8,7 @@
12 # Check that this kernel supports shiftfs before running test
13 check_shiftfs_compatible
14
15-unshare -U -r -i -m /bin/bash 2>/dev/null << EOF
16+unshare -U -r -i -m /bin/bash -e << EOF
17 cd /tmp/
18 mkdir d1 d2
19 mount -t mqueue none d1

Subscribers

People subscribed via source and target branches