public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug time/26833] New: adjtime() with delta == NULL segfaults on armv7 32bit platform
@ 2020-11-02 17:14 matthias.gerstner at nefkom dot net
  2020-11-02 17:24 ` [Bug time/26833] " adhemerval.zanella at linaro dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: matthias.gerstner at nefkom dot net @ 2020-11-02 17:14 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=26833

            Bug ID: 26833
           Summary: adjtime() with delta == NULL segfaults on armv7 32bit
                    platform
           Product: glibc
           Version: 2.32
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: time
          Assignee: unassigned at sourceware dot org
          Reporter: matthias.gerstner at nefkom dot net
  Target Milestone: ---

I recently updated glibc from release 2.31 to release 2.32 on Gentoo Linux
running on a 32-bit armv7 machine. Ever since that the ntpd from openntpd
doesn't startup any more.

Digging deeper I found that the forked 'ntp_main' instance of ntpd dies with a
SIGSEGV when executing the the adjtime() glibc function call in the following
function:


```
double                                                                          
getoffset(void)                                                                 
{                                                                               
        struct timeval  tv;                                                     
>>>>    if (adjtime(NULL, &tv) == -1)                                             
                return (0.0);                                                   
        return (tv.tv_sec + 1.0e-6 * tv.tv_usec);                               
}
```

The issue seems to stem from glibc git commit
0308077e3a4ff1c123cdddd311f55a2ecdd3115c where the newly introduced __adjtime
32-bit wrapper cannot handle a NULL pointer itv input parameter.

```
+#if __TIMESIZE != 64
+libc_hidden_def (__adjtime64)
+
+int
+__adjtime (const struct timeval *itv, struct timeval *otv)
+{
+  struct __timeval64 itv64, otv64;
+  int retval;
+
+  itv64 = valid_timeval_to_timeval64 (*itv);
+  retval = __adjtime64 (&itv64, otv != NULL ? &otv64 : NULL);
+  if (otv != NULL)
+    *otv = valid_timeval64_to_timeval (otv64);
+
+  return retval;
+}
+#endif
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug time/26833] adjtime() with delta == NULL segfaults on armv7 32bit platform
  2020-11-02 17:14 [Bug time/26833] New: adjtime() with delta == NULL segfaults on armv7 32bit platform matthias.gerstner at nefkom dot net
@ 2020-11-02 17:24 ` adhemerval.zanella at linaro dot org
  2020-11-09 14:20 ` adhemerval.zanella at linaro dot org
  2020-11-10 12:20 ` fweimer at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2020-11-02 17:24 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=26833

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg
           Assignee|unassigned at sourceware dot org   |adhemerval.zanella at linaro dot o
                   |                            |rg
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2020-11-02

--- Comment #1 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
This seems a regression of BZ#2449 from the y2038 support.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug time/26833] adjtime() with delta == NULL segfaults on armv7 32bit platform
  2020-11-02 17:14 [Bug time/26833] New: adjtime() with delta == NULL segfaults on armv7 32bit platform matthias.gerstner at nefkom dot net
  2020-11-02 17:24 ` [Bug time/26833] " adhemerval.zanella at linaro dot org
@ 2020-11-09 14:20 ` adhemerval.zanella at linaro dot org
  2020-11-10 12:20 ` fweimer at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2020-11-09 14:20 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=26833

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |2.33
         Resolution|---                         |NOTABUG

--- Comment #2 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
Fixed on 2.33.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug time/26833] adjtime() with delta == NULL segfaults on armv7 32bit platform
  2020-11-02 17:14 [Bug time/26833] New: adjtime() with delta == NULL segfaults on armv7 32bit platform matthias.gerstner at nefkom dot net
  2020-11-02 17:24 ` [Bug time/26833] " adhemerval.zanella at linaro dot org
  2020-11-09 14:20 ` adhemerval.zanella at linaro dot org
@ 2020-11-10 12:20 ` fweimer at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2020-11-10 12:20 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=26833

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
         Resolution|NOTABUG                     |FIXED

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
Note: Order of the Resolution drop-down list changed.  NOTABUG is now first.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-10 12:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 17:14 [Bug time/26833] New: adjtime() with delta == NULL segfaults on armv7 32bit platform matthias.gerstner at nefkom dot net
2020-11-02 17:24 ` [Bug time/26833] " adhemerval.zanella at linaro dot org
2020-11-09 14:20 ` adhemerval.zanella at linaro dot org
2020-11-10 12:20 ` fweimer at redhat dot com

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).