VirtualBox

Opened 13 years ago

Last modified 12 years ago

#9432 closed defect

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

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

Description

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 (0)

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use