{"id":50944352,"url":"https://github.com/zolutal/kheap_sift","last_synced_at":"2026-06-17T18:08:17.226Z","repository":{"id":215568241,"uuid":"739255272","full_name":"zolutal/kheap_sift","owner":"zolutal","description":"A tool combining DWARF info and source to search for kernel heap objects","archived":false,"fork":false,"pushed_at":"2025-12-23T19:47:28.000Z","size":57,"stargazers_count":24,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T09:51:53.616Z","etag":null,"topics":["dwarf","heap-exploitation","linux-kernel"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zolutal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-05T06:05:41.000Z","updated_at":"2025-12-23T19:47:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"8cbe7748-9dbc-48c9-ac4d-8ad03f64416e","html_url":"https://github.com/zolutal/kheap_sift","commit_stats":null,"previous_names":["zolutal/kheap_sift"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zolutal/kheap_sift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zolutal%2Fkheap_sift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zolutal%2Fkheap_sift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zolutal%2Fkheap_sift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zolutal%2Fkheap_sift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zolutal","download_url":"https://codeload.github.com/zolutal/kheap_sift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zolutal%2Fkheap_sift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34459830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dwarf","heap-exploitation","linux-kernel"],"created_at":"2026-06-17T18:08:16.427Z","updated_at":"2026-06-17T18:08:17.219Z","avatar_url":"https://github.com/zolutal.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kheap_sift\n\nA utility for finding Linux kernel heap objects of desired sizes.\n\nThis tool combines DWARF type information parsed from a vmlinux file using [dwat](https://github.com/zolutal/dwat), and source code pattern matching using [tree-sitter](https://tree-sitter.github.io/tree-sitter/).\n\n# Usage\n\n```\nUsage: kheap_sift [OPTIONS] \u003cVMLINUX_PATH\u003e \u003cSOURCE_PATH\u003e \u003cLOWER_BOUND\u003e \u003cUPPER_BOUND\u003e\n\nArguments:\n  \u003cVMLINUX_PATH\u003e  The path to the vmlinux file.\n  \u003cSOURCE_PATH\u003e   The path to the Linux source code directory.\n  \u003cLOWER_BOUND\u003e   The lower bound for struct sizes (exclusive).\n  \u003cUPPER_BOUND\u003e   The upper bound for struct sizes (inclusive).\n\nOptions:\n      --quiet              Silence most output, only print struct names when allocation sites are found.\n      --flags \u003cFLAGS\u003e      Regex filter on the allocation flags argument.\n      --exclude \u003cEXCLUDE\u003e  Glob to exclude files based on, can be specified multiple times.\n      --threads \u003cTHREADS\u003e  Number of threads to scale up to.\n  -h, --help               Print help\n```\n\n## Example Output/Usage\n\n```\n┌──(jmill@ubun)-[~/repos/kheap_sift]\n└─$ kheap_sift ~/linux/vmlinux ~/linux 96 128\n======== Found allocation sites for: struct bpf_array_aux ========\n\nstruct bpf_array_aux {\n    struct list_head poke_progs;                \t/*   16 |    0 */\n    struct bpf_map *map;                        \t/*    8 |   16 */\n    struct mutex poke_mutex;                    \t/*   56 |   24 */\n    struct work_struct work;                    \t/*   32 |   80 */\n\n    /* total size: 112 */\n};\n\n/home/jmill/linux/kernel/bpf/arraymap.c:1109\nstatic struct bpf_map *prog_array_map_alloc(union bpf_attr *attr)\n{\n\tstruct bpf_array_aux *aux;\n\tstruct bpf_map *map;\n\n\taux = kzalloc(sizeof(*aux), GFP_KERNEL_ACCOUNT);\n\tif (!aux)\n\t\treturn ERR_PTR(-ENOMEM);\n...\n\n\treturn map;\n```\n\n```\n┌──(jmill@ubun)-[~/repos/kheap_sift]\n└─$ kheap_sift ~/linux-6.6.7/vmlinux ~/linux-6.6.7 128 256 --exclude '*/drivers/**/*' --flags \"GFP_KERNEL$\" --threads 16\n======== Found allocation site for: struct deflate_ctx ========\n\nstruct deflate_ctx {\n    struct z_stream_s comp_stream;              \t/*   96 |    0 */\n    struct z_stream_s decomp_stream;            \t/*   96 |   96 */\n\n    /* total size: 192 */\n};\n\n/home/jmill/linux-6.6.7/crypto/deflate.c:115\nstatic void *deflate_alloc_ctx(struct crypto_scomp *tfm)\n...\n\tstruct deflate_ctx *ctx;\n...\n\tctx = kzalloc(sizeof(*ctx), GFP_KERNEL);\n...\n\treturn ctx;\n}\n```\n\n# Contributing\n\nFeel free to open issues/PRs for improvements!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzolutal%2Fkheap_sift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzolutal%2Fkheap_sift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzolutal%2Fkheap_sift/lists"}