summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
* android: add a close-on-exec check on pipe()George Burgess IV2019-06-061-0/+2
| | | | | | | | | | | On Android, pipe() is better to be replaced by pipe2() with O_CLOEXEC flag to avoid file descriptor leakage. Patch by Jian Cai! Differential Revision: https://reviews.llvm.org/D61967 llvm-svn: 362673
* android: add a close-on-exec check on pipe2()George Burgess IV2019-06-061-0/+2
| | | | | | | | | | | On Android, pipe2() is better to set O_CLOEXEC flag to avoid file descriptor leakage. Patch by Jian Cai! Differential Revision: https://reviews.llvm.org/D62049 llvm-svn: 362672
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [Clang-tidy] Alphabetical sort of files/checks. Add space after clang-tidy ↵Eugene Zelenko2018-09-201-3/+3
| | | | | | in source code headers. llvm-svn: 342601
* [clang-tidy] Add a `android-comparison-in-temp-failure-retry` checkGeorge Burgess IV2018-04-101-0/+3
| | | | | | | | | This check attempts to catch buggy uses of the `TEMP_FAILURE_RETRY` macro, which is provided by both Bionic and glibc. Differential Revision: https://reviews.llvm.org/D45059 llvm-svn: 329759
* [clang-tidy] Sort includes; NFCGeorge Burgess IV2018-04-061-1/+1
| | | | llvm-svn: 329428
* [clang-tidy] Add a close-on-exec check on epoll_create() in Android module.Chih-Hung Hsieh2017-08-161-0/+3
| | | | | | | | | | Summary: epoll_create() is better to be replaced by epoll_create1() with EPOLL_CLOEXEC flag to avoid file descriptor leakage. Differential Revision: https://reviews.llvm.org/D35367 llvm-svn: 311029
* [clang-tidy] Add a close-on-exec check on epoll_create1() in Android module.Chih-Hung Hsieh2017-08-161-0/+3
| | | | | | | | | Summary: epoll_create1() is better to set EPOLL_CLOEXEC flag to avoid file descriptor leakage. Differential Revision: https://reviews.llvm.org/D35365 llvm-svn: 311028
* [clang-tidy] Add a close-on-exec check on accept4() in Android module.Chih-Hung Hsieh2017-08-161-0/+2
| | | | | | | | | Summary: accept4() is better to set SOCK_CLOEXEC flag to avoid file descriptor leakage. Differential Revision: https://reviews.llvm.org/D35363 llvm-svn: 311027
* [clang-tidy] Add a close-on-exec check on accept() in Android module.Chih-Hung Hsieh2017-08-161-0/+2
| | | | | | | | | | Summary: accept() is better to be replaced by accept4() with SOCK_CLOEXEC flag to avoid file descriptor leakage. Differential Revision: https://reviews.llvm.org/D35362 llvm-svn: 311024
* [clang-tidy] Add a close-on-exec check on inotify_init1() in Android module.Chih-Hung Hsieh2017-08-141-0/+3
| | | | | | | | | Summary: inotify_init1() is better to set IN_CLOEXEC flag to avoid file descriptor leakage. Differential Revision: https://reviews.llvm.org/D35368 llvm-svn: 310863
* [clang-tidy] Add a close-on-exec check on inotify_init() in Android module.Chih-Hung Hsieh2017-08-141-0/+3
| | | | | | | | | Summary: inotify_init() is better to be replaced by inotify_init1() with IN_CLOEXEC flag to avoid file descriptor leakage. Differential Revision: https://reviews.llvm.org/D35370 llvm-svn: 310861
* [clang-tidy] Add a close-on-exec check on dup() in Android module.Chih-Hung Hsieh2017-08-141-0/+2
| | | | | | | | | Summary: dup() is better to be replaced by fcntl() to avoid file descriptor leakage. Differential Revision: https://reviews.llvm.org/D35364 llvm-svn: 310858
* [clang-tidy] Fix for buildbot.Yan Wang2017-08-101-0/+3
| | | | | | | | | Summary: Fix an issue for windows. Differential Revision: https://reviews.llvm.org/D35372 llvm-svn: 310669
* Revert "[clang-tidy] Refactor the code and add a close-on-exec check on ↵Reid Kleckner2017-08-101-3/+0
| | | | | | | | | | | | memfd_create() in Android module." This reverts commit r310630. The new code broke on Windows and was untested. On Linux, it was selecting the "int" overload of operator<<, which definitely does not print the right thing when fed a "Mode" char. llvm-svn: 310661
* [clang-tidy] Refactor the code and add a close-on-exec check on ↵Yan Wang2017-08-101-0/+3
| | | | | | | | | | | | | | | | | | | | memfd_create() in Android module. Summary: 1. Refactor the structure of the code by adding a base class for all close-on-exec checks, which implements most of the needed functions. 2. memfd_create() is better to set MFD_CLOEXEC flag to avoid file descriptor leakage. Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh, hokein Subscribers: Eugene.Zelenko, chh, cfe-commits, srhines, mgorny, JDevlieghere, xazax.hun Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D35372 llvm-svn: 310630
* [clang-tidy] Add a new Android check "android-cloexec-socket"Yan Wang2017-07-121-0/+2
| | | | | | | | | | | | | | | | Summary: socket() is better to include SOCK_CLOEXEC in its type argument to avoid the file descriptor leakage. Reviewers: chh, Eugene.Zelenko, alexfh, hokein, aaron.ballman Reviewed By: chh, alexfh Subscribers: srhines, mgorny, JDevlieghere, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D34913 llvm-svn: 307818
* [clang-tidy] Rename android-file-open-flag and fix a bugYan Wang2017-06-291-2/+2
| | | | | | | | | | | | | | | | | | Summary: 1. Rename android-file-open-flag to android-cloexec-open. 2. Handle a case when the function is passed as an argument of a function-like macro. Reviewers: chh Reviewed By: chh Subscribers: srhines, mgorny, JDevlieghere, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D34633 llvm-svn: 306728
* [clang-tidy][Part3] Add a new module Android and three new checks.Yan Wang2017-06-291-0/+2
| | | | | | | | | | | | | | | | Summary: -- fopen() should include "e" in their mode string. [android-fopen-mode] Reviewers: chh, alexfh, aaron.ballman, hokein Reviewed By: hokein Subscribers: JDevlieghere, srhines, mgorny, xazax.hun Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33747 llvm-svn: 306709
* [clang-tidy][Part2] Add a new module Android and three new checksYan Wang2017-06-291-0/+2
| | | | | | | | | | | | | | | | Summary: -- creat() should be replaced by open(). [android-creat-usage] Reviewers: chh, alexfh, aaron.ballman, hokein Reviewed By: hokein Subscribers: JDevlieghere, srhines, mgorny, xazax.hun Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33745 llvm-svn: 306708
* [clang-tidy][Part1] Add a new module Android and three new checks.Yan Wang2017-06-231-0/+40
Summary: A common source of security bugs is code that opens a file descriptors without using the O_CLOEXEC flag. (Without that flag, an opened sensitive file would remain open across a fork+exec to a lower-privileged SELinux domain, leaking that sensitive data.). Add a new Android module and one checks in clang-tidy. -- open(), openat(), and open64() should include O_CLOEXEC in their flags argument. [android-file-open-flag] Links to part2 and part3: https://reviews.llvm.org/D33745 https://reviews.llvm.org/D33747 Reviewers: chh, alexfh, aaron.ballman, hokein Reviewed By: alexfh, hokein Subscribers: jbcoe, joerg, malcolm.parsons, Eugene.Zelenko, srhines, mgorny, xazax.hun, cfe-commits, krytarowski Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33304 llvm-svn: 306165
OpenPOWER on IntegriCloud