public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: Wichert Akkerman <wichert@wiggy.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: sys_gettimeofday racy or not?
Date: Fri, 25 Jun 2004 00:53:04 -0400	[thread overview]
Message-ID: <40DBAFB0.5000109@nortelnetworks.com> (raw)
In-Reply-To: <20040625002057.GA3052@wiggy.net>

Wichert Akkerman wrote:
> This just happened to catch my eye and it's probably perfectly
> valid, but if so please educate me on why it is. In kernel/time.c
> sys_gettimeofday() there is this code:
> 
>         if (unlikely(tz != NULL)) {
>                 if (copy_to_user(tz, &sys_tz, sizeof(sys_tz)))
>                         return -EFAULT;
>         }
> 
> what prevents sys_tz from being changed while this code runs?

Nothing at all.

I suspect most people don't worry about it, since its use is deprecated.  The 
man page for gettimeofday() says "The use of the timezone struct is obsolete".

Chris

      reply	other threads:[~2004-06-25  4:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-25  0:20 sys_gettimeofday racy or not? Wichert Akkerman
2004-06-25  4:53 ` Chris Friesen [this message]

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=40DBAFB0.5000109@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wichert@wiggy.net \
    /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