11
29
Fork
You've already forked ipmitool
33

fru: Fix "segfault" during fru area initialization #7

Open
Iwao-Miyake wants to merge 1 commit from Iwao-Miyake/ipmitool:bugfix/github-131-broken-memory-initialization into master
pull from: Iwao-Miyake/ipmitool:bugfix/github-131-broken-memory-initialization
merge into: IPMITool:master
IPMITool:master
IPMITool:bugfix/43-Fix-timezone-and-DST-in-SEL
IPMITool:pages
IPMITool:bugfix/fix-ci-builds
IPMITool:feature/refactor-sdr-name-handling
IPMITool:cleanup/nm
IPMITool:feature/add-support-for-boot-mailbox
IPMITool:codefactor
IPMITool:bugfix/26
First-time contributor
Copy link

Fixed a bug that "segmentation fault" occurred when "offset + length" is
larger than "fru->size" and "length" is smaller than "fru->size" during
read_fru_area processing.

Partially resolves: github.com/ipmitool/ipmitool/issues/131

Signed-off-by: Iwao Miyake miyake.iwao@fujitsu.com

Fixed a bug that "segmentation fault" occurred when "offset + length" is larger than "fru->size" and "length" is smaller than "fru->size" during read_fru_area processing. Partially resolves: github.com/ipmitool/ipmitool/issues/131 Signed-off-by: Iwao Miyake <miyake.iwao@fujitsu.com>
Fixed a bug that "segmentation fault" occurred when "offset + length" is
larger than "fru->size" and "length" is smaller than "fru->size" during
read_fru_area processing.
Partially resolves: github.com/ipmitool/ipmitoo/issues/131
Signed-off-by: Iwao Miyake <miyake.iwao@fujitsu.com>
Author
First-time contributor
Copy link

Should I make this issue for codeberg.org?
https://github.com/ipmitool/ipmitool/issues/131

Should I make this issue for codeberg.org? https://github.com/ipmitool/ipmitool/issues/131
Author
First-time contributor
Copy link

What is the status of this pull request?

It has been a week since this pull request issued.

Please let me know current situation and if any information is missing.

What is the status of this pull request? It has been a week since this pull request issued. Please let me know current situation and if any information is missing.
@ -725,3 +725,3 @@
finish = offset + length;
if (finish > fru->size) {
memset(frubuf + fru->size, 0, length - fru->size);
memset(frubuf + fru->size, 0, finish - fru->size);

This looks wrong as well as the description in the function's header.
If you look at line 818, you'll see that it copies the received data starting at the beginning of frubuf, without any offset. Hence, the original code here is correct.

The function's header must be fixed though.

There are probably some other errors leading to https://github.com/ipmitool/ipmitool/issues/131

You may re-create the bug here as I won't be able to close it on Github when it's resolved.

This looks wrong as well as the description in the function's header. If you look at line 818, you'll see that it copies the received data starting at the beginning of `frubuf`, without any `offset`. Hence, the original code here is correct. The function's header must be fixed though. There are probably some other errors leading to https://github.com/ipmitool/ipmitool/issues/131 You may re-create the bug here as I won't be able to close it on Github when it's resolved.
Author
First-time contributor
Copy link

Thank you for reviewing my request and explaining.

Just confirm, is the header that must be fixed at line 695?

Line 695 in ab5ce5b
/* read_fru_area - fill in frubuf[offset:length] from the FRU[offset:length]
Thank you for reviewing my request and explaining. Just confirm, is the header that must be fixed at line 695? https://codeberg.org/IPMITool/ipmitool/src/commit/ab5ce5baff097ebb6e2a17a171858be213ee68d3/lib/ipmi_fru.c#L695

Thank you for reviewing my request and explaining.

You're welcome.

Just confirm, is the header that must be fixed at line 695?

Line 695 in ab5ce5b
/* read_fru_area - fill in frubuf[offset:length] from the FRU[offset:length]

Yes, it looks like the right place.

> Thank you for reviewing my request and explaining. You're welcome. > Just confirm, is the header that must be fixed at line 695? > https://codeberg.org/IPMITool/ipmitool/src/commit/ab5ce5baff097ebb6e2a17a171858be213ee68d3/lib/ipmi_fru.c#L695 Yes, it looks like the right place.
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u bugfix/github-131-broken-memory-initialization:Iwao-Miyake-bugfix/github-131-broken-memory-initialization
git switch Iwao-Miyake-bugfix/github-131-broken-memory-initialization
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IPMITool/ipmitool!7
Reference in a new issue
IPMITool/ipmitool
No description provided.
Delete branch "Iwao-Miyake/ipmitool:bugfix/github-131-broken-memory-initialization"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?