This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
forked from Netatalk/netatalk
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add handling for cases where ad_entry() returns NULL
With recent CVE fixes, ad_enty() may now return NULL. This commit adds basic error handling for these cases and asserting where such a return is totally unexpected. In case of ad_getid() and ad_forcegetid(), return CNID_INVALID rather than 0 to clarify for future people investigating this that a 0 here is an indication of error. In case of new_ad_header(), the valid_data_len of the adouble data may still be zero. Since we're initializing fresh here with OS-provided data from lstat() call, temporarily override the size check prior to calling ad_entry() (otherwise we will get NULL value unexpectedly here). Once new header is generated, reset original value of valid_data_len. Signed-off-by: Andrew Walker <[email protected]>
- Loading branch information
Showing
7 changed files
with
195 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
c754d46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgsga Have you found a pattern with which your crashes occur? On my fork (2.x) I have seen recurring errors with dsi_stream when connecting over DSI specifically (however for whatever reason I haven't seen those crashes on Netatalk 2.2 proper.) DDP works perfectly. Is this what you're seeing as well?
c754d46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgsga Oh wait, if your fork is 3.1 based you shouldn't be using my patch above. It's a backport for the 2.2 codebase specifically. Please use the patch in Netatalk#174 !
c754d46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I suggest you report this over at the PR, ideally with reproduction steps for upstream 3.1? Andrew is probably the best person to address remaining issues.
c754d46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that the same fix that you see at the bottom of my patchset here:
https://github.com/Netatalk/Netatalk/pull/174/files
c754d46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That patchset evolved some as I was testing (and finding bugs). At the conclusion I did a final force-push that squashed all the changes. You probably grabbed an earlier revision.