You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "fjpanag (via GitHub)" <gi...@apache.org> on 2023/04/04 21:42:19 UTC
[GitHub] [nuttx] fjpanag opened a new pull request, #8965: Fixed improper access of g_pidhash.
fjpanag opened a new pull request, #8965:
URL: https://github.com/apache/nuttx/pull/8965
## Summary
Fixes potential garbage access to `g_pidhash`.
Also see [here](https://lists.apache.org/list.html?dev@nuttx.apache.org).
## Impact
Bug fix.
## Testing
Tested on sim, running ostest with KASAN enabled.
--
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] fjpanag commented on a diff in pull request #8965: Fixed improper access of g_pidhash.
Posted by "fjpanag (via GitHub)" <gi...@apache.org>.
fjpanag commented on code in PR #8965:
URL: https://github.com/apache/nuttx/pull/8965#discussion_r1158583528
##########
sched/task/task_setup.c:
##########
@@ -160,8 +161,9 @@ static int nxtask_assign_pid(FAR struct tcb_s *tcb)
/* Release resource for original g_pidhash, using new g_pidhash */
- kmm_free(g_pidhash);
+ temp = g_pidhash;
Review Comment:
How is a critical section related to a local variable?
--
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] pkarashchenko commented on pull request #8965: Fixed improper access of g_pidhash.
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on PR #8965:
URL: https://github.com/apache/nuttx/pull/8965#issuecomment-1496778255
This change might be not needed with https://github.com/apache/nuttx/pull/8951 as pid hash table will not be accessed there. This is just FYI.
--
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] fjpanag commented on a diff in pull request #8965: Fixed improper access of g_pidhash.
Posted by "fjpanag (via GitHub)" <gi...@apache.org>.
fjpanag commented on code in PR #8965:
URL: https://github.com/apache/nuttx/pull/8965#discussion_r1157807727
##########
sched/task/task_setup.c:
##########
@@ -83,6 +83,7 @@ static int nxtask_assign_pid(FAR struct tcb_s *tcb)
FAR struct tcb_s **pidhash;
pid_t next_pid;
int hash_ndx;
+ void * temp;
Review Comment:
Oops, sorry. I was testing it quickly and I missed it...
--
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] xiaoxiang781216 commented on a diff in pull request #8965: Fixed improper access of g_pidhash.
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8965:
URL: https://github.com/apache/nuttx/pull/8965#discussion_r1158566146
##########
sched/task/task_setup.c:
##########
@@ -160,8 +161,9 @@ static int nxtask_assign_pid(FAR struct tcb_s *tcb)
/* Release resource for original g_pidhash, using new g_pidhash */
- kmm_free(g_pidhash);
+ temp = g_pidhash;
Review Comment:
The whole code is protected by critical section, it doesn't make sense to add a local variable here.
--
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] patacongo commented on a diff in pull request #8965: Fixed improper access of g_pidhash.
Posted by "patacongo (via GitHub)" <gi...@apache.org>.
patacongo commented on code in PR #8965:
URL: https://github.com/apache/nuttx/pull/8965#discussion_r1157801931
##########
sched/task/task_setup.c:
##########
@@ -83,6 +83,7 @@ static int nxtask_assign_pid(FAR struct tcb_s *tcb)
FAR struct tcb_s **pidhash;
pid_t next_pid;
int hash_ndx;
+ void * temp;
Review Comment:
```suggestion
void *temp;
```
--
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] patacongo merged pull request #8965: Fixed improper access of g_pidhash.
Posted by "patacongo (via GitHub)" <gi...@apache.org>.
patacongo merged PR #8965:
URL: https://github.com/apache/nuttx/pull/8965
--
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