Week 1Introduction to Program Analysis
### 📖 核心知识点:程序分析导论 课程介绍程序分析的目标和方法论。学习为什么需要自动化工具来检测 Bug 和安全漏洞(人工代码审查的局限性)。了解 Static Analysis(不运行程序)vs Dynamic Analysis(运行程序)的基本区别。概览课程将涉及的技术:Abstract Interpretation, Symbolic Execution, Fuzzing, Taint Analysis。 - **核心概念/公式**: Soundness (不遗漏) vs Completeness (不误报) 的权衡、Rice's Theorem (程序的非平凡属性不可判定)、Approximation 的必要性 ⏰ **本周节奏**: 难度 ⭐⭐⭐ | 预计投入 8h(PBL 1h + Lecture 1h + Workshop 1h + 自学 5h) 🎯 **考试关联**: Final Exam (60%, Hurdle ≥40%) 会考 Soundness/Completeness 的概念辨析。Concept Quiz (10%, Best 3 of 4)。 🧪 **Workshop**: 安装和配置程序分析工具链。探索开源项目中的已知 Bug 案例。 📌 **作业关联**: 理解分析方法的分类为 Assignment 1 (Static Analysis, 20%) 和 Assignment 2 (Dynamic Analysis, 10%) 奠定基础。 ⚠️ **易错点**: Sound 分析可能有误报 (False Positive) 但不会遗漏;Complete 分析可能遗漏但不会误报;实际工具通常既不完全 Sound 也不完全 Complete。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第1周生成 5 道练习题并给出解题步骤
Week 2Abstract Interpretation & Lattice Theory
### 📖 核心知识点:抽象解释与格论基础 学习 Abstract Interpretation 的理论框架。掌握 Lattice (格) 的数学定义:Partial Order, Join (⊔), Meet (⊓), Top (⊤), Bottom (⊥)。学习 Abstract Domain 的概念:将无限的程序状态映射到有限的抽象值。了解 Galois Connection (α, γ) 连接具体域和抽象域。 - **核心概念/公式**: Lattice 的偏序关系 ⊑、Galois Connection: α(concrete) → abstract, γ(abstract) → concrete、Widening 操作加速不动点收敛 ⏰ **本周节奏**: 难度 ⭐⭐⭐⭐⭐ | 预计投入 10h(PBL 1h + Lecture 1h + Workshop 1h + 自学 7h)🔥 高压周 🎯 **考试关联**: Lattice 和 Abstract Interpretation 的理论是 Final Exam 的核心考点。 🧪 **Workshop**: 在纸上手工执行 Sign Domain ({-, 0, +, ⊤, ⊥}) 的抽象解释分析。 📌 **作业关联**: Concept Quiz 1 (Due Week 3) 覆盖本周内容。 ⚠️ **易错点**: Join 和 Meet 的方向容易搞反(Join 是最小上界 LUB,Meet 是最大下界 GLB);Widening 可能导致精度大幅损失;Galois Connection 的 α 和 γ 的关系不是简单的逆函数。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第2周生成 5 道练习题并给出解题步骤
Week 3Control Flow & Data Flow Analysis
### 📖 核心知识点:控制流与数据流分析 学习 Control Flow Graph (CFG) 的构建方法。掌握 Data Flow Analysis 的经典框架:Reaching Definitions, Live Variables, Available Expressions。学习 Worklist Algorithm 迭代计算数据流方程到不动点。 - **核心概念/公式**: CFG 的 Basic Block 划分规则、Data Flow Equations: OUT[B] = GEN[B] ∪ (IN[B] - KILL[B])、Forward vs Backward Analysis、Chaotic Iteration ⏰ **本周节奏**: 难度 ⭐⭐⭐⭐ | 预计投入 9h(PBL 1h + Lecture 1h + Workshop 1h + 自学 6h) 🎯 **考试关联**: 数据流分析的手工计算是 Final Exam 的高频考题。Concept Quiz 1 截止。 🧪 **Workshop**: 手工构建 CFG 并计算 Reaching Definitions 和 Live Variables。 📌 **作业关联**: Concept Quiz 1 (2.5%, Due July 31) 截止。 ⚠️ **易错点**: Forward Analysis (如 Reaching Definitions) 和 Backward Analysis (如 Live Variables) 的方向容易搞混;GEN/KILL 集合的计算需要精确;迭代到不动点时忘记检查所有 Basic Block。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第3周生成 5 道练习题并给出解题步骤
Week 4Pointer Analysis & Alias Analysis
### 📖 核心知识点:指针分析与别名分析 学习 Pointer Analysis 的基本方法:Flow-insensitive, Flow-sensitive, Context-sensitive 的区别和精度/效率权衡。掌握 Andersen's Analysis 和 Steensgaard's Analysis 的基本原理。理解 Points-to Set 和 Alias Pair 的概念。 - **核心概念/公式**: Points-to Set: pts(p) = {o1, o2, ...}、Andersen's (Inclusion-based, O(n³)) vs Steensgaard's (Unification-based, O(nα(n)))、May-alias vs Must-alias ⏰ **本周节奏**: 难度 ⭐⭐⭐⭐⭐ | 预计投入 10h(PBL 1h + Lecture 1h + Workshop 1h + 自学 7h)🔥 高压周 🎯 **考试关联**: Pointer Analysis 的算法和精度对比是 Final Exam 的重要内容。 🧪 **Workshop**: 手工执行 Andersen's Analysis 构建 Points-to Graph。 📌 **作业关联**: Assignment 1 (Static Analysis, 20%) 可能涉及 Pointer Analysis 工具的使用。 ⚠️ **易错点**: Flow-insensitive 分析忽略语句执行顺序,结果比 Flow-sensitive 更粗糙(更多 False Positive);Steensgaard 的 Unification 是不可逆的(合并后不能拆分)。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第4周生成 5 道练习题并给出解题步骤
Week 5Static Analysis Tools & Practical Application
### 📖 核心知识点:静态分析工具与实际应用 学习工业级静态分析工具的工作原理和使用方法。掌握 Facebook Infer、Coverity、SonarQube 等工具的特点和适用场景。学习如何解读分析报告、判断 True Positive vs False Positive,以及如何对分析结果进行 Triage(分类处理)。 - **核心概念/公式**: Bug Pattern Database、False Positive Rate 指标、Incremental Analysis(只分析变更代码)、CI/CD 集成分析 ⏰ **本周节奏**: 难度 ⭐⭐⭐ | 预计投入 8h(PBL 1h + Lecture 1h + Workshop 1h + 自学 5h) 🎯 **考试关联**: 静态分析工具的能力和局限性是 Final Exam 的分析题内容。Concept Quiz 2 (Due Week 6)。 🧪 **Workshop**: 使用 Infer 分析开源 Java 项目,分类分析结果为 True/False Positive。 📌 **作业关联**: Assignment 1 (Static Analysis, 20%, Due Oct 3) 需要扩展或比较静态分析工具。 ⚠️ **易错点**: 工具报告的警告并非都是真 Bug(需要人工确认);配置不当导致大量 False Positive 淹没真正的问题;不同工具对同一代码分析结果可能不同。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第5周生成 5 道练习题并给出解题步骤
Week 6Dynamic Analysis & Runtime Monitoring
### 📖 核心知识点:动态分析与运行时监控 学习 Dynamic Analysis 的方法论——通过运行程序来检测错误。掌握 Instrumentation(代码插桩)技术:Source-level 和 Binary-level。学习 Valgrind (Memory Error Detection)、AddressSanitizer、ThreadSanitizer 等工具。了解 Runtime Monitoring 和 Assertion Checking。 - **核心概念/公式**: Code Instrumentation 的 Overhead 评估、Valgrind 的 Shadow Memory 技术、AddressSanitizer 的 Red Zone 检测 Buffer Overflow ⏰ **本周节奏**: 难度 ⭐⭐⭐⭐ | 预计投入 9h(PBL 1h + Lecture 1h + Workshop 1h + 自学 6h) 🎯 **考试关联**: 动态分析方法和工具的原理是考试内容。Concept Quiz 2 截止。 🧪 **Workshop**: 使用 Valgrind 和 ASan 检测 C 程序中的内存错误(Use-after-free, Buffer Overflow, Memory Leak)。 📌 **作业关联**: Concept Quiz 2 (2.5%, Due Aug 13) 截止。Assignment 2 (Dynamic Analysis, 10%) 准备开始。 ⚠️ **易错点**: Dynamic Analysis 只能检测被执行到的代码路径中的 Bug(Coverage 依赖输入质量);Valgrind 导致程序减速 10-50 倍;ASan 和 TSan 不能同时使用(冲突)。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第6周生成 5 道练习题并给出解题步骤
Week 7Symbolic Execution
### 📖 核心知识点:符号执行 学习 Symbolic Execution 的核心思想——用符号值替代具体值执行程序。掌握 Path Condition 的构建和 Constraint Solving (SMT Solver: Z3)。了解 Concolic Execution (Concrete + Symbolic) 的优势。学习 KLEE、angr 等符号执行工具。 - **核心概念/公式**: Symbolic State = (Path Condition, Symbolic Store)、Path Explosion Problem: 路径数随分支指数增长、Concolic Execution 的 Concrete 引导策略 ⏰ **本周节奏**: 难度 ⭐⭐⭐⭐⭐ | 预计投入 10h(PBL 1h + Lecture 1h + Workshop 1h + 自学 7h)🔥 高压周 🎯 **考试关联**: 符号执行的原理、Path Condition 构建和 Path Explosion 问题是 Final Exam 高频考点。 🧪 **Workshop**: 手工对简单程序进行符号执行,构建 Path Condition 并用 Z3 求解测试输入。 📌 **作业关联**: Concept Quiz 3 (Due Week 8) 覆盖符号执行内容。 ⚠️ **易错点**: Path Explosion 是符号执行的最大挑战(循环和递归导致无限路径);SMT Solver 对非线性约束的求解能力有限;外部函数调用(如系统调用)需要特殊处理(模拟或具体化)。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第7周生成 5 道练习题并给出解题步骤
Week 8Fuzzing & Automated Test Generation
### 📖 核心知识点:模糊测试与自动化测试生成 学习 Fuzzing(模糊测试)的基本原理。掌握 Coverage-guided Fuzzing (AFL/libFuzzer) 的反馈驱动机制。学习 Mutation-based vs Generation-based Fuzzing 的区别。了解 Hybrid Fuzzing(结合 Symbolic Execution 和 Fuzzing)。 - **核心概念/公式**: Coverage-guided Mutation: Seed → Mutate → Execute → Collect Coverage → Corpus Update、Edge Coverage vs Block Coverage、AFL 的 Fork Server 优化 ⏰ **本周节奏**: 难度 ⭐⭐⭐⭐ | 预计投入 9h(PBL 1h + Lecture 1h + Workshop 1h + 自学 6h) 🎯 **考试关联**: Fuzzing 的工作流程和 Coverage 反馈机制是考试内容。Concept Quiz 3 截止。 🧪 **Workshop**: 使用 AFL++ 对有漏洞的 C 程序进行 Fuzzing,找到 Crash Input。 📌 **作业关联**: Concept Quiz 3 (2.5%, Due Aug 28) 截止。 ⚠️ **易错点**: Fuzzing 是随机过程,结果不可重复;Coverage 饱和后难以发现新路径(需要更好的 Mutation 策略);Crash 不一定是安全漏洞(需要可利用性分析)。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第8周生成 5 道练习题并给出解题步骤
Week 9Taint Analysis & Information Flow
### 📖 核心知识点:污点分析与信息流 学习 Taint Analysis 追踪不可信输入在程序中的传播。掌握 Source (污点源: 用户输入)、Sink (敏感操作: SQL 执行、文件写入)、Sanitizer (净化器) 的模型。学习 Forward Taint (Data Leakage 检测) 和 Backward Taint (Root Cause 分析)。 - **核心概念/公式**: Taint Propagation Rules: x = y + z → taint(x) = taint(y) ∪ taint(z)、Implicit Flow (条件分支导致的间接污染)、Over-tainting vs Under-tainting ⏰ **本周节奏**: 难度 ⭐⭐⭐⭐ | 预计投入 9h(PBL 1h + Lecture 1h + Workshop 1h + 自学 6h) 🎯 **考试关联**: Taint Analysis 的规则和 Source-Sink 模型是考试内容。Concept Quiz 4 (Due Week 10)。 🧪 **Workshop**: 使用 Taint Analysis 工具检测 Web 应用中的 SQL Injection 和 XSS 漏洞路径。 📌 **作业关联**: Assignment 1 (Static Analysis, 20%, Due Oct 3) 截止在即。 ⚠️ **易错点**: Implicit Flow 很难精确追踪(if(tainted) x=1 中 x 被间接污染);Over-tainting 导致大量 False Positive;Sanitizer 的有效性分析不容易(某些 Sanitizer 可能被绕过)。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第9周生成 5 道练习题并给出解题步骤
Week 10Concurrency Bug Detection
### 📖 核心知识点:并发Bug检测 学习并发程序的特殊缺陷类型和检测方法。掌握 Data Race 的定义和 Happens-Before 关系。学习 Data Race Detector (ThreadSanitizer/Eraser Algorithm) 的工作原理。了解 Deadlock Detection (Lock Order Graph) 和 Atomicity Violation 检测。 - **核心概念/公式**: Data Race: 两个线程并发访问同一内存位置且至少一个是写操作、Lockset Algorithm: 交集为空则报告潜在 Race、Happens-Before Relation ⏰ **本周节奏**: 难度 ⭐⭐⭐⭐ | 预计投入 9h(PBL 1h + Lecture 1h + Workshop 1h + 自学 6h) 🎯 **考试关联**: 并发 Bug 的分类和检测方法是考试内容。Assignment 1 截止。Concept Quiz 4 截止。 🧪 **Workshop**: 使用 ThreadSanitizer 检测多线程 C++ 程序中的 Data Race 和 Deadlock。 📌 **作业关联**: Assignment 1 (20%, Due Oct 3) 截止提交。Concept Quiz 4 (2.5%, Due Sep 11) 截止。 ⚠️ **易错点**: Not all Data Races are bugs(但几乎所有都应该修复);Happens-Before 分析可能遗漏依赖特定调度顺序才出现的 Race;Lockset 分析的 False Positive 率较高。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第10周生成 5 道练习题并给出解题步骤
Week 11Security Vulnerability Detection
### 📖 核心知识点:安全漏洞检测 学习常见安全漏洞的自动化检测方法。掌握 Buffer Overflow (Stack/Heap)、Use-After-Free、Integer Overflow 的检测技术。学习 CWE (Common Weakness Enumeration) 分类体系。了解漏洞利用的基本原理(为理解防御):Stack Smashing, ROP Chain。 - **核心概念/公式**: Stack Buffer Overflow 的利用原理(覆写返回地址)、防御机制 (Stack Canary, ASLR, DEP/NX)、CWE Top 25 常见漏洞 ⏰ **本周节奏**: 难度 ⭐⭐⭐⭐ | 预计投入 9h(PBL 1h + Lecture 1h + Workshop 1h + 自学 6h) 🎯 **考试关联**: 安全漏洞类型和检测方法是 Final Exam 的考查内容。 🧪 **Workshop**: 分析含有安全漏洞的代码样本,使用静态和动态工具检测漏洞。 📌 **作业关联**: Assignment 2 (Dynamic Analysis, 10%, Due Oct 25) 截止在即。 ⚠️ **易错点**: 安全漏洞的严重性取决于可利用性(不是所有 Buffer Overflow 都可利用);防御机制可以被绕过(ASLR + Info Leak);检测工具可能遗漏某些漏洞类型。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第11周生成 5 道练习题并给出解题步骤
Week 12Advanced Topics & Tool Comparison Review
### 📖 核心知识点:高级主题与工具对比总复习 学习前沿的程序分析技术:Machine Learning for Bug Detection、Probabilistic Program Analysis。进行课程全面回顾,对比各种分析技术的 Soundness、Completeness、Scalability、Precision 四个维度。 - **核心概念/公式**: 分析技术对比矩阵 (Static/Dynamic/Symbolic/Fuzzing × Sound/Complete/Scalable/Precise)、ML-based Bug Detection 的 Training Data 偏差问题 ⏰ **本周节奏**: 难度 ⭐⭐⭐ | 预计投入 10h(PBL 1h + Lecture 1h + Workshop 1h + 自学 7h)📝 复习周 🎯 **考试关联**: Final Exam (60%, Hurdle ≥40%) 120 分钟闭卷(可带一张双面 A4 笔记)。覆盖全部 12 周。重点:Abstract Interpretation/Data Flow (25%)、Symbolic Execution (20%)、Fuzzing (15%)、Taint Analysis (15%)、Concurrency/Security (15%)、概念对比 (10%)。 🧪 **Workshop**: 最后一次 Workshop,往年真题练习和疑难答疑。 📌 **作业关联**: Assignment 2 (10%, Due Oct 25) 截止。所有 Concept Quiz (Best 3 of 4, 10%) 已完成。 ⚠️ **易错点**: 考试可带一张 A4 笔记纸(双面),需要提前精心整理;分析技术的对比题需要从多个维度综合回答;具体工具的操作细节不是考试重点,重点是理论原理。 (数据来源:2024 S2 UQ Course Profile,CSSE4630)
TuesdayLectureThelectureeachweekwillbeusedto
💡 学习提示
• 总结 Tuesday Lecture The lecture each week will be used to introduce new material and to work through examples. This lecture will be face-to-face, but recorded for students who cannot join the live class. 的核心概念与适用场景
• 为第12周生成 5 道练习题并给出解题步骤