mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [RFC] final time64 switch-over patch series
Date: Sun, 4 Aug 2019 00:33:16 -0400	[thread overview]
Message-ID: <20190804043316.GM9017@brightrain.aerifal.cx> (raw)
In-Reply-To: <20190802214433.GA25193@brightrain.aerifal.cx>

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


  parent reply	other threads:[~2019-08-04  4:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02 21:44 Rich Felker
2019-08-04  4:31 ` Rich Felker
2019-08-09 16:30   ` Rich Felker
2019-08-09 17:00     ` Rich Felker
2019-08-04  4:33 ` Rich Felker [this message]
2019-08-04 18:11   ` Rich Felker
2019-08-09 14:48 ` Rich Felker
2019-08-14 23:55 ` Rich Felker
2019-08-15  0:13   ` Rich Felker
2019-08-15  0:30     ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190804043316.GM9017@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).