binutils as policy checker (was: RFC: Add a linker warning when creating segments with RWX permissions)

Nick Clifton nickc@redhat.com
Tue Apr 26 16:47:21 GMT 2022


Hi Michael,

>>    Following on from the patch to add warnings when the linker creates an
>>    executable stack, here is another proposal for a patch to add a
>>    warning when the linker creates a memory resident segment with RWX
>>    permissions.
> 
> Is binutils really the right place to enforce policies?

Enforce - no.  But I do think that the binutils - or more specifically
the linker - is a good place to detect this sort of problem and provide
feedback to the user.


> I consider all these kinds of checks, which do have some sense, to be
> implementing a certain set of rules that aren't inherent in the design or
> requirements of binary files intended to hold object code and data, i.e. a
> policy.  

That is fair.  The original intent for these warnings was to alert users
to potential security risks that might otherwise be hidden from them.  But
that assumes that the user cares about such risks and wants/needs to be
informed.

Perhaps what is needed here is the idea suggested by Sam James - a configure
time option to enable or disable these checks and warnings.  An option that
could default to off for now, but which we could change to default to on in
a later release.


> And for checking adherence to a policy I would expect a policy
> checker tool to be more appropriate than tools designed for creating such
> object files.

As an aside the annobin project/package is exactly this - a checker tool
for enforcing a specific security policy when building binaries.

Cheers
   Nick



More information about the Binutils mailing list