qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [Bug 1661815] [NEW] Stack address is returned from function


From: shqking
Subject: [Qemu-devel] [Bug 1661815] [NEW] Stack address is returned from function translate_one
Date: Sat, 04 Feb 2017 08:20:40 -0000

Public bug reported:

The vulnerable version is qemu-2.8.0, and the vulnerable function is in
"target-s390x/translate.c".

The code snippet is as following.

static ExitStatus translate_one(CPUS390XState *env, DisasContext *s)
{
    const DisasInsn *insn;
    ExitStatus ret = NO_EXIT;
    DisasFields f;
    ...
    s->fields = &f;
    ...
    s->pc = s->next_pc;
    return ret;
}

A stack address, i.e. the address of local variable "f" is returned from
current function through the output parameter "s->fields" as a side
effect.

This issue is one kind of undefined behaviors, according the C Standard,
6.2.4 [ISO/IEC 9899:2011]
(https://www.securecoding.cert.org/confluence/display/c/DCL30-C.+Declare+objects+with+appropriate+storage+durations)

This dangerous defect may lead to an exploitable vulnerability.
We suggest sanitizing "s->fields" as null before return.

Note that this issue is reported by shqking and Zhenwei Zou together.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1661815

Title:
  Stack address is returned from function translate_one

Status in QEMU:
  New

Bug description:
  The vulnerable version is qemu-2.8.0, and the vulnerable function is
  in "target-s390x/translate.c".

  The code snippet is as following.

  static ExitStatus translate_one(CPUS390XState *env, DisasContext *s)
  {
      const DisasInsn *insn;
      ExitStatus ret = NO_EXIT;
      DisasFields f;
      ...
      s->fields = &f;
      ...
      s->pc = s->next_pc;
      return ret;
  }

  A stack address, i.e. the address of local variable "f" is returned
  from current function through the output parameter "s->fields" as a
  side effect.

  This issue is one kind of undefined behaviors, according the C
  Standard, 6.2.4 [ISO/IEC 9899:2011]
  
(https://www.securecoding.cert.org/confluence/display/c/DCL30-C.+Declare+objects+with+appropriate+storage+durations)

  This dangerous defect may lead to an exploitable vulnerability.
  We suggest sanitizing "s->fields" as null before return.

  Note that this issue is reported by shqking and Zhenwei Zou together.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1661815/+subscriptions



reply via email to

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