.. | .. |
---|
21 | 21 | which gcc sometimes uses jump tables. |
---|
22 | 22 | |
---|
23 | 23 | (Objtool also has an 'orc generate' subcommand which generates debuginfo |
---|
24 | | -for the ORC unwinder. See Documentation/x86/orc-unwinder.txt in the |
---|
| 24 | +for the ORC unwinder. See Documentation/x86/orc-unwinder.rst in the |
---|
25 | 25 | kernel tree for more details.) |
---|
26 | 26 | |
---|
27 | 27 | |
---|
.. | .. |
---|
101 | 101 | band. So it doesn't affect runtime performance and it can be |
---|
102 | 102 | reliable even when interrupts or exceptions are involved. |
---|
103 | 103 | |
---|
104 | | - For more details, see Documentation/x86/orc-unwinder.txt. |
---|
| 104 | + For more details, see Documentation/x86/orc-unwinder.rst. |
---|
105 | 105 | |
---|
106 | 106 | c) Higher live patching compatibility rate |
---|
107 | 107 | |
---|
.. | .. |
---|
111 | 111 | be detectable). Objtool makes that possible. |
---|
112 | 112 | |
---|
113 | 113 | For more details, see the livepatch documentation in the Linux kernel |
---|
114 | | - source tree at Documentation/livepatch/livepatch.txt. |
---|
| 114 | + source tree at Documentation/livepatch/livepatch.rst. |
---|
115 | 115 | |
---|
116 | 116 | Rules |
---|
117 | 117 | ----- |
---|
.. | .. |
---|
289 | 289 | might be corrupt due to a gcc bug. For more details, see: |
---|
290 | 290 | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646 |
---|
291 | 291 | |
---|
| 292 | +9. file.o: warning: objtool: funcA() call to funcB() with UACCESS enabled |
---|
| 293 | + |
---|
| 294 | + This means that an unexpected call to a non-whitelisted function exists |
---|
| 295 | + outside of arch-specific guards. |
---|
| 296 | + X86: SMAP (stac/clac): __uaccess_begin()/__uaccess_end() |
---|
| 297 | + ARM: PAN: uaccess_enable()/uaccess_disable() |
---|
| 298 | + |
---|
| 299 | + These functions should be called to denote a minimal critical section around |
---|
| 300 | + access to __user variables. See also: https://lwn.net/Articles/517475/ |
---|
| 301 | + |
---|
| 302 | + The intention of the warning is to prevent calls to funcB() from eventually |
---|
| 303 | + calling schedule(), potentially leaking the AC flags state, and not |
---|
| 304 | + restoring them correctly. |
---|
| 305 | + |
---|
| 306 | + It also helps verify that there are no unexpected calls to funcB() which may |
---|
| 307 | + access user space pages with protections against doing so disabled. |
---|
| 308 | + |
---|
| 309 | + To fix, either: |
---|
| 310 | + 1) remove explicit calls to funcB() from funcA(). |
---|
| 311 | + 2) add the correct guards before and after calls to low level functions like |
---|
| 312 | + __get_user_size()/__put_user_size(). |
---|
| 313 | + 3) add funcB to uaccess_safe_builtin whitelist in tools/objtool/check.c, if |
---|
| 314 | + funcB obviously does not call schedule(), and is marked notrace (since |
---|
| 315 | + function tracing inserts additional calls, which is not obvious from the |
---|
| 316 | + sources). |
---|
| 317 | + |
---|
| 318 | +10. file.o: warning: func()+0x5c: stack layout conflict in alternatives |
---|
| 319 | + |
---|
| 320 | + This means that in the use of the alternative() or ALTERNATIVE() |
---|
| 321 | + macro, the code paths have conflicting modifications to the stack. |
---|
| 322 | + The problem is that there is only one ORC unwind table, which means |
---|
| 323 | + that the ORC unwind entries must be consistent for all possible |
---|
| 324 | + instruction boundaries regardless of which code has been patched. |
---|
| 325 | + This limitation can be overcome by massaging the alternatives with |
---|
| 326 | + NOPs to shift the stack changes around so they no longer conflict. |
---|
| 327 | + |
---|
| 328 | +11. file.o: warning: unannotated intra-function call |
---|
| 329 | + |
---|
| 330 | + This warning means that a direct call is done to a destination which |
---|
| 331 | + is not at the beginning of a function. If this is a legit call, you |
---|
| 332 | + can remove this warning by putting the ANNOTATE_INTRA_FUNCTION_CALL |
---|
| 333 | + directive right before the call. |
---|
| 334 | + |
---|
292 | 335 | |
---|
293 | 336 | If the error doesn't seem to make sense, it could be a bug in objtool. |
---|
294 | 337 | Feel free to ask the objtool maintainer for help. |
---|
.. | .. |
---|
306 | 349 | |
---|
307 | 350 | - To skip validation of a file, add |
---|
308 | 351 | |
---|
309 | | - OBJECT_FILES_NON_STANDARD_filename.o := n |
---|
| 352 | + OBJECT_FILES_NON_STANDARD_filename.o := y |
---|
310 | 353 | |
---|
311 | 354 | to the Makefile. |
---|
312 | 355 | |
---|