public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adrian.ratiu at collabora dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug time/27662] New: adjtimex/clock_adjtime: y2038 regression causes segfault or wrong return value
Date: Mon, 29 Mar 2021 19:07:02 +0000	[thread overview]
Message-ID: <bug-27662-131@http.sourceware.org/bugzilla/> (raw)

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.

             reply	other threads:[~2021-03-29 19:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 19:07 adrian.ratiu at collabora dot com [this message]
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

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=bug-27662-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).