Skip to content

Kernel source summarization#6963

Draft
ramosian-glider wants to merge 7 commits intogoogle:masterfrom
ramosian-glider:syz-glance
Draft

Kernel source summarization#6963
ramosian-glider wants to merge 7 commits intogoogle:masterfrom
ramosian-glider:syz-glance

Conversation

@ramosian-glider
Copy link
Copy Markdown
Member


Before sending a pull request, please review Contribution Guidelines:
https://github.com/google/syzkaller/blob/master/docs/contributing.md


@tarasmadan
Copy link
Copy Markdown
Collaborator

@gemini-cli /review

@tarasmadan
Copy link
Copy Markdown
Collaborator

@gemini-cli /review

@tarasmadan
Copy link
Copy Markdown
Collaborator

@gemini-cli /review

@github-actions
Copy link
Copy Markdown

🤖 Hi @tarasmadan, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

## 📋 Review Summary

This PR introduces a Just-In-Time (JIT) summarization system using Clang AST parsing and LLM-based semantic analysis for the Linux kernel. The implementation is well-structured and makes good use of libclang to minimize the context sent to the LLM, though there are a few critical issues around slice modification and environment-specific artifacts that need to be resolved.

🔍 General Feedback

  • Slices and Pointers: Be cautious when taking pointers to elements of a slice that is subsequently modified (e.g., via slices.DeleteFunc), as this can lead to memory corruption or unexpected zero values.
  • Environment Artifacts: Several absolute symlinks to .so files for LLVM 19 were checked into the repository (e.g., libclang-cpp.so, libclang.so). These should be removed, as they will break on machines where LLVM is installed in a different directory. Ensure the build scripts or Makefile correctly link against libclang instead.
  • Cleanups: There are some leftover debug print statements (llvm::errs() and echo "DEBUG: ...") that should be removed to reduce noise during normal execution.

Comment on lines +68 to +71
var templateCmd *compileCommand
if len(cmds) > 0 {
templateCmd = &cmds[0]
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Taking a pointer to an element of a slice before modifying the slice in-place with `slices.DeleteFunc` is unsafe. `slices.DeleteFunc` shifts elements and zero-values the tail. If all elements are deleted, `cmds[0]` will be overwritten with a zero value, causing `templateCmd` to point to a zeroed-out struct. We should make a copy of the command instead.
Suggested change
var templateCmd *compileCommand
if len(cmds) > 0 {
templateCmd = &cmds[0]
}
var templateCmd *compileCommand
if len(cmds) > 0 {
cmdCopy := cmds[0]
templateCmd = &cmdCopy
}

Comment on lines +87 to +91
echo "DEBUG: PRE DOCKER RUN"
if [ -t 0 ]; then
DOCKERARGS="$DOCKERARGS -it"
fi
echo "DEBUG: CI: '$CI'"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 These debug prints should be removed before merging. Additionally, the `if [ -t 0 ]` check is duplicated; `-it` is already appended to `DOCKERARGS` conditionally earlier in the script.
Suggested change
echo "DEBUG: PRE DOCKER RUN"
if [ -t 0 ]; then
DOCKERARGS="$DOCKERARGS -it"
fi
echo "DEBUG: CI: '$CI'"

CharSourceRange FilenameRange, OptionalFileEntryRef File, StringRef SearchPath,
StringRef RelativePath, const Module* SuggestedModule, bool ModuleImported,
SrcMgr::CharacteristicKind FileType) override {
llvm::errs() << "DEBUG: InclusionDirective: " << FileName << " InMain: " << SM.isInMainFile(HashLoc) << "\n";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 This debug print should be removed before merging as it will log every inclusion directive, causing excessive noise.
Suggested change
llvm::errs() << "DEBUG: InclusionDirective: " << FileName << " InMain: " << SM.isInMainFile(HashLoc) << "\n";

@@ -0,0 +1 @@
/usr/lib/llvm-19/lib/libLLVM.so.19.1 No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Committing absolute symlinks to specific environment paths (e.g., `/usr/lib/llvm-19/...`) breaks cross-platform compatibility and will fail on machines without this exact path. These libraries should be linked dynamically during the build process instead.

@tarasmadan
Copy link
Copy Markdown
Collaborator

@gemini-cli /approve

@github-actions
Copy link
Copy Markdown

🤖 Hi @tarasmadan, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions
Copy link
Copy Markdown

I could not find an approved "AI Assistant: Plan of Action" in the issue comments. Please provide or approve a plan of action so I can proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants