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

Unsatisfied secure compilation options -fPIE -pie #5844

Open
JunXie-ZH opened this issue Apr 1, 2024 · 4 comments
Open

Unsatisfied secure compilation options -fPIE -pie #5844

JunXie-ZH opened this issue Apr 1, 2024 · 4 comments
Labels
type/question Type: question about the product

Comments

@JunXie-ZH
Copy link

I used a scanning tool to scan the nebula-graphd file and found Unsatisfied secure compilation options -fPIE -pie. I saw a related reply in the community: Nebula relies on static libraries and does not need this option. (https://discuss.nebula-graph.com.cn/t/topic/2846/2)

Is there a formal conclusion and reason for this?

@QingZ11 QingZ11 added the type/question Type: question about the product label Apr 7, 2024
@Shinji-IkariG
Copy link
Contributor

In the current source code we use the -fPIC option, what scanning tool are you using? I want to reproduce this scan result.
Both nebula and nebula-third-party use the -fPIC option, so I want to know which part is showing up -fPIE

@dutor
Copy link
Contributor

dutor commented Apr 7, 2024

The replies in the mentioned post are not correct.

The -no-pie linker option was introduced by me long long ago. I am not sure about the exact reason to do this. But it must be related with a crash bug if PIE is enabled by default. I simply reviewed my commit history to locate the original PR but with no luck.

@JunXie-ZH
Copy link
Author

JunXie-ZH commented Apr 7, 2024

Yes, my code exists -fPIE -pie . But I used the security tool to scan nebula-graphd, the result showed that the -fPIE -pie not activated. I'd like to consult the reasons and the security risks.

-DCMAKE_C_FLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie -fPIC -pie -Wl,--disable-new-dtags ${CMAKE_C_FLAGS}"

-DCMAKE_CXX_FLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie -fPIC -pie -Wl,--disable-new-dtags ${CMAKE_CXX_FLAGS}"

@dutor
Copy link
Contributor

dutor commented Apr 7, 2024

I already explained the reason.

What PIE does explains the risks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question Type: question about the product
Projects
None yet
Development

No branches or pull requests

4 participants