From fa6c7b708014d8f73262837982e368f8d1f617b5 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 8 Feb 2019 16:15:09 +0100 Subject: sys/linux: prohibit opening /proc/self/exe Fuzzer manages to open it and do bad things with it. Prevent it from doing so. --- sys/linux/init_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'sys/linux/init_test.go') diff --git a/sys/linux/init_test.go b/sys/linux/init_test.go index 45b6397f8..7e4753115 100644 --- a/sys/linux/init_test.go +++ b/sys/linux/init_test.go @@ -136,6 +136,22 @@ exit_group(0x1) exit_group(0x1) `, }, + { + ` +syz_open_procfs(0x0, &(0x7f0000000000)='io') +syz_open_procfs(0x0, &(0x7f0000000000)='exe') +syz_open_procfs(0x0, &(0x7f0000000000)='exe\x00') +syz_open_procfs(0x0, &(0x7f0000000000)='/exe') +syz_open_procfs(0x0, &(0x7f0000000000)='./exe\x00') +`, + ` +syz_open_procfs(0x0, &(0x7f0000000000)='io') +syz_open_procfs(0x0, &(0x7f0000000000)='net\x00') +syz_open_procfs(0x0, &(0x7f0000000000)='net\x00') +syz_open_procfs(0x0, &(0x7f0000000000)='net\x00') +syz_open_procfs(0x0, &(0x7f0000000000)='net\x00') + `, + }, } for i, test := range tests { t.Run(fmt.Sprint(i), func(t *testing.T) { -- cgit mrf-deployment