Attention is currently required from: Edward O'Callaghan, Nikolai Artemiev.
Hello build bot (Jenkins), Edward O'Callaghan,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/70516
to look at the new patch set (#2).
Change subject: flashrom: Check for flash access restricitons write_flash()
......................................................................
flashrom: Check for flash access restricitons write_flash()
Make write_flash() skip unwritable regions if
FLASHROM_FLAG_SKIP_UNREADABLE_REGIONS is true. If the flag is false
write operations that include an unwritable region will not write
anything and return an error.
BUG=b:260440773
BRANCH=none
TEST=flashrom -w on dedede (JSL)
Change-Id: Idacf0d5218da9d9929f4877fc7665fe608b87fe0
CoAuthored-by: Edward O'Callaghan <quasisec(a)google.com>
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Signed-off-by: Nikolai Artemiev <nartemiev(a)google.com>
---
M flashrom.c
1 file changed, 87 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/16/70516/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/70516
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Idacf0d5218da9d9929f4877fc7665fe608b87fe0
Gerrit-Change-Number: 70516
Gerrit-PatchSet: 2
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Edward O'Callaghan, Angel Pons.
Nikolai Artemiev has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/70128 )
Change subject: libflashrom: Add flags to skup unreadable and unwritable regions
......................................................................
Patch Set 21:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/70128/comment/94a85d2a_829be796
PS6, Line 11: platforms with active an CSME coprocessor.
> Ok I've uploaded a new patchset with some flags to control this behavior. […]
Marking resolved. I've also split out the changes for each r/w/e/v op into different patches:
r: https://review.coreboot.org/c/flashrom/+/70514
v: https://review.coreboot.org/c/flashrom/+/70515
w: https://review.coreboot.org/c/flashrom/+/70516
E: https://review.coreboot.org/c/flashrom/+/70517
--
To view, visit https://review.coreboot.org/c/flashrom/+/70128
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9b96fb04b863625d2c9f9a00b97c35b3ddb0871b
Gerrit-Change-Number: 70128
Gerrit-PatchSet: 21
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Fri, 09 Dec 2022 04:45:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Comment-In-Reply-To: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Nikolai Artemiev has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/70516 )
Change subject: flashrom: Check for flash access restricitons write_flash()
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/70516/comment/5563c9d5_8ff30c3a
PS1, Line 11: will not write
: anything
This isn't implemented yet. We will need to iterate regions and check for any protected regions before we start writing so we can bail out before we change anything.
--
To view, visit https://review.coreboot.org/c/flashrom/+/70516
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Idacf0d5218da9d9929f4877fc7665fe608b87fe0
Gerrit-Change-Number: 70516
Gerrit-PatchSet: 1
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Fri, 09 Dec 2022 04:43:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Nikolai Artemiev has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/70517 )
Change subject: flashrom: Check for flash access restricitons erase path
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/70517/comment/f3e5f60a_b42bcfce
PS1, Line 11: will not erase anythin
This isn't implemented yet. We will need to iterate regions and check for any protected regions before we start writing so we can bail out before we change anythibng.
--
To view, visit https://review.coreboot.org/c/flashrom/+/70517
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If027a96a024782c7707c6d38680709a1a117f3ef
Gerrit-Change-Number: 70517
Gerrit-PatchSet: 1
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Fri, 09 Dec 2022 04:43:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Hello Edward O'Callaghan,
I'd like you to do a code review.
Please visit
https://review.coreboot.org/c/flashrom/+/70515
to review the following change.
Change subject: flashrom: Check for flash access restricitons in verify_range()
......................................................................
flashrom: Check for flash access restricitons in verify_range()
Make verify_flash() skip read/write-protected regions based on the
FLASHROM_FLAG_SKIP_UNREADABLE and FLASHROM_FLAG_SKIP_UNWRITABLE flags.
If FLASHROM_FLAG_SKIP_UNREADABLE is false, read-protected regions will cause
verification to fail.
If FLASHROM_FLAG_SKIP_UNWRITABLE is false, read-only regions will still
be verified and any mismatch will cause verification to fail. It can be
useful to set the flag to true so that expected mismatches in read-only
regions are ignored by verify_range() after flashing.
BUG=b:260440773
BRANCH=none
TEST=flashrom -v on dedede (JSL)
Change-Id: I61dfadd3c75365f2e55abeea75f673ab791ca5cc
CoAuthored-by: Edward O'Callaghan <quasisec(a)google.com>
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Signed-off-by: Nikolai Artemiev <nartemiev(a)google.com>
---
M flashrom.c
1 file changed, 68 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/15/70515/1
diff --git a/flashrom.c b/flashrom.c
index 19068a7..76a2801 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -582,15 +582,49 @@
return -1;
}
- int ret = read_flash(flash, readbuf, start, len);
- if (ret) {
- msg_gerr("Verification impossible because read failed "
- "at 0x%x (len 0x%x)\n", start, len);
- ret = -1;
- goto out_free;
+ int ret = 0;
+
+ msg_gdbg("%#06x..%#06x ", start, start + len - 1);
+
+ unsigned int read_len;
+ for (size_t addr = start; addr < start + len; addr += read_len) {
+ struct flash_region region;
+ get_flash_region(flash, addr, ®ion);
+ read_len = min(start + len, region.end) - addr;
+
+ if ((region.write_prot && flash->flags.skip_unwritable_regions) ||
+ (region.read_prot && flash->flags.skip_unreadable_regions)) {
+ msg_gdbg("%s: Skipping verification of %s region (%#08x..%#08x)\n",
+ __func__, region.name, region.start, region.end - 1);
+ free(region.name);
+ continue;
+ }
+
+ if (region.read_prot) {
+ msg_gerr("%s: Verification imposible because %s region (%#08x..%#08x) is unreadable.\n",
+ __func__, region.name, region.start, region.end - 1);
+ free(region.name);
+ goto out_free;
+ }
+
+ msg_gdbg("%s: Verifying %s region (%#08x..%#08x)\n",
+ __func__, region.name, region.start, region.end - 1);
+ free(region.name);
+
+ ret = read_flash(flash, readbuf, addr, read_len);
+ if (ret) {
+ msg_gerr("Verification impossible because read failed "
+ "at 0x%x (len 0x%x)\n", start, len);
+ ret = -1;
+ goto out_free;
+ }
+
+ ret = compare_range(cmpbuf + (addr - start), readbuf, addr, read_len);
+ if (ret)
+ goto out_free;
+
}
- ret = compare_range(cmpbuf, readbuf, start, len);
out_free:
free(readbuf);
return ret;
--
To view, visit https://review.coreboot.org/c/flashrom/+/70515
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I61dfadd3c75365f2e55abeea75f673ab791ca5cc
Gerrit-Change-Number: 70515
Gerrit-PatchSet: 1
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Edward O'Callaghan, Angel Pons, Nikolai Artemiev.
Hello build bot (Jenkins), Edward O'Callaghan,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/70128
to look at the new patch set (#21).
Change subject: libflashrom: Add flags to skup unreadable and unwritable regions
......................................................................
libflashrom: Add flags to skup unreadable and unwritable regions
Add flags to allow libflashrom users to configure how operations that
include unreadable or unwritable regions should be behave.
If the flags are set to true, a read/write operation will just skip the
inaccessible region and will still be executed in other regions.
If the flags are set to false, the inaccessible region will cause the
entire operation to fail.
BUG=b:260440773
BRANCH=none
TEST=builds
Change-Id: I9b96fb04b863625d2c9f9a00b97c35b3ddb0871b
CoAuthored-by: Edward O'Callaghan <quasisec(a)google.com>
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Signed-off-by: Nikolai Artemiev <nartemiev(a)google.com>
---
M include/flash.h
M include/libflashrom.h
M libflashrom.c
3 files changed, 42 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/28/70128/21
--
To view, visit https://review.coreboot.org/c/flashrom/+/70128
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9b96fb04b863625d2c9f9a00b97c35b3ddb0871b
Gerrit-Change-Number: 70128
Gerrit-PatchSet: 21
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Thomas Heijligen, Evan Benn.
Hello build bot (Jenkins), Thomas Heijligen, Edward O'Callaghan, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/69268
to look at the new patch set (#18).
Change subject: tests: Add llvm-cov option and run target for code coverage
......................................................................
tests: Add llvm-cov option and run target for code coverage
Code coverage can be requested with -Dllvm_cov and run with ninja
llvm-cov-tests or llvm-cov-cli.
BUG=b:187647884
BRANCH=None
TEST=meson test; ninja llvm-cov-tests
TEST=ran test_build.sh with coverage enabled
TEST=jenkins ran test_build.sh with coverage disabled
Change-Id: Id6c73bff46e7b88d425956a80def97082b201f56
Signed-off-by: Evan Benn <evanbenn(a)chromium.org>
---
M Documentation/building.md
M meson.build
M meson_options.txt
A scripts/llvm-cov
M tests/meson.build
5 files changed, 46 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/68/69268/18
--
To view, visit https://review.coreboot.org/c/flashrom/+/69268
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id6c73bff46e7b88d425956a80def97082b201f56
Gerrit-Change-Number: 69268
Gerrit-PatchSet: 18
Gerrit-Owner: Evan Benn <evanbenn(a)google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Evan Benn <evanbenn(a)google.com>
Gerrit-MessageType: newpatchset