bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #59870] Segmentation Fault on GNU


From: Fabian Helfert
Subject: [bug #59870] Segmentation Fault on GNU
Date: Thu, 14 Jan 2021 04:45:23 -0500 (EST)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Safari/605.1.15

URL:
  <https://savannah.gnu.org/bugs/?59870>

                 Summary: Segmentation Fault on GNU
                 Project: make
            Submitted by: fabse333
            Submitted on: Thu 14 Jan 2021 09:45:21 AM UTC
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: SCM
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

The attached makefile will cause a Segmentation fault on GNU make 4.2 on
Debian and also when building the newest newest version from the GitHub
mirror.

The issue is that in the method "record_target_var" in read.c, the function
"assign_variable_definition" (see
https://github.com/mirror/make/blob/4.2/read.c#L1864  ) returns 0 on this
MAKEFILE. Even when the Comment states "I don't think this can fail,...". ;-)
While this return value is checked with an assert statement, the asserts are
not included on release builds (e.g. the one I have installed on my Debian 10
Buster). Assert can also be disabled by setting the DNDEBUG Cflag on the
./configure command for local testing:
./configure CFLAGS="-g -DNDEBUG"

The segmentation fault is then an exception when this instruction is executed
where RDX is set to 0:
movzx  eax, byte ptr [rdx + 0x2f]
This should correspond to this line where the origin field of v is accessed:
https://github.com/mirror/make/blob/4.2/read.c#L1867

Steps to reproduce:
* make -f MAKEFILE

I don't see any security concerns related with this bug, so I set Privacy of
this ticket to Public.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 14 Jan 2021 09:45:21 AM UTC  Name: MAKEFILE  Size: 8B   By: fabse333

<http://savannah.gnu.org/bugs/download.php?file_id=50714>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59870>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]