Date: Fri, 27 Aug 2021 20:52:49 GMT From: Alan Somers <asomers@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: f5c6c43d4c39 - main - Add a regression test for ggatec remote code execution Message-ID: <202108272052.17RKqnrT015544@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f5c6c43d4c3910d5f8d61c0fae4582d863baa066 commit f5c6c43d4c3910d5f8d61c0fae4582d863baa066 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2021-08-27 20:40:05 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2021-08-27 20:52:45 +0000 Add a regression test for ggatec remote code execution Tests that ggatec appropriately handles unsupported BIO operations, rather than overflowing a buffer. Submitted by: Johannes Bruelltuete <johannes@jo-t.de> PR: 213479 Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D31318 --- tests/sys/geom/class/gate/ggate_test.sh | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/sys/geom/class/gate/ggate_test.sh b/tests/sys/geom/class/gate/ggate_test.sh index 7045d7292a75..d19d250215cc 100644 --- a/tests/sys/geom/class/gate/ggate_test.sh +++ b/tests/sys/geom/class/gate/ggate_test.sh @@ -5,6 +5,39 @@ PLAINFILES=plainfiles PORT=33080 CONF=gg.exports +atf_test_case ggatec_trim cleanup +ggatec_trim_head() +{ + atf_set "descr" "ggatec survives a trim" + atf_set "require.progs" "ggatec" + atf_set "require.user" "root" + atf_set "timeout" 60 +} + +ggatec_trim_body() +{ + load_ggate + + us=$(alloc_ggate_dev) + work=$(alloc_md) + atf_check -e ignore -o ignore dd if=/dev/random of=/dev/$work bs=1m count=1 conv=notrunc + echo $CONF >> $PLAINFILES + echo "localhost RW /dev/$work" > $CONF + atf_check ggated -p $PORT -F $PIDFILE $CONF + atf_check ggatec create -p $PORT -u $us localhost /dev/$work + ggate_dev=/dev/ggate${us} + wait_for_ggate_device ${ggate_dev} + + # ggatec only supports read or write. + atf_check -s not-exit:0 -e ignore -o ignore trim -q -f ${ggate_dev} +} + +ggatec_trim_cleanup() +{ + common_cleanup +} + + atf_test_case ggated cleanup ggated_head() { @@ -133,6 +166,7 @@ atf_init_test_cases() atf_add_test_case ggated atf_add_test_case ggatel_file atf_add_test_case ggatel_md + atf_add_test_case ggatec_trim } alloc_ggate_dev()
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108272052.17RKqnrT015544>