Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 4 Aug 2019 00:33:16 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [RFC] final time64 switch-over patch series

On Fri, Aug 02, 2019 at 05:44:33PM -0400, Rich Felker wrote:
> diff --git a/compat/time32/ppoll_time32.c b/compat/time32/ppoll_time32.c
> new file mode 100644
> index 00000000..d1eef134
> --- /dev/null
> +++ b/compat/time32/ppoll_time32.c
> @@ -0,0 +1,10 @@
> +#include "time32.h"
> +#define _GNU_SOURCE
> +#include <time.h>
> +#include <poll.h>
> +
> +int __ppoll_time32(struct pollfd *fds, nfds_t n, const struct timespec32 *ts32, const sigset_t *mask)
> +{
> +	return ppoll(fds, n, (&(struct timespec){
> +		.tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}), mask);
> +}
> diff --git a/compat/time32/pselect_time32.c b/compat/time32/pselect_time32.c
> new file mode 100644
> index 00000000..5b358c73
> --- /dev/null
> +++ b/compat/time32/pselect_time32.c
> @@ -0,0 +1,9 @@
> +#include "time32.h"
> +#include <time.h>
> +#include <sys/select.h>
> +
> +int __pselect_time32(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, const struct timespec32 *restrict ts32, const sigset_t *restrict mask)
> +{
> +	return pselect(n, rfds, wfds, efds, (&(struct timespec){
> +		.tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}), mask);
> +}
> diff --git a/compat/time32/select_time32.c b/compat/time32/select_time32.c
> new file mode 100644
> index 00000000..2bd76e33
> --- /dev/null
> +++ b/compat/time32/select_time32.c
> @@ -0,0 +1,10 @@
> +#include "time32.h"
> +#include <time.h>
> +#include <sys/time.h>
> +#include <sys/select.h>
> +
> +int __select_time32(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, struct timeval32 *restrict tv32)
> +{
> +	return select(n, rfds, wfds, efds, (&(struct timeval){
> +		.tv_sec = tv32->tv_sec, .tv_usec = tv32->tv_usec}));
> +}

These all fail to check the timeout argument is non-null before
accessing it; caught in testing against Adelie and Alpine i386.

There may be other functions with the same problem; need to review
them all for this.

Rich

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.