From: Jim Houston <jim.houston@attbi.com>
To: "Marco d'Itri" <md@Linux.IT>,
julie.n.fleischer@intel.com, linux-kernel@vger.kernel.org,
" Linus Torvalds" <torvalds@transmeta.com>
Subject: Re: 2.5.51 nanosleep fails
Date: Thu, 12 Dec 2002 17:27:46 -0500 [thread overview]
Message-ID: <200212122227.gBCMRkT10652@linux.local> (raw)
Hi Linus, Marco, Julie, Everyone,
It really is broken. I just didn't try enough combinations.
Thanks Julie, the test suite really helps.
The problem is that nanosleep didn't check for the NULL pointer
case and always tries to copy out the remaining time. The attached
patch will fix this problem.
Jim Houston - Concurrent Computer Corp.
--- linux-2.5.51.orig/kernel/timer.c Thu Dec 12 17:08:30 2002
+++ linux-2.5.51.new/kernel/timer.c Thu Dec 12 16:59:10 2002
@@ -1040,7 +1040,7 @@
jiffies_to_timespec(expire, &t);
ret = -ERESTART_RESTARTBLOCK;
- if (copy_to_user(rmtp, &t, sizeof(t)))
+ if (rmtp && copy_to_user(rmtp, &t, sizeof(t)))
ret = -EFAULT;
/* The 'restart' block is already filled in */
}
@@ -1067,7 +1067,7 @@
if (expire) {
struct restart_block *restart;
jiffies_to_timespec(expire, &t);
- if (copy_to_user(rmtp, &t, sizeof(t)))
+ if (rmtp && copy_to_user(rmtp, &t, sizeof(t)))
return -EFAULT;
restart = ¤t_thread_info()->restart_block;
next reply other threads:[~2002-12-12 22:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-12 22:27 Jim Houston [this message]
2002-12-13 1:29 ` 2.5.51 nanosleep fails Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2002-12-12 19:59 Fleischer, Julie N
2002-12-11 21:05 Jim Houston
2002-12-12 20:57 ` Marco d'Itri
2002-12-10 23:57 Marco d'Itri
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=200212122227.gBCMRkT10652@linux.local \
--to=jim.houston@attbi.com \
--cc=julie.n.fleischer@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=md@Linux.IT \
--cc=torvalds@transmeta.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