Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying ignores is racy leading to potential nil deref #4300

Closed
imsodin opened this issue Aug 11, 2017 · 0 comments
Closed

Querying ignores is racy leading to potential nil deref #4300

imsodin opened this issue Aug 11, 2017 · 0 comments
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Comments

@imsodin
Copy link
Member

imsodin commented Aug 11, 2017

https://forum.syncthing.net/t/reason-for-panic-maybe-too-little-ram/10346

The lock is not held between getting the value for the queried folder from folderCfgs and from folderIgnores. Therefore the latter does not necessarily exist and it's existence isn't checked.

PR incoming.

imsodin added a commit to imsodin/syncthing that referenced this issue Aug 11, 2017
In addition this function returned an error when .stignore file was not
present, which is perfectly valid. Also removed inconsistent nil check in
ignores.go (only relevant for tests) and adjusted walk.go to do what it says
in comments (check if Matcher is nil) to prevent nil deref in tests.

Originally reported in:
https://forum.syncthing.net/t/reason-for-panic-maybe-too-little-ram/10346

Regression from syncthing#3996
viable-hartman pushed a commit to viable-hartman/syncthing that referenced this issue Aug 25, 2017
In addition this function returned an error when .stignore file was not
present, which is perfectly valid. Also removed inconsistent nil check in
ignores.go (only relevant for tests) and adjusted walk.go to do what it says
in comments (check if Matcher is nil) to prevent nil deref in tests.

Originally reported in:
https://forum.syncthing.net/t/reason-for-panic-maybe-too-little-ram/10346

Regression from syncthing#3996

GitHub-Pull-Request: syncthing#4301
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Sep 10, 2018
@syncthing syncthing locked and limited conversation to collaborators Sep 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

No branches or pull requests

2 participants