yuvald-sweet-security wrote:

@yonghong-song thank you for taking the time to help with this issue and 
providing your suggestions, it’s greatly appreciated. I am also glad to hear 
that asm barriers are no longer necessary, as they caused quite some trouble 
for me in the past. However, I've encountered a few issues while attempting to 
apply this as a solution to the problem with moving to mpcu v3.
* while you are correct in that removing the barriers fixes the verifier 
failure in `trace_ret_vfs_writev_tail`, the original issue I've pointed out - 
the increased size of kernel verifier states and instructions when using v3 - 
still remains:

```
$ sudo /root/veristat /tmp/test-v1.o --filter=trace_ret_vfs_writev_tail
Processing 'test-v1.o'...
File       Program                    Verdict  Duration (us)  Insns  States  
Program size  Jited size
---------  -------------------------  -------  -------------  -----  ------  
------------  ----------
test-v1.o  trace_ret_vfs_writev_tail  success          23158  25292    1874     
     7163       38486
---------  -------------------------  -------  -------------  -----  ------  
------------  ----------
Done. Processed 1 files, 0 programs. Skipped 1 files, 158 programs.

$ sudo /root/veristat /tmp/test-v3-nobarrier.o 
--filter=trace_ret_vfs_writev_tail
Processing 'test-v3-nobarrier.o'...
File                 Program                    Verdict  Duration (us)   Insns  
States  Program size  Jited size
-------------------  -------------------------  -------  -------------  ------  
------  ------------  ----------
test-v3-nobarrier.o  trace_ret_vfs_writev_tail  success          69161  104971  
  7618          6999       37490
-------------------  -------------------------  -------  -------------  ------  
------  ------------  ----------
Done. Processed 1 files, 0 programs. Skipped 1 files, 158 programs.
```
As you can see the v3 codegen causes the verifier to consume about 4 times the 
number of instructions when verifying it, and while it's not such a big issue 
for this particular function, it can be an issue for larger functions which are 
already close to the verifier's 1 million instructions limit as this can cause 
them to go over it.

* Many verifier failures still remain after removing the barriers. e.g. the 
function `vfs_writev_magic_return` still fails even after I've removed all asm 
volatile/barrier vars (you can use 
[patch.txt](https://github.com/user-attachments/files/19407900/patch.txt) which 
removes all of them). Also, in some of the code that I have removing the 
barrier vars on v3 codegen actually introduces more verifier failures (compared 
to v3 with barrier vars), I'll see if I can make a minimal example of this.

thank you again for your thoughtful advice and support

https://github.com/llvm/llvm-project/pull/107008
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to