Opened 13 years ago

Closed 12 years ago

#9432 closed defect (invalid)

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

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

Description (last modified by Frank Mehnert)

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

comment:1 by Michael Thayer, 13 years ago

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 by Frank Mehnert, 12 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

No response, closing.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use