Skip to content

Conversation

@joeyjiaojg
Copy link
Contributor


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


@codecov
Copy link

codecov bot commented Jul 12, 2021

Codecov Report

Merging #2659 (02c4035) into master (8f5a7b8) will decrease coverage by 0.0%.
The diff coverage is 8.0%.

Impacted Files Coverage Δ
pkg/cover/backend/backend.go 0.0% <0.0%> (ø)
pkg/cover/backend/dwarf.go 0.0% <0.0%> (ø)
pkg/cover/backend/elf.go 0.0% <0.0%> (ø)
pkg/cover/backend/mach-o.go 0.0% <0.0%> (ø)
syz-manager/cover.go 28.6% <0.0%> (ø)
pkg/cover/report.go 82.0% <100.0%> (ø)

// in cleanPath function, if path in elf is common/drivers/something.c
// then path will be changed to ../../kernel_platform/common/drivers/something.c,
// and filename will be kernel_src + /../../kernel_platform/common/drivers/something.c
CleanRules []string `json:"clean_rules,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

I remember when you added "module_obj" we discussed that that is an incomplete scheme and to properly calculate source paths, we would need to add an array that will contain obj/src/build dirs. Along the lines of:

  Modules []struct{
    Obj string
    Src string
    BuildSrc string
  }

If that works, it would be preferable because it extends the existing scheme to modules (implements what's currently not implemented) rather than introduces a whole new layer of complexity on top.
If it doesn't work, I would like to understand why.
Note that modules are not necessary placed relative to the kernel dir.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually that won't work and too complicated to support even Android different versions while the current PR implementation is much simple and support old or new OSes.

I only need to add 2 or 3 rules to fit for all modules. (even in Android S, there are two kernel trees which can be fixed by the PR with these 2 or 3 rules)

About why, there can be multiple kind of paths even inside one module. for example one module I have which can be decoded to have such file paths: (aussming kernel_src is /path_to_build/kernel_platform/common, kernel_build_src is /path_to_build/out/XXX/common)

/path_to_build/xxx/ccc.c // abosulate path for out of tree modules
Another_kernel_tree/aaa/bbb/ccc.c // relative path to another kernel tree but having Another_kernel_tree prefix
../../kernel_platform/la/ddd/ccc.c // la is a soft link to some other level of directory
../../../path_to_some_other_dir // another kind of relative path without soft link

And the clean_rules can be simple to fit for all modules, user can easily find the rules by check /rawcoverfiles or just decode the paths in all the modules/vmlinux. (Also, if there is any issue, when DoHTML shown, it will report can not open/load error for file path too).

  "clean_rules": [
     "/path_to_build/out/XXX/Another_kernel_tree/Another_kernel_tree:../../kernel_platform/Another_kernel_tree",
     "Another_kernel_tree:../../kernel_platform/Another_kernel_tree",
     "../la:../..",
     "../../..:../.."
  ],

For in-tree-module + one kernel tree (the current OSes), no impact by the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And one more note is that I got 300+ modules loaded, it doesn't seem to be reasonable to add 300+ BuildSrc for modules in config.

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