diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-12-03 16:56:13 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-12-03 18:48:14 +0100 |
| commit | dfe2e9d84a64066fd15913c7cd02d1853adf3942 (patch) | |
| tree | 73a986f1ed2b0a184126fd4c4cc7d45d6dc40672 /sys/linux/init_test.go | |
| parent | 799e6ffbbe35cd75b780d3dcbbeb7d13ebe1fb24 (diff) | |
sys/linux: enforce arguments of all syz_open_dev calls
Opening random devices can lead to havoc.
Enforce device major/minor.
Diffstat (limited to 'sys/linux/init_test.go')
| -rw-r--r-- | sys/linux/init_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
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) { |
