Commit 8e3c9f9
selftests/seccomp: user_notification_addfd check nextfd is available
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>1 parent 471dbc5 commit 8e3c9f9
1 file changed
Lines changed: 19 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4044 | 4044 | | |
4045 | 4045 | | |
4046 | 4046 | | |
| 4047 | + | |
| 4048 | + | |
| 4049 | + | |
| 4050 | + | |
| 4051 | + | |
| 4052 | + | |
| 4053 | + | |
| 4054 | + | |
| 4055 | + | |
| 4056 | + | |
4047 | 4057 | | |
4048 | 4058 | | |
4049 | 4059 | | |
| |||
4060 | 4070 | | |
4061 | 4071 | | |
4062 | 4072 | | |
4063 | | - | |
| 4073 | + | |
4064 | 4074 | | |
4065 | 4075 | | |
4066 | 4076 | | |
| |||
4071 | 4081 | | |
4072 | 4082 | | |
4073 | 4083 | | |
4074 | | - | |
| 4084 | + | |
| 4085 | + | |
4075 | 4086 | | |
4076 | 4087 | | |
4077 | 4088 | | |
| |||
4126 | 4137 | | |
4127 | 4138 | | |
4128 | 4139 | | |
4129 | | - | |
| 4140 | + | |
| 4141 | + | |
4130 | 4142 | | |
4131 | 4143 | | |
4132 | 4144 | | |
4133 | 4145 | | |
4134 | 4146 | | |
4135 | 4147 | | |
4136 | | - | |
| 4148 | + | |
| 4149 | + | |
4137 | 4150 | | |
4138 | 4151 | | |
4139 | 4152 | | |
| |||
4171 | 4184 | | |
4172 | 4185 | | |
4173 | 4186 | | |
4174 | | - | |
| 4187 | + | |
| 4188 | + | |
4175 | 4189 | | |
4176 | 4190 | | |
4177 | 4191 | | |
| |||
0 commit comments