Commit 8b7423a
selftests/seccomp: user_notification_addfd check nextfd is available
commit 8e3c9f9 upstream.
Currently the user_notification_addfd test checks what the next expected
file descriptor will be by incrementing a variable nextfd. This does not
account for file descriptors that may already be open before the test is
started and will cause the test to fail if any exist.
Replace nextfd++ with a function get_next_fd which will check and return
the next available file descriptor.
Signed-off-by: Terry Tritton <terry.tritton@linaro.org>
Link: https://lore.kernel.org/r/20240124141357.1243457-4-terry.tritton@linaro.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent f34d6b7 commit 8b7423a
1 file changed
+19
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4037 | 4037 | | |
4038 | 4038 | | |
4039 | 4039 | | |
| 4040 | + | |
| 4041 | + | |
| 4042 | + | |
| 4043 | + | |
| 4044 | + | |
| 4045 | + | |
| 4046 | + | |
| 4047 | + | |
| 4048 | + | |
| 4049 | + | |
4040 | 4050 | | |
4041 | 4051 | | |
4042 | 4052 | | |
| |||
4053 | 4063 | | |
4054 | 4064 | | |
4055 | 4065 | | |
4056 | | - | |
| 4066 | + | |
4057 | 4067 | | |
4058 | 4068 | | |
4059 | 4069 | | |
| |||
4064 | 4074 | | |
4065 | 4075 | | |
4066 | 4076 | | |
4067 | | - | |
| 4077 | + | |
| 4078 | + | |
4068 | 4079 | | |
4069 | 4080 | | |
4070 | 4081 | | |
| |||
4119 | 4130 | | |
4120 | 4131 | | |
4121 | 4132 | | |
4122 | | - | |
| 4133 | + | |
| 4134 | + | |
4123 | 4135 | | |
4124 | 4136 | | |
4125 | 4137 | | |
4126 | 4138 | | |
4127 | 4139 | | |
4128 | 4140 | | |
4129 | | - | |
| 4141 | + | |
| 4142 | + | |
4130 | 4143 | | |
4131 | 4144 | | |
4132 | 4145 | | |
| |||
4164 | 4177 | | |
4165 | 4178 | | |
4166 | 4179 | | |
4167 | | - | |
| 4180 | + | |
| 4181 | + | |
4168 | 4182 | | |
4169 | 4183 | | |
4170 | 4184 | | |
| |||
0 commit comments