VirtualBox

Ticket #9432 (closed defect: invalid)

Opened 3 years ago

Last modified 18 months ago

Virtualbox modules fail to build when using gcc constify plugin (from grsecurity/pax)

Reported by: nickde Owned by:
Priority: minor Component: other
Version: VirtualBox 4.1.0 Keywords: constification
Cc: Guest type: other
Host type: Linux

Description (last modified by frank) (diff)

When using a grsecurity patched kernel, a special gcc plugin gets included in the build options of modules, the "constify" plugin, that does constification of function pointers.

From the description of the constify plugin source: "This gcc plugin constifies all structures which contain only function pointers and const fields."

Because of that, virtualbox modules fail to build.

This is the error produced:

/var/lib/dkms/vboxhost/4.1.0/build/vboxdrv/SUPDrv.c: In function ‘supdrvIDC_LdrGetSymbol’:
/var/lib/dkms/vboxhost/4.1.0/build/vboxdrv/SUPDrv.c:4346:17: error: assignment of read-only member ‘Out’
/var/lib/dkms/vboxhost/4.1.0/build/vboxdrv/SUPDrv.c:4377:21: error: assignment of read-only member ‘Out’

It comes from these two lines:

pReq->u.Out.pfnSymbol = g_aFunctions[i].pfn;
pReq->u.Out.pfnSymbol = (PFNRT)((uint8_t *)pImage->pvImage + (int32_t)paSyms[i].offSymbol);

"Out" is a function pointer (PFNRT type).

Change History

comment:1 Changed 3 years ago by michael

Please explain more clearly why you think that this is a problem for our code specifically, bearing in mind that the code you are referring to is essentially a shared object loader.

comment:2 Changed 18 months ago by frank

  • Status changed from new to closed
  • Resolution set to invalid
  • Description modified (diff)

No response, closing.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use