Uploaded image for project: 'Apache Lucy-Clownfish'
  1. Apache Lucy-Clownfish
  2. CLOWNFISH-62

Crash when passing Perl variable as decremented arg

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.4.0, 0.5.0
    • 0.5.0
    • Perl
    • None

    Description

      Passing a Perl variable to a method that takes a "decremented" argument results in a use-after-free. Example

      perl -MClownfish -e 'Clownfish::Vector->new->push("abc")'
      

      Analysis:

      • A Clownfish "stack" string is created from the string value of the Perl variable.
      • The stack string is passed to Vec_Push.
      • The stack string is never incref'd.
      • The copy-on-incref mechanism isn't invoked.
      • When the Vector is destroyed, the stack string is decref'd, accessing random stack memory.

      A possible solution is to forgo the stack string optimization for decremented arguments.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nwellnhof Nikolas Wellnhofer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: