Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Issue 3594010: Address some security concerns in the cgpt tool. (Closed)

Created:
10 years, 2 months ago by Bill Richardson
Modified:
9 years, 6 months ago
CC:
chromium-os-reviews_chromium.org, Randall Spangler, Luigi Semenzato, Bill Richardson
Visibility:
Public.

Description

Address some security concerns in the cgpt tool. 1. Check for potential integer overflow in sector_bytes * sector_count. 2. Added O_NOFOLLOW to open() call - Is this enough? 3. Passing buffer length to GuidToStr(), PMBRToStr(). 4. Use unsigned int in GetEntry() to determine stride. 5. Address conversion between UTF16 and UTF8. Note: The UTF conversion is complex and troublesome, and needs careful consideration to get right. For now, I've just forced the interpretation of the partition name to 7-bit ASCII. That's sufficient for the needs of Chrome OS, and I can file a new issue to handle UTF correctly. BUG=chrome-os-partner:705 TEST=manual Running "make runtests" invokes the tests/run_cgpt_tests.sh script, which checks the behavior and output of the cgpt tool. Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=c4e92af

Patch Set 1 #

Total comments: 14

Patch Set 2 : Respond to feedback. #

Total comments: 6

Patch Set 3 : A little more cleanup. Take one more look, please. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+210 lines, -215 lines) Patch
M cgpt/cgpt.h View 1 2 5 chunks +33 lines, -20 lines 0 comments Download
M cgpt/cgpt_common.c View 1 2 13 chunks +106 lines, -136 lines 0 comments Download
M cgpt/cmd_add.c View 1 4 chunks +6 lines, -7 lines 0 comments Download
M cgpt/cmd_boot.c View 1 5 chunks +8 lines, -8 lines 0 comments Download
M cgpt/cmd_create.c View 2 chunks +2 lines, -2 lines 0 comments Download
M cgpt/cmd_find.c View 1 4 chunks +5 lines, -4 lines 0 comments Download
M cgpt/cmd_show.c View 1 2 14 chunks +38 lines, -35 lines 0 comments Download
M utility/vbutil_keyblock.c View 2 chunks +12 lines, -3 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Bill Richardson
10 years, 2 months ago (2010-10-05 17:38:17 UTC) #1
gauravsh
Drive-by comments... Also, even though this is a re-factor, doesn't mean it shouldn't be tested. ...
10 years, 2 months ago (2010-10-06 18:45:53 UTC) #2
Bill Richardson
Uploading new version. Please take another look. http://codereview.chromium.org/3594010/diff/1/3 File cgpt/cgpt_common.c (right): http://codereview.chromium.org/3594010/diff/1/3#newcode328 cgpt/cgpt_common.c:328: assert(buflen >= ...
10 years, 2 months ago (2010-10-08 21:56:45 UTC) #3
Bill Richardson
10 years, 2 months ago (2010-10-08 21:57:11 UTC) #4
gauravsh
LGTM with a couple of comments about scratch buffer lengths and error checking functions which ...
10 years, 2 months ago (2010-10-09 22:59:35 UTC) #5
Bill Richardson
10 years, 2 months ago (2010-10-11 16:26:47 UTC) #6
Bill Richardson
http://codereview.chromium.org/3594010/diff/8001/9007 File cgpt/cmd_show.c (right): http://codereview.chromium.org/3594010/diff/8001/9007#newcode123 cgpt/cmd_show.c:123: snprintf(contents, sizeof(contents), "Label: \"%s\"", label); I'm not sure it ...
10 years, 2 months ago (2010-10-11 16:26:59 UTC) #7
Bill Richardson
Gaurav, would you take one more look just to be sure. Thanks.
10 years, 2 months ago (2010-10-11 16:27:40 UTC) #8
gauravsh
10 years, 2 months ago (2010-10-12 03:35:34 UTC) #9
Still LGTM. Thanks!

On 2010/10/11 16:27:40, Bill Richardson wrote:
> Gaurav, would you take one more look just to be sure.
> Thanks.

Powered by Google App Engine
This is Rietveld 408576698