From: Xiaoming Ni <nixiaoming@huawei.com>
To: <drepper@redhat.com>, <lukma@denx.de>,
<adrian.ratiu@collabora.com>, <schwab@linux-m68k.org>,
<fweimer@redhat.com>, <adhemerval.zanella@linaro.org>
Cc: <nixiaoming@huawei.com>, <wangle6@huawei.com>,
<libc-alpha@sourceware.org>
Subject: [PATCH 3/4] clock_adjtime: Use __nonnull to avoid null pointer
Date: Thu, 28 Apr 2022 20:25:28 +0800 [thread overview]
Message-ID: <20220428122529.108208-4-nixiaoming@huawei.com> (raw)
In-Reply-To: <20220428122529.108208-1-nixiaoming@huawei.com>
clock_adjtime()/clock_adjtime64()
Add __nonnull((2)) 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>
---
sysdeps/unix/sysv/linux/bits/time.h | 4 ++--
sysdeps/unix/sysv/linux/include/sys/timex.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h
index efb4a014df..0485a1e181 100644
--- a/sysdeps/unix/sysv/linux/bits/time.h
+++ b/sysdeps/unix/sysv/linux/bits/time.h
@@ -75,13 +75,13 @@ extern long int __sysconf (int);
__BEGIN_DECLS
/* Tune a POSIX clock. */
-extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW;
+extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW __nonnull((2));
#ifdef __USE_TIME_BITS64
# if defined(__REDIRECT_NTH)
extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id,
struct timex *__utx),
- __clock_adjtime64);
+ __clock_adjtime64) __nonnull((2));
# else
# define clock_adjtime __clock_adjtime64
# endif
diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h b/sysdeps/unix/sysv/linux/include/sys/timex.h
index 9d0da60640..0c0261a06d 100644
--- a/sysdeps/unix/sysv/linux/include/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/include/sys/timex.h
@@ -77,7 +77,7 @@ struct __timex64
int :32;
int :32;
};
-extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64);
+extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64) __nonnull((2));
libc_hidden_proto (__clock_adjtime64);
extern int ___adjtimex64 (struct __timex64 *tx64) __nonnull ((1));
libc_hidden_proto (___adjtimex64)
--
2.27.0
next prev parent reply other threads:[~2022-04-28 12:25 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
2022-04-28 12:25 ` [PATCH 2/4] ntp_xxxtimex: " Xiaoming Ni
2022-05-04 10:59 ` Siddhesh Poyarekar
2022-04-28 12:25 ` Xiaoming Ni [this message]
2022-05-04 11:00 ` [PATCH 3/4] clock_adjtime: " 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=20220428122529.108208-4-nixiaoming@huawei.com \
--to=nixiaoming@huawei.com \
--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=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).