Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzing in OSS-Fuzz, linking issue #1915

Open
zi0Black opened this issue Jan 16, 2024 · 0 comments
Open

Fuzzing in OSS-Fuzz, linking issue #1915

zi0Black opened this issue Jan 16, 2024 · 0 comments

Comments

@zi0Black
Copy link

Hi, I am having some headaches with a project on OSS-Fuzz which imports Ring. I wondered if there are specific flags to pass in CXXFLAGS required to correctly link with libFuzzer?

I noticed that there is a placeholder for Ring in OSS-Fuzz: google/oss-fuzz#1930, so I thought maybe someone tried to build in that environment /cc @briansmith

Small snippet of the error generated by the linker:

 = note: ld.lld: error: undefined symbol: __sanitizer_cov_8bit_counters_init                                                                       
          >>> referenced by aes_nohw.c                                                                                                              
          >>>               aes_nohw.o:(sancov.module_ctor_8bit_counters) in archive /src/aptos-core/testsuite/fuzzer/target/release/deps/libring-63
c758c7847ddbd8.rlib                                                                                                                                 
                                                                                                                                                    
          ld.lld: error: undefined symbol: __sanitizer_cov_pcs_init                                                                                 
          >>> referenced by aes_nohw.c                                                                                                              
          >>>               aes_nohw.o:(sancov.module_ctor_8bit_counters) in archive /src/aptos-core/testsuite/fuzzer/target/release/deps/libring-63
c758c7847ddbd8.rlib                                                                                                                                 
                                                                                                                                                    
          ld.lld: error: undefined symbol: __asan_init                                                                                              
          >>> referenced by aes_nohw.c                                                                                                              
          >>>               aes_nohw.o:(asan.module_ctor) in archive /src/aptos-core/testsuite/fuzzer/target/release/deps/libring-63c758c7847ddbd8.r
lib                                                                                                                                                 
          >>> referenced by montgomery.c                                                                                                            
          >>>               montgomery.o:(asan.module_ctor) in archive /src/aptos-core/testsuite/fuzzer/target/release/deps/libring-63c758c7847ddbd8
.rlib                                                                                                                                               
          >>> referenced by montgomery_inv.c                                                                                                        
          >>>               montgomery_inv.o:(asan.module_ctor) in archive /src/aptos-core/testsuite/fuzzer/target/release/deps/libring-63c758c7847d
dbd8.rlib                                                                                                                                           
          >>> referenced 11 more times

Clearing out OSS-Fuzz 'CXXFLAGS' and 'CFLAGS' so that all C/CPP code isn't instrumented is a workaround, but it's dirty, and I find other fixes to build other dependencies. So I'm hoping to make this work in a more elegant way too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant