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

Misuse of task_info API may cause crashes #25243

Closed
avivkiss opened this issue Jun 12, 2019 · 3 comments
Closed

Misuse of task_info API may cause crashes #25243

avivkiss opened this issue Jun 12, 2019 · 3 comments
Labels
Bug Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@avivkiss
Copy link

Re the use of task_info @

mach_msg_type_number_t size = sizeof(info);

The task_info API requires an in-out task_info_count parameter containing the maximum number of ints which can be stored in the task_info parameter. The current code is passing in the size in bytes which could cause Here’s a snippet from the GNU docs:

“The function task_info returns the selected information array for a task, as specified by flavor. task_info is an array of integers that is supplied by the caller, and filled with specified information. task_info_count is supplied as the maximum number of integers in task_info. On return, it contains the actual number of integers in task_info. The maximum number of integers returned by any flavor is TASK_INFO_MAX.”

The fix is to either divide by sizeof(natural_t) or to use the standard TASK_BASIC_INFO_COUNT

@avivkiss avivkiss added the Bug label Jun 12, 2019
@react-native-bot
Copy link
Collaborator

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Jun 12, 2019
@stale
Copy link

stale bot commented Sep 10, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 10, 2019
@stale
Copy link

stale bot commented Sep 17, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Sep 17, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants