Add support for `tss_t` thread local objects in Objects.qll
還沒有人認領這個 Issue。
評估
研究方向
先在 Objects.qll 中閱讀現有的 storage-duration 和 ObjectIdentity 支援,然後檢查 malloc、tss_create() 和 tss_get() 的建模方式。比較提議的 Locatable 重構與替代的 tss_t 物件設計。完成表示 tss_t 變數能同時公開持有鍵的物件和執行緒區域物件識別,而不會破壞現有的物件處理。
由索引模型根據 Issue 內容生成。
描述
Objects.qll has support for identifying objects with different storage durations (static, thread local, allocated, and automatic). However, its thread local object support is limited to _Thread_local variables.
Ideally, a tss_t variable would be recognizable as two objects:
- One object representing the variable holding the tss_t key. Usually this is an object with static lifetime.
- Another object identity for the thread local behind the
tss_t.
Unfortunately, tss_t currently extends Element, which means that it can't have two implementations of the ObjectIdentity class. Alternatively, calls to tss_get() could be considered ObjectIdentitys, however, that doesn't match the intention of the ObjectIdentity class/library, as the threadlocal is really identified by the tss_t.
The threadlocal object could be identified by the tss_create call (similarly to how we identify dynamic memory via malloc calls). But it probably makes more sense to have ObjectIdentity extend Locatable and then have a tss_t variable produce two ObjectIdentys.
Otherwise the tss_t object class will closely match the malloc object class, since malloc returns a pointer to the dynamic memory just like tss_get() returns a pointer to the thread local. Additional refactoring to share code here will be required.
- 主要語言
- CodeQL
- 星號
- 227
- 分支
- 82
- 平均合併
- 6 天 7 小時
- 30 天內合併 PR
- 9
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/codeql-coding-standards 的其他 Issue
-
false positive/false negative Stardard-MISRA-C++
難度 2/5 1-3 小時 新手友好度 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
難度 2/5 1-3 小時 新手友好度 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
難度 4/5 3-5 天 新手友好度 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph 未關閉false positive/false negative
難度 4/5 3-5 天 新手友好度 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
難度 3/5 1-2 天 新手友好度 65/100
github/codeql-coding-standards#1175 ·
查看 github/codeql-coding-standards 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 88/100
use-agent-os/agent-os#3314 ·
-
agentic-workflows
難度 1/5 1 小時以內 新手友好度 85/100
githubnext/rig#534 ·
-
documentation low-priority templates
難度 2/5 1-3 小時 新手友好度 85/100
jesseray718/openroot#87 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
難度 2/5 1-3 小時 新手友好度 84/100
-
enhancement
難度 2/5 1-3 小時 新手友好度 74/100
ReedClanton/NixOS#41 ·