Page MenuHomeFreeBSD

sys/tools: add -s options for KCFI use
Needs ReviewPublic

Authored by aokblast on Sun, Feb 23, 5:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 8, 5:10 PM
Unknown Object (File)
Wed, Mar 5, 7:11 PM
Unknown Object (File)
Wed, Mar 5, 8:05 AM
Unknown Object (File)
Wed, Mar 5, 3:34 AM
Unknown Object (File)
Sun, Mar 2, 9:09 AM
Unknown Object (File)
Sat, Mar 1, 1:32 PM
Unknown Object (File)
Fri, Feb 28, 10:14 PM
Unknown Object (File)
Fri, Feb 28, 10:54 AM
Subscribers

Details

Reviewers
markj
brooks
Summary

The KCFI requires all function signature match.

For .m files in KCFI, it calls kobj_error_methods in default.

Which means the signature will mismatched thus the KCFI will emit trap
in kernel.

Thus we proposed a option -s for makeobjops.awk to generate the correct
signature for each missing default function.

We do not enable this feature by default because it may enlarge the
kernel size.

sys/kern: fix wrong indent

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 62597
Build 59481: arc lint + arc unit

Event Timeline

We do not enable this feature by default because it may enlarge the kernel size.

How much larger is it in practice?

sys/tools/makeobjops.awk
302

How about return kobj_error_method();?

With opt_s:

    text      data       bss        dec         hex   filename
23241058   1754433   4537984   29533475   0x1c2a523   /usr/obj/usr/src/amd64.amd64/sys/GENERIC/kernel

Without opt_s:

    text      data       bss        dec         hex   filename
23232582   1754433   4537984   29524999   0x1c28407   /usr/obj/usr/src/amd64.amd64/sys/GENERIC/kernel

About 1k in text, not too much. But I think it is a useless size as it change nothings more than the signature.

sys/tools/makeobjops.awk
302

Calling kboj_error_method will incease the call stack. I don't know if it is a good implementation considering in kernel and the .m's frequently call.

I don't have too much experience about it. If you think it is ok, I can do the corresponding change.