From: "tip-bot2 for Alejandro Colomar" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Alejandro Colomar <alx.manpages@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/core] futex: Change utime parameter to be 'const ... *'
Date: Wed, 27 Jan 2021 19:31:15 -0000 [thread overview]
Message-ID: <161177587598.23325.9730602966018555061.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20201128123945.4592-1-alx.manpages@gmail.com>
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 3018a08401300005536817507dd14c2a7c4ffa69
Gitweb: https://git.kernel.org/tip/3018a08401300005536817507dd14c2a7c4ffa69
Author: Alejandro Colomar <alx.manpages@gmail.com>
AuthorDate: Sat, 28 Nov 2020 13:39:46 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 27 Jan 2021 12:30:02 +01:00
futex: Change utime parameter to be 'const ... *'
futex(2) says that 'utime' is a pointer to 'const'. The implementation
doesn't use 'const'; however, it _never_ modifies the contents of utime.
- futex() either uses 'utime' as a pointer to struct or as a 'u32'.
- In case it's used as a 'u32', it makes a copy of it, and of course it is
not dereferenced.
- In case it's used as a 'struct __kernel_timespec __user *', the pointer
is not dereferenced inside the futex() definition, and it is only passed
to a function: get_timespec64(), which accepts a 'const struct
__kernel_timespec __user *'.
[ tglx: Make the same change to the compat syscall ]
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20201128123945.4592-1-alx.manpages@gmail.com
---
kernel/futex.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index c47d101..d0775aa 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -3790,8 +3790,8 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
- struct __kernel_timespec __user *, utime, u32 __user *, uaddr2,
- u32, val3)
+ const struct __kernel_timespec __user *, utime,
+ u32 __user *, uaddr2, u32, val3)
{
struct timespec64 ts;
ktime_t t, *tp = NULL;
@@ -3986,7 +3986,7 @@ err_unlock:
#ifdef CONFIG_COMPAT_32BIT_TIME
SYSCALL_DEFINE6(futex_time32, u32 __user *, uaddr, int, op, u32, val,
- struct old_timespec32 __user *, utime, u32 __user *, uaddr2,
+ const struct old_timespec32 __user *, utime, u32 __user *, uaddr2,
u32, val3)
{
struct timespec64 ts;
next prev parent reply other threads:[~2021-01-27 19:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-28 12:39 [PATCH] futex: Change 'utime' " Alejandro Colomar
2020-12-10 17:36 ` Alejandro Colomar (man-pages)
2021-01-17 16:32 ` Ping: " Alejandro Colomar (man-pages)
2021-01-27 19:31 ` tip-bot2 for Alejandro Colomar [this message]
2021-01-28 12:21 ` [tip: locking/core] futex: Change utime " tip-bot2 for Alejandro Colomar
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=161177587598.23325.9730602966018555061.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=alx.manpages@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®