From dfe2e9d84a64066fd15913c7cd02d1853adf3942 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 3 Dec 2019 16:56:13 +0100 Subject: sys/linux: enforce arguments of all syz_open_dev calls Opening random devices can lead to havoc. Enforce device major/minor. --- sys/linux/init_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sys/linux/init_test.go') diff --git a/sys/linux/init_test.go b/sys/linux/init_test.go index 7e4753115..4358bef35 100644 --- a/sys/linux/init_test.go +++ b/sys/linux/init_test.go @@ -152,6 +152,19 @@ syz_open_procfs(0x0, &(0x7f0000000000)='net\x00') syz_open_procfs(0x0, &(0x7f0000000000)='net\x00') `, }, + + { + ` +syz_open_dev$tty1(0xc, 0x4, 0x4) +syz_open_dev$tty1(0xb, 0x2, 0x4) +syz_open_dev$tty1(0xc, 0x4, 0x5) +`, + ` +syz_open_dev$tty1(0xc, 0x4, 0x4) +syz_open_dev$tty1(0xc, 0x4, 0x4) +syz_open_dev$tty1(0xc, 0x4, 0x1) + `, + }, } for i, test := range tests { t.Run(fmt.Sprint(i), func(t *testing.T) { -- cgit mrf-deployment