From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: Xiaoming Ni <nixiaoming@huawei.com>,
drepper@redhat.com, lukma@denx.de, adrian.ratiu@collabora.com,
schwab@linux-m68k.org, fweimer@redhat.com,
adhemerval.zanella@linaro.org
Cc: libc-alpha@sourceware.org, wangle6@huawei.com
Subject: Re: [PATCH 1/4] adjtimex/adjtimex64: Use __nonnull to avoid null pointer
Date: Wed, 4 May 2022 16:26:50 +0530 [thread overview]
Message-ID: <57479b3f-5ab5-693e-4a3f-c689875c1d6f@gotplt.org> (raw)
In-Reply-To: <20220428122529.108208-2-nixiaoming@huawei.com>
On 28/04/2022 17:55, Xiaoming Ni via Libc-alpha wrote:
> Add __nonnull((1)) to the adjtimex()/adjtimex64() function declaration
> to avoid null pointer access.
>
> Link: https://sourceware.org/bugzilla/show_bug.cgi?id=27662
> Link: https://sourceware.org/bugzilla/show_bug.cgi?id=29084
> Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
> ---
LGTM.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
> sysdeps/unix/sysv/linux/include/sys/timex.h | 4 ++--
> sysdeps/unix/sysv/linux/sys/timex.h | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h b/sysdeps/unix/sysv/linux/include/sys/timex.h
> index 964a2c21f2..dd599b1c32 100644
> --- a/sysdeps/unix/sysv/linux/include/sys/timex.h
> +++ b/sysdeps/unix/sysv/linux/include/sys/timex.h
> @@ -23,7 +23,7 @@
>
> # ifndef _ISOMAC
>
> -extern int __adjtimex (struct timex *__ntx);
> +extern int __adjtimex (struct timex *__ntx) __nonnull ((1));
> libc_hidden_proto (__adjtimex)
>
> # include <time.h>
> @@ -79,7 +79,7 @@ struct __timex64
> };
> extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64);
> libc_hidden_proto (__clock_adjtime64);
> -extern int ___adjtimex64 (struct __timex64 *tx64);
> +extern int ___adjtimex64 (struct __timex64 *tx64) __nonnull ((1));
> libc_hidden_proto (___adjtimex64)
>
> struct __ntptimeval64
> diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h
> index 60d94814e8..430e47509d 100644
> --- a/sysdeps/unix/sysv/linux/sys/timex.h
> +++ b/sysdeps/unix/sysv/linux/sys/timex.h
> @@ -55,7 +55,7 @@ struct ntptimeval
> __BEGIN_DECLS
>
> #ifndef __USE_TIME_BITS64
> -extern int adjtimex (struct timex *__ntx) __THROW;
> +extern int adjtimex (struct timex *__ntx) __THROW __nonnull ((1));
> extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
>
> # ifdef __REDIRECT_NTH
> @@ -68,7 +68,7 @@ extern int ntp_adjtime (struct timex *__tntx) __THROW;
> #else
> # ifdef __REDIRECT_NTH
> extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx),
> - ___adjtimex64);
> + ___adjtimex64) __nonnull ((1));
> extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
> __ntp_gettime64);
> extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv),
next prev parent reply other threads:[~2022-05-04 10:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-28 12:25 [PATCH 0/4] time: " Xiaoming Ni
2022-04-28 12:25 ` [PATCH 1/4] adjtimex/adjtimex64: " Xiaoming Ni
2022-05-04 10:56 ` Siddhesh Poyarekar [this message]
2022-04-28 12:25 ` [PATCH 2/4] ntp_xxxtimex: " Xiaoming Ni
2022-05-04 10:59 ` Siddhesh Poyarekar
2022-04-28 12:25 ` [PATCH 3/4] clock_adjtime: " Xiaoming Ni
2022-05-04 11:00 ` Siddhesh Poyarekar
2022-04-28 12:25 ` [PATCH 4/4] clock_settime/clock_gettime: " Xiaoming Ni
2022-05-04 11:02 ` Siddhesh Poyarekar
2022-05-05 1:39 ` Xiaoming Ni
2022-05-05 3:01 ` [PATCH v2 0/4] time: " Xiaoming Ni
2022-05-05 3:01 ` [PATCH v2 1/4] adjtimex/adjtimex64: " Xiaoming Ni
2022-05-05 3:01 ` [PATCH v2 2/4] ntp_xxxtimex: " Xiaoming Ni
2022-05-05 3:01 ` [PATCH v2 3/4] clock_adjtime: " Xiaoming Ni
2022-05-05 3:01 ` [PATCH v2 4/4] clock_settime/clock_gettime: " Xiaoming Ni
2022-05-05 4:26 ` Siddhesh Poyarekar
2022-05-05 8:23 ` Xiaoming Ni
2022-05-05 12:26 ` Siddhesh Poyarekar
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=57479b3f-5ab5-693e-4a3f-c689875c1d6f@gotplt.org \
--to=siddhesh@gotplt.org \
--cc=adhemerval.zanella@linaro.org \
--cc=adrian.ratiu@collabora.com \
--cc=drepper@redhat.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=lukma@denx.de \
--cc=nixiaoming@huawei.com \
--cc=schwab@linux-m68k.org \
--cc=wangle6@huawei.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).