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
hv: fix possible buffer overflow issues #2061
Conversation
2061 |
hypervisor/arch/x86/assign.c
Outdated
if (pic_pin && (virt_pin > NR_VPIC_PINS_TOTAL)) { | ||
status = -EINVAL; | ||
} | ||
|
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.
you can have "else" here, which is easier.
hypervisor/arch/x86/assign.c
Outdated
pr_err("%s, add intx remapping failed", | ||
__func__); | ||
status = -ENODEV; | ||
spinlock_release(&ptdev_lock); |
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.
the spinlock can be moved out of the {}. We can merge this now, without goto END
2061 |
2d68650
to
462ba63
Compare
@HuiHuangShi @dongyaozu thanks for comments, have updated, please review, thanks. |
2061 |
1 similar comment
2061 |
cb94e36
to
3c8d8e5
Compare
@dongyaozu Eddie, have update for validating pCPU ID statement, pls review. thanks. |
hypervisor/arch/x86/cpu.c
Outdated
@@ -412,6 +412,7 @@ void init_cpu_pre(uint16_t pcpu_id) | |||
bitmap_set_nolock(pcpu_id, &pcpu_active_bitmap); | |||
|
|||
/* Set state for this CPU to initializing */ | |||
ASSERT(pcpu_id < CONFIG_MAX_PCPU_NUM, ""); | |||
cpu_set_current_state(pcpu_id, PCPU_STATE_INITIALIZING); |
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.
Why we need this one? The caller side is using fixed #
Ok to verify |
3c8d8e5
to
ce5f57c
Compare
2061 |
2061 |
- cpu_secondary_init() @cpu.c - ptirq_intx_pin_remap() @ assign.c etc. Tracked-On: projectacrn#1252 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
etc.
Tracked-On: #1252
Signed-off-by: Yonghua Huang yonghua.huang@intel.com
Acked-by: Eddie Dong eddie.dong@intel.com