[Patch included] NPN_GetStringIdentifiers implementation is broken

Bug #487141 reported by Tristan Schmelcher
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nspluginwrapper
Fix Released
Medium
nspluginwrapper (Ubuntu)
Fix Released
Low
Fabien Tassin

Bug Description

Binary package hint: nspluginwrapper

There is a bug in the NPN_GetStringIdentifiers implementation in nspluginwrapper that makes it completely broken, 100% of the time. The bug exists in versions 1.2.0 and later. The issue is that NPIdentifiers are passed to the do_send_NPIdentifier function by _value_, not by pointer, which is how other parameters are passed to their marshallers. This is fine when calling rpc_method_send_reply (as in the singular version, NPN_GetStringIdentifier), but it results in a bug when marshalling arrays of NPIdentifiers, because the array marshalling code in rpc_message_send_args passes the individual elements by passing a pointer to their position in the array. This resulted in do_send_NPIdentifier interpreting the address of the NPIdentifier as the NPIdentifier itself. As a result, nspluginwrapper's implementation of NPN_GetStringIdentifiers was broken, because the NPIdentifier values that it returned to the plugin were mapped to garbage addresses in the browser.

My fix is to change NPIdentifiers to be passed by pointer. I sent the patch to upstream a while ago, but the author hasn't responded and there hasn't been any activity on the upstream nspluginwrapper source control system in a while. But I figure you'd probably like to incorporate it into Ubuntu.

Note that the patch has already been incorporated into Fedora. You can get more info about it here: https://bugzilla.redhat.com/show_bug.cgi?id=511897.

Revision history for this message
In , Martin (martin-redhat-bugs) wrote :

Created attachment 353833
patch

Description of problem (by Tristan Schmelcher):

Hello,

I'm a developer on Google's open-source O3D plugin project for doing
hardware-accelerated 3D rendering in web browsers (
http://code.google.com/apis/o3d/). O3D is 32-bit only due to a dependency on
Google's V8 JavaScript JIT engine, so I've been working on compatibility
with nspluginwrapper so that we can support 64-bit Linux. Along the way I
discovered that one of the issues was a bug in nspluginwrapper's marshalling
of arrays of NPIdentifiers. A patch with the fix is attached. Apply with
"patch -p0 < FILENAME".

The bug exists in versions 1.2.0 and later. The issue is that NPIdentifiers
are passed to the do_send_NPIdentifier function by _value_, not by pointer,
which is how other parameters are passed to their marshallers. This is fine
when calling rpc_method_send_reply, but it results in a bug when marshalling
arrays of NPIdentifiers, because the array marshalling code in
rpc_message_send_args passes the individual elements by passing a pointer to
their position in the array. This resulted in do_send_NPIdentifier
interpreting the address of the NPIdentifier as the NPIdentifier itself. As
a result, nspluginwrapper's implementation of NPN_GetStringIdentifiers was
broken, because the NPIdentifier values that it returned to the plugin were
mapped to garbage addresses in the browser.

My fix is to change NPIdentifiers to be passed by pointer. With this fix,
nspluginwrapper can successfully run O3D plugins built from our SVN trunk at
revision 19440 or later.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:

Expected results:

Additional info:

Revision history for this message
In , Tristan (tristan-redhat-bugs) wrote :

What's the status of this issue? Martin told me in the original thread about this that he committed the patch to the Fedora 12 package, but this bug is still open and the patch doesn't seem to have made it into http://svn.beauchesne.info/svn/gwenole/projects/nspluginwrapper/trunk

Revision history for this message
In , Martin (martin-redhat-bugs) wrote :

Yeah, you have to urge Gwelone for that...I have this bug open only for tracking purposes/documentation.

Revision history for this message
In , Bug (bug-redhat-bugs) wrote :

This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Revision history for this message
Tristan Schmelcher (tschmelcher) wrote :
Revision history for this message
Tristan Schmelcher (tschmelcher) wrote :

Is anyone looking at this? It would be nice to get this patch incorporated in time for 10.04.

Changed in nspluginwrapper:
status: Unknown → Confirmed
Revision history for this message
Tristan Schmelcher (tschmelcher) wrote :

Can someone please integrate my patch into nspluginwrapper? I reported this bug and the patch almost a year ago. Nothing dissuades me from open-source software more than when my patches fall on deaf ears. :(

Revision history for this message
In , Tristan (tristan-redhat-bugs) wrote :

Martin told me back when he filed this that he also added the patch to the rawhide package, but I just discovered that the bug is still present in F12. Was this patch ever integrated into Fedora? This is preventing Google voice and video chat from working properly. :(

Revision history for this message
In , Martin (martin-redhat-bugs) wrote :

I see the patch in nspluginwrapper-1.3.0-10.fc12, it was added to nspluginwrapper-1.3.0-7.

Revision history for this message
In , Tristan (tristan-redhat-bugs) wrote :

Oops, my mistake. I thought I was using 1.3.0-10.fc12 but it turns out that I had accidentally clobbered some of the files on disk with another version. With a clean install of 1.3.0-10.fc12 everything works fine.

Fabien Tassin (fta)
Changed in nspluginwrapper (Ubuntu):
assignee: nobody → Fabien Tassin (fta)
status: New → In Progress
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nspluginwrapper - 1.2.2-0ubuntu8

---------------
nspluginwrapper (1.2.2-0ubuntu8) natty; urgency=low

  * Fix broken NPN_GetStringIdentifiers implementation (LP: #487141)
    Patch by Tristan Schmelcher
    - add debian/patches/007_NPN_GetStringIdentifiers.patch
    - update debian/patches/series
 -- Fabien Tassin <email address hidden> Thu, 21 Oct 2010 16:01:51 +0200

Changed in nspluginwrapper (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Fabien Tassin (fta) wrote :

@Tristan: Sorry it took so long to notice your patch. I just landed it in Natty. Thank you for your work!

As discussed, it's not severe enough to push that patch into Lucid or Maverick.

Revision history for this message
Tristan Schmelcher (tschmelcher) wrote :

Thanks. :)

Revision history for this message
In , Bug (bug-redhat-bugs) wrote :

This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 12 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Changed in nspluginwrapper:
importance: Unknown → Medium
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.