diff options
| author | Takashi Iwai <tiwai@suse.de> | 2021-01-26 09:51:48 +0300 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2021-01-26 09:51:48 +0300 |
| commit | 4f2da3324eaff382ab1c6aaef8c10180b2f4d08c (patch) | |
| tree | 38dab378ba4ad014d83151f020cc1e5979be0d6d /fs/select.c | |
| parent | 6755568ad111394da224c823e8baf31a05a1469c (diff) | |
| parent | 30e88d017fcbeb50c4b07577fe059558361067e7 (diff) | |
| download | linux-4f2da3324eaff382ab1c6aaef8c10180b2f4d08c.tar.xz | |
Merge tag 'tags/isa-void-remove-callback' into for-next
isa: Make the remove callback for isa drivers return void
Link: https://lore.kernel.org/r/20210122092449.426097-1-uwe@kleine-koenig.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'fs/select.c')
| -rw-r--r-- | fs/select.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/select.c b/fs/select.c index ebfebdfe5c69..37aaa8317f3a 100644 --- a/fs/select.c +++ b/fs/select.c @@ -1011,14 +1011,17 @@ static int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, fdcount = do_poll(head, &table, end_time); poll_freewait(&table); + if (!user_write_access_begin(ufds, nfds * sizeof(*ufds))) + goto out_fds; + for (walk = head; walk; walk = walk->next) { struct pollfd *fds = walk->entries; int j; - for (j = 0; j < walk->len; j++, ufds++) - if (__put_user(fds[j].revents, &ufds->revents)) - goto out_fds; + for (j = walk->len; j; fds++, ufds++, j--) + unsafe_put_user(fds->revents, &ufds->revents, Efault); } + user_write_access_end(); err = fdcount; out_fds: @@ -1030,6 +1033,11 @@ out_fds: } return err; + +Efault: + user_write_access_end(); + err = -EFAULT; + goto out_fds; } static long do_restart_poll(struct restart_block *restart_block) |
