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

Enable stack-protection for .so used in Android builds #554

Open
rshin1989 opened this issue Jan 12, 2023 · 0 comments
Open

Enable stack-protection for .so used in Android builds #554

rshin1989 opened this issue Jan 12, 2023 · 0 comments

Comments

@rshin1989
Copy link

rshin1989 commented Jan 12, 2023

Is your feature request related to a problem? Please describe.
Need to improve security of native library binaries brought into Android build

  • Stack Canary
  • NX
  • FORTIFY_SOURCE
  • RELRO
  • etc.

Describe the solution you'd like

The fijkplayer looks to be using NDK and native library binary (.so) files included in com.befovy.fijkplayer:fijkplayer- full:0.7.16

The .so files include

  • libijkffmpeg.so
  • ibijksdl.so
  • libijkplayer.so

When compiling these .so files, please include the following c compiler flags
-fstack-protector-all, -fpic, and -fstack-protector-strong

See

Describe alternatives you've considered
Unsuccessful attempt at manually configuring Native Android project build.gradle file's ndk configuration block

defaultConfig {
    externalNativeBuild {
        cmake {
            cFlags "-fstack-protector-all"
            cppFlags "-fstack-protector-all"
        }
    }
}

Additional context
https://www.trapkit.de/tools/checksec/
checksec.sh can be used on files and folders to check binary security properties

C compilation binary - Stack Protection flags
https://developers.redhat.com/articles/2022/06/02/use-compiler-flags-stack-protection-gcc- and-clang#

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