• 検索結果がありません。

データフロー解析結果を付加した構文木に対するパターンマッチによるコード検査

N/A
N/A
Protected

Academic year: 2021

シェア "データフロー解析結果を付加した構文木に対するパターンマッチによるコード検査"

Copied!
1
0
0

読み込み中.... (全文を見る)

全文

(1)情報処理学会論文誌. プログラミング. Vol.10 No.5 6 (Nov. 2017). 発表概要. データフロー解析結果を付加した構文木に対する パターンマッチによるコード検査 谷口 力斗1,a). 馬谷 誠二2,b). 鵜川 始陽3,c). 2017年3月3日発表. プログラマはセキュアコーディング規約や,ライブラリの API に従わなければならない.規約に従わな いプログラムは脆弱性を引き起こしたり正しく動作しないこともある.そのため,ソースコードを検査して コーディング規約や API の違反を検出するツールが開発されている.我々が開発を行っている ASTgrep もその 1 つである.ASTgrep は,C プログラムを S 式で表現された抽象構文木(S-AST)に変換するフ ロントエンドと,同じく S 式で表現される違反コードパターンとフロントエンドが生成する S-AST との パターンマッチを行うバックエンドからなる.しかし,ソースコードの構文的な特徴を反映しただけの S-AST では,null 参照のようなデータフローを考慮する必要のあるパターンを表現できない.そこで,本 研究では ASTgrep を改良し,データフロー解析の結果を S-AST に付与し,データフローに依存する違反 パターンを表現可能にする.改良した ASTgrep は,LLVM を使ってデータフロー解析を行い,その結果 をフロントエンドから生成される S-AST に付与する.改良前の ASTgrep では記述できなかったセキュア コーディング規約のいくつかを,改良後の ASTgrep を用いて実際に記述・検出できることを確認した.. Checking Code by Pattern Matching against Abstract Syntax Trees Enriched with Data-flow Information Rikito Taniguchi1,a). Seiji Umatani2,b). Tomoharu Ugawa3,c). Presented: March 3, 2017. Programmers must follow coding rules such as the secure coding standard and API of libraries that they use. Otherwise, programs may cause vulnerability or may not work properly. Therefore, source code checking tools have been developed to detect violations of coding rules or APIs. ASTgrep takes patterns of code fragments that violate rules as well as the source code to be checked, so it can detect violations of varieties of rules. It consists of two parts, the frontend and the backend; the frontend converts a C program into an abstract syntax tree represented in an S-expression (S-AST). The backend pattern matches between the pattern, which is also written in an S-expression and the S-AST generated by the frontend. Since the S-AST reflects only the syntactic information of the source code, it was not possible to express patterns of violations that depend on data-flow information, e.g., patterns of null dereferences. Therefore, we improved ASTgrep by enriching the S-AST with data-flow information so that we can express patterns that depend on data-flow information. Our improved ASTgrep performs data-flow analysis by using LLVM, and attaches its result to the S-AST. With the improved ASTgrep, we successfully described patterns and detected violations of some secure coding rules that we failed to detect with the previous ASTgrep.. 1. 2. 3. 京都大学工学部情報学科 Undergraduate School of Informatics and Mathematical Science, Faculty of Engineering, Kyoto University, Kyoto 606– 8501, Japan 京都大学大学院情報学研究科 Graduate School of Informatics, Kyoto University, Kyoto 606–8501, Japan 高知工科大学 Kochi University of Technology, Kami, Kochi 782–8502, Japan. c 2017 Information Processing Society of Japan . a) b) c). [email protected] [email protected] [email protected]. 6.

(2)

参照

関連したドキュメント

90年代に入ってから,クラブをめぐって新たな動きがみられるようになっている。それは,従来の

※IGF コード 5.5.1 5.5.2 燃料管. 機関区域の囲壁の内部のすべての燃料管は、 9.6

共通点が多い 2 。そのようなことを考えあわせ ると、リードの因果論は結局、・ヒュームの因果

わかりやすい解説により、今言われているデジタル化の変革と

【こだわり】 ある わからない ない 留意点 道順にこだわる.

3 主務大臣は、第一項に規定する勧告を受けた特定再利用

は︑公認会計士︵監査法人を含む︶または税理士︵税理士法人を含む︶でなければならないと同法に規定されている︒.

ぎり︑第三文の効力について疑問を唱えるものは見当たらないのは︑実質的には右のような理由によるものと思われ