public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug time/27662] New: adjtimex/clock_adjtime: y2038 regression causes segfault or wrong return value
@ 2021-03-29 19:07 adrian.ratiu at collabora dot com
  2021-03-29 19:07 ` [Bug time/27662] adjtimex/clock_adjtime: y2038 regression causes segfault adrian.ratiu at collabora dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: adrian.ratiu at collabora dot com @ 2021-03-29 19:07 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 27662
           Summary: adjtimex/clock_adjtime: y2038 regression causes
                    segfault or wrong return value
           Product: glibc
           Version: 2.32
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: time
          Assignee: unassigned at sourceware dot org
          Reporter: adrian.ratiu at collabora dot com
  Target Milestone: ---

This is a continuation of BZ #26833 for adjtimex/clock_adjtime.

Example of segfault from a 32bit armv7 system:

$ cat timex.c

#include <errno.h>
#include <string.h>
#include <sys/timex.h>

int main(void) {
  int ret;
  /* Test with nullptr buffer. Should fail with EFAULT. */
  ret = adjtimex(NULL);
  if (ret == -EFAULT)
    return 0;
  return 1;
}

$ armv7a-cros-linux-gnueabihf-gcc -o main timex.c -static -g
$ qemu-arm main
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault.

I believe the following commits need fixing to correctly handle the NULL case:

8f8a6cae48 y2038: linux: Provide ___adjtimex64 implementation
63ff4a6d17 y2038: linux: Provide __clock_adjtime64 implementation

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

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

end of thread, other threads:[~2022-04-25 11:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 19:07 [Bug time/27662] New: adjtimex/clock_adjtime: y2038 regression causes segfault or wrong return value adrian.ratiu at collabora dot com
2021-03-29 19:07 ` [Bug time/27662] adjtimex/clock_adjtime: y2038 regression causes segfault adrian.ratiu at collabora dot com
2021-03-29 19:28 ` schwab@linux-m68k.org
2021-03-29 20:55 ` adrian.ratiu at collabora dot com
2021-03-29 20:56 ` [Bug time/27662] adjtimex/clock_adjtime: y2038 regression causes segfault on 32bit arm adrian.ratiu at collabora dot com
2021-03-29 21:25 ` schwab@linux-m68k.org
2022-04-22  6:38 ` nixiaoming at huawei dot com
2022-04-23  1:45 ` nixiaoming at huawei dot com
2022-04-25 11:10 ` 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).