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

Handle the case when target disappears instead of reactivating #11

Merged
merged 1 commit into from Sep 25, 2023

Conversation

monich
Copy link
Member

@monich monich commented Sep 24, 2023

Avoid this use-after-free scenario:

Invalid read of size 8
  at 0x1115AD: nfc_target_reactivate_request_timeout_ms (nfc_target.c:325)
  by 0x112002: nfc_target_submit_request (nfc_target.c:707)
  by 0x1120D7: nfc_target_submit_next_request (nfc_target.c:732)
  by 0x11282C: nfc_target_reactivate (nfc_target.c:1001)
  ...
Address 0x4ec9648 is 24 bytes inside a block of size 64 free'd
  at 0x484B27F: free
  by 0x11174E: nfc_target_reactivate_request_free (nfc_target.c:395)
  by 0x111C59: nfc_target_free_request (nfc_target.c:603)
  by 0x111C95: nfc_target_fail_request (nfc_target.c:614)
  by 0x11223D: nfc_target_fail_requests (nfc_target.c:783)
  by 0x112BDD: nfc_target_gone_handler (nfc_target.c:1152)
  by 0x112B64: nfc_target_gone (nfc_target.c:1114)
  ...
  by 0x111513: nfc_target_reactivate_request_submit (nfc_target.c:302)
  by 0x111FED: nfc_target_submit_request (nfc_target.c:706)
  by 0x1120D7: nfc_target_submit_next_request (nfc_target.c:732)
  by 0x11282C: nfc_target_reactivate (nfc_target.c:1001)
  ...
Block was alloc'd at
  at 0x4848899: malloc
  by 0x11177B: nfc_target_reactivate_request_new (nfc_target.c:420)
  by 0x112805: nfc_target_reactivate (nfc_target.c:997)
  ...

Avoid this use-after-free scenario:

Invalid read of size 8
  at 0x1115AD: nfc_target_reactivate_request_timeout_ms (nfc_target.c:325)
  by 0x112002: nfc_target_submit_request (nfc_target.c:707)
  by 0x1120D7: nfc_target_submit_next_request (nfc_target.c:732)
  by 0x11282C: nfc_target_reactivate (nfc_target.c:1001)
  ...
Address 0x4ec9648 is 24 bytes inside a block of size 64 free'd
  at 0x484B27F: free
  by 0x11174E: nfc_target_reactivate_request_free (nfc_target.c:395)
  by 0x111C59: nfc_target_free_request (nfc_target.c:603)
  by 0x111C95: nfc_target_fail_request (nfc_target.c:614)
  by 0x11223D: nfc_target_fail_requests (nfc_target.c:783)
  by 0x112BDD: nfc_target_gone_handler (nfc_target.c:1152)
  by 0x112B64: nfc_target_gone (nfc_target.c:1114)
  ...
  by 0x111513: nfc_target_reactivate_request_submit (nfc_target.c:302)
  by 0x111FED: nfc_target_submit_request (nfc_target.c:706)
  by 0x1120D7: nfc_target_submit_next_request (nfc_target.c:732)
  by 0x11282C: nfc_target_reactivate (nfc_target.c:1001)
  ...
Block was alloc'd at
  at 0x4848899: malloc
  by 0x11177B: nfc_target_reactivate_request_new (nfc_target.c:420)
  by 0x112805: nfc_target_reactivate (nfc_target.c:997)
  ...
@monich
Copy link
Member Author

monich commented Sep 25, 2023

Thanks!

@monich monich merged commit f9ebb45 into sailfishos:master Sep 25, 2023
@monich monich deleted the reactivate-gone branch September 25, 2023 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants