GHSA-M7W2-5C77-2WCR

Vulnerability from github – Published: 2026-11-30 15:32 – Updated: 2026-11-30 15:32
VLAI
Details

In the Linux kernel, the following vulnerability has been resolved:

microblaze: don't clobber r3/r4 restored by rt_sigreturn

ret_from_trap begins by storing the system call return values r3 and r4 back into the saved user pt_regs. That is right for an ordinary system call, but sys_rt_sigreturn() returns through the same path and has to be transparent: restore_sigcontext() has just filled pt_regs from the signal frame, and every register must reach userspace exactly as saved. The two stores overwrite the restored r3/r4 with whatever the C function left in those registers.

Only r4 is actually lost, and that follows from how sigreturn is written everywhere rather than from chance. Architectures have sys_rt_sigreturn() return the restored return-value register precisely so that this writeback stores the restored value -- arm returns regs->ARM_r0, riscv and csky regs->a0, arc regs->r0 -- and microblaze does the same through *rval_p = regs->r3 in restore_sigcontext(). But the entry macros treat r3 and r4 as a pair, so ret_from_trap writes back two registers while a C function has only one return value; nothing carries the restored r4.

Commit 791d0a169b91 ("microblaze: Fix sys_rt_sigreturn_wrapper") introduced this in v2.6.37. The old wrapper saved r3/r4 before the call and reloaded them from pt_regs afterwards; switching brlid to brid removed the only point where they were reloaded, and the stores have been overwriting them ever since.

Fix it the way the sibling paths already behave: ret_from_irq and ret_from_exc restore the full register set and do not perform these stores at all. Label the instruction after the stores ret_from_trap_no_rval and enter there, biasing r15 by -8 so that the ABI return "rtsd r15, 8" lands on it; naming the entry rather than computing ret_from_trap + 8 keeps it correct if the number of stores ever changes. Restoring the old save/reload would work too, but costs four memory accesses and a branch to undo damage that is better not done.

Any value the compiler keeps in r4 across a signal is lost. The tightest windows are the lwx/swx compare-and-swap retry loops gcc emits for atomics: in uClibc-ng's libc.so alone, 50 of 364 such loops hold the address in r4. This is not specific to one libc -- musl passes the address as "r"(p), and glibc has no microblaze atomic-machine.h and so uses gcc's __atomic builtins, which expand the same way. Triggering it needs threads plus a signal storm, which is why it survived 15 years.

Reproduced on qemu-system-microblazeel (petalogix-s3adsp1800) by running the uClibc-ng NPTL test tst-eintr1 40 times against an unchanged userspace: on v7.2 built with gcc 16.2.0, 23 of 40 iterations died with SIGSEGV without this patch and 0 of 40 with it; on v7.0 built with gcc 12.5.0 the same comparison gave 6 of 40 against 0 of 40. The register dump of a failing iteration shows the signature: a zero r4 and a fault at address 0, while r3 came back intact.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-139060"
  ],
  "database_specific": {
    "cwe_ids": [],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-11-30T14:18:12Z",
    "severity": null
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nmicroblaze: don\u0027t clobber r3/r4 restored by rt_sigreturn\n\nret_from_trap begins by storing the system call return values r3 and r4\nback into the saved user pt_regs.  That is right for an ordinary system\ncall, but sys_rt_sigreturn() returns through the same path and has to be\ntransparent: restore_sigcontext() has just filled pt_regs from the signal\nframe, and every register must reach userspace exactly as saved.  The two\nstores overwrite the restored r3/r4 with whatever the C function left in\nthose registers.\n\nOnly r4 is actually lost, and that follows from how sigreturn is written\neverywhere rather than from chance.  Architectures have sys_rt_sigreturn()\nreturn the restored return-value register precisely so that this writeback\nstores the restored value -- arm returns regs-\u003eARM_r0, riscv and csky\nregs-\u003ea0, arc regs-\u003er0 -- and microblaze does the same through\n*rval_p = regs-\u003er3 in restore_sigcontext().  But the entry macros treat r3\nand r4 as a pair, so ret_from_trap writes back two registers while a C\nfunction has only one return value; nothing carries the restored r4.\n\nCommit 791d0a169b91 (\"microblaze: Fix sys_rt_sigreturn_wrapper\") introduced\nthis in v2.6.37.  The old wrapper saved r3/r4 before the call and reloaded\nthem from pt_regs afterwards; switching brlid to brid removed the only\npoint where they were reloaded, and the stores have been overwriting them\never since.\n\nFix it the way the sibling paths already behave: ret_from_irq and\nret_from_exc restore the full register set and do not perform these stores\nat all.  Label the instruction after the stores ret_from_trap_no_rval and\nenter there, biasing r15 by -8 so that the ABI return \"rtsd r15, 8\" lands\non it; naming the entry rather than computing ret_from_trap + 8 keeps it\ncorrect if the number of stores ever changes.  Restoring the old\nsave/reload would work too, but costs four memory accesses and a branch to\nundo damage that is better not done.\n\nAny value the compiler keeps in r4 across a signal is lost.  The tightest\nwindows are the lwx/swx compare-and-swap retry loops gcc emits for atomics:\nin uClibc-ng\u0027s libc.so alone, 50 of 364 such loops hold the address in r4.\nThis is not specific to one libc -- musl passes the address as \"r\"(p), and\nglibc has no microblaze atomic-machine.h and so uses gcc\u0027s __atomic\nbuiltins, which expand the same way.  Triggering it needs threads plus a\nsignal storm, which is why it survived 15 years.\n\nReproduced on qemu-system-microblazeel (petalogix-s3adsp1800) by running\nthe uClibc-ng NPTL test tst-eintr1 40 times against an unchanged userspace:\non v7.2 built with gcc 16.2.0, 23 of 40 iterations died with SIGSEGV\nwithout this patch and 0 of 40 with it; on v7.0 built with gcc 12.5.0 the\nsame comparison gave 6 of 40 against 0 of 40.  The register dump of a\nfailing iteration shows the signature: a zero r4 and a fault at address 0,\nwhile r3 came back intact.",
  "id": "GHSA-m7w2-5c77-2wcr",
  "modified": "2026-11-30T15:32:15Z",
  "published": "2026-11-30T15:32:15Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-139060"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/2ab82d62aaf54e178f1829707ef6bd83a31d8304"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/3f11e9ef8441e039c635b7acdbad992c1e27f644"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/4cb5736181bd5146c18e02d3498ec78f51cce770"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/518805174e7617238295d1f07985bb5ce69c575f"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/5545d027ffa2aa99fb6dfefb5c5ccef8e5cc0826"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/87f78edf4b3deb58a8405d7eb401312aca7229c8"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/a3c8e0d870e9ac754732a07f9ef688589a6bb51a"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/da6829138a39fa3b9ec318ca54ff89af9d94d350"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.