You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "wengzhe (via GitHub)" <gi...@apache.org> on 2023/03/21 04:19:35 UTC

[GitHub] [nuttx-apps] wengzhe opened a new pull request, #1672: netutils/ftpc: Cancel wdog on error state in ftpc_reconnect.

wengzhe opened a new pull request, #1672:
URL: https://github.com/apache/nuttx-apps/pull/1672

   ## Summary
   The timer is for connect timeout, but is not cancelled on connect error, then it may be triggered after ftpc quit and cause heap-use-after-free.
   
   ## Impact
   ftpc won't trigger heap-use-after-free on connect failure now.
   
   ## Testing
   Manually
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx-apps] pkarashchenko commented on a diff in pull request #1672: netutils/ftpc: Cancel wdog on error state in ftpc_reconnect.

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #1672:
URL: https://github.com/apache/nuttx-apps/pull/1672#discussion_r1143014345


##########
netutils/ftpc/ftpc_connect.c:
##########
@@ -276,5 +276,6 @@ int ftpc_reconnect(FAR struct ftpc_session_s *session)
 errout_with_socket:
   ftpc_sockclose(&session->cmd);
 errout:
+  wd_cancel(&session->wdog);

Review Comment:
   Ok. L165 can be fixed by reordering of wd_start and socket init. But anyway let's keep it with is_active way



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx-apps] pkarashchenko commented on a diff in pull request #1672: netutils/ftpc: Cancel wdog on error state in ftpc_reconnect.

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #1672:
URL: https://github.com/apache/nuttx-apps/pull/1672#discussion_r1142950589


##########
netutils/ftpc/ftpc_connect.c:
##########
@@ -276,5 +276,6 @@ int ftpc_reconnect(FAR struct ftpc_session_s *session)
 errout_with_socket:
   ftpc_sockclose(&session->cmd);
 errout:
+  wd_cancel(&session->wdog);

Review Comment:
   Maybe better to add this in an error case of socket connect since watchdog is already canceled in case of other errors?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx-apps] acassis merged pull request #1672: netutils/ftpc: Cancel wdog on error state in ftpc_reconnect.

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #1672:
URL: https://github.com/apache/nuttx-apps/pull/1672


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx-apps] wengzhe commented on a diff in pull request #1672: netutils/ftpc: Cancel wdog on error state in ftpc_reconnect.

Posted by "wengzhe (via GitHub)" <gi...@apache.org>.
wengzhe commented on code in PR #1672:
URL: https://github.com/apache/nuttx-apps/pull/1672#discussion_r1143004094


##########
netutils/ftpc/ftpc_connect.c:
##########
@@ -276,5 +276,6 @@ int ftpc_reconnect(FAR struct ftpc_session_s *session)
 errout_with_socket:
   ftpc_sockclose(&session->cmd);
 errout:
+  wd_cancel(&session->wdog);

Review Comment:
   Previously I found `wd_cancel` has checked `WDOG_ISACTIVE` so I didn't check it. Now add this check back.
   
   Error cases between L165 and L217 will need `wd_cancel`, currently two cases, but not sure if others may add more in the future, so I'd like to add cancel in a common place, with a check outside.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org