hw/sd/sdcard: Do not attempt to erase out of range addresses
cover hw/sd/sdcard: Do not attempt to erase out of range addresses
Yet another bug in the sdcard model found by libfuzzer:
https://bugs.launchpad.net/bugs/1895310
The bug is fixed, but there is a migration issue to be resolved... so posting as RFC.
Philippe Mathieu-Daudé (6):
hw/sd/sdcard: Add trace event for ERASE command (CMD38) hw/sd/sdcard: Introduce the INVALID_ADDRESS definition hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS hw/sd/sdcard: Reset both start/end addresses on error hw/sd/sdcard: Do not attempt to erase out of range addresses hw/sd/sdcard: Assert if accessing an illegal group
hw/sd/sd.c | 30 ++++++++++++++++++++++-------- hw/sd/trace-events | 2 +- 2 files changed, 23 insertions(+), 9 deletions(-)
Signature · 1 line
2.26.2
RFC PATCH 1/6 hw/sd/sdcard: Add trace event for ERASE command (CMD38)
Trace addresses provided to the ERASE command.
--- hw/sd/sd.c | 2 +- hw/sd/trace-events | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/sd/sd.c +1 -1
@@ -749,7 +749,7 @@ static void sd_erase(SDState *sd)uint64_t erase_start = sd->erase_start;uint64_t erase_end = sd->erase_end; -trace_sdcard_erase (); +trace_sdcard_erase (sd->erase_start, sd->erase_end);if (!sd->erase_start || !sd->erase_end) { sd->card_status |=ERASE_SEQ_ERROR ;return ;
hw/sd/trace-events +1 -1
@@ -46,7 +46,7 @@ sdcard_reset(void) "" sdcard_set_blocklen(uint16_t length) "0x%03x" sdcard_inserted(bool readonly) "read_only: %u" sdcard_ejected(void) "" -sdcard_erase(void) "" +sdcard_erase(uint32_t first, uint32_t last) "addr first 0x%" PRIx32" last 0x%" PRIx32 sdcard_lock(void) "" sdcard_unlock(void) "" sdcard_read_block(uint64_t addr, uint32_t len) "addr 0x%" PRIx64 " size 0x%x"
Signature · 1 line
2.26.2
RFC PATCH 2/6 hw/sd/sdcard: Introduce the INVALID_ADDRESS definition
In reply to Philippe Mathieu-Daudé'0' is used as a value to indicate an invalid (or unset) address. Use a definition instead of a magic value.
--- hw/sd/sd.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
hw/sd/sd.c +8 -5
@@ -53,6 +53,8 @@#define SDSC_MAX_CAPACITY (2 * GiB) +#define INVALID_ADDRESS 0 + typedef enum { sd_r0 = 0, /* no response */ sd_r1, /* normal response command */
@@ -575,8 +577,8 @@ static void sd_reset(DeviceState *dev) sd->wpgrps_size = sect; sd->wp_groups =bitmap_new (sd->wpgrps_size);memset (sd->function_group,0 ,sizeof (sd->function_group)); - sd->erase_start =0 ; - sd->erase_end =0 ; + sd->erase_start =INVALID_ADDRESS ; + sd->erase_end =INVALID_ADDRESS ; sd->size = size; sd->blk_len =0x200 ; sd->pwd_len =0 ;
@@ -750,7 +752,8 @@ static void sd_erase(SDState *sd)uint64_t erase_end = sd->erase_end;trace_sdcard_erase (sd->erase_start, sd->erase_end); -if (!sd->erase_start || !sd->erase_end) { +if (sd->erase_start ==INVALID_ADDRESS + || sd->erase_end ==INVALID_ADDRESS ) { sd->card_status |=ERASE_SEQ_ERROR ;return ; }
@@ -763,8 +766,8 @@ static void sd_erase(SDState *sd) erase_start =sd_addr_to_wpnum (erase_start); erase_end =sd_addr_to_wpnum (erase_end); - sd->erase_start =0 ; - sd->erase_end =0 ; + sd->erase_start =INVALID_ADDRESS ; + sd->erase_end =INVALID_ADDRESS ; sd->csd[14 ] |=0x40 ;for (i = erase_start; i <= erase_end; i++) {
Signature · 1 line
2.26.2
RFC PATCH 3/6 hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
In reply to Philippe Mathieu-DaudéAs it is legal to WRITE/ERASE the address/block 0, change the value of this definition to an illegal
address: UINT32_MAX.
---
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Markus Armbruster <[email protected]>
Same problem I had with the pflash device last year... This break migration :(
What is the best way to do this?
--- hw/sd/sd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
hw/sd/sd.c +3 -3
@@ -53,7 +53,7 @@#define SDSC_MAX_CAPACITY (2 * GiB) -#define INVALID_ADDRESS 0 +#define INVALID_ADDRESS UINT32_MAX typedef enum { sd_r0 = 0, /* no response */
@@ -666,8 +666,8 @@ static int sd_vmstate_pre_load(void *opaque)static const VMStateDescription sd_vmstate = { .name ="sd-card" , - .version_id =1 , - .minimum_version_id =1 , + .version_id =2 , + .minimum_version_id =2 , .pre_load = sd_vmstate_pre_load, .fields = (VMStateField []) {VMSTATE_UINT32 (mode, SDState),
Signature · 1 line
2.26.2
Re: [RFC PATCH 3/6] hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
Quoted 4 lines · Philippe Mathieu-Daudé
As it is legal to WRITE/ERASE the address/block 0, change the value of this definition to an illegal
address:UINT32_MAX.
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Markus Armbruster <[email protected]>Same problem I had with the pflash device last year... This break migration :(
What is the best way to do this?
Remind me: did we solve the problem with pflash, and if yes, how?
Quoted 28 lines
--- hw/sd/sd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)hw/sd/sd.c +3
-3@@ -53,7 +53,7 @@#define SDSC_MAX_CAPACITY (2 * GiB) -#define INVALID_ADDRESS 0 +#define INVALID_ADDRESS UINT32_MAX typedef enum { sd_r0 = 0, /* no response */@@ -666,8 +666,8 @@ static int sd_vmstate_pre_load(void *opaque)static const VMStateDescription sd_vmstate = { .name ="sd-card" , - .version_id =1 , - .minimum_version_id =1 , + .version_id =2 , + .minimum_version_id =2 , .pre_load = sd_vmstate_pre_load, .fields = (VMStateField []) {VMSTATE_UINT32 (mode, SDState),
Re: [RFC PATCH 3/6] hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
+Paolo & Kevin.
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Philippe Mathieu-Daudé
As it is legal to WRITE/ERASE the address/block 0, change the value of this definition to an illegal
address:UINT32_MAX.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Markus Armbruster <[email protected]>
Quoted 5 lines
Quoted 3 lines
Same problem I had with the pflash device last year... This break migration :(
What is the best way to do this?Remind me: did we solve the problem with pflash, and if yes, how?
No we can't. The best I could do is add a comment and as this is not fixable. See commit aba53a12bd5: ("hw/block/pflash_cfi01:
Document use of non-CFI compliant command '0x00'").
I now consider the device in maintenance-only
mode and won't add any new features.
I started working on a new implementation, hoping it can be a drop in replacement. Laszlo still has hope that QEMU pflash device will support sector locking so firmware developers could test upgrading fw in VMs.
Back to the SDcard, it might be less critical, so a migration breaking change might be acceptable. I'm only aware of Paolo and Kevin using this device for testing. Not sure of its importance in production.
Quoted 31 lines
Quoted 29 lines
--- hw/sd/sd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)hw/sd/sd.c +3
-3@@ -53,7 +53,7 @@#define SDSC_MAX_CAPACITY (2 * GiB) -#define INVALID_ADDRESS 0 +#define INVALID_ADDRESS UINT32_MAX typedef enum { sd_r0 = 0, /* no response */@@ -666,8 +666,8 @@ static int sd_vmstate_pre_load(void *opaque)static const VMStateDescription sd_vmstate = { .name ="sd-card" , - .version_id =1 , - .minimum_version_id =1 , + .version_id =2 , + .minimum_version_id =2 , .pre_load = sd_vmstate_pre_load, .fields = (VMStateField []) {VMSTATE_UINT32 (mode, SDState),
Re: [RFC PATCH 3/6] hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
Quoted 32 lines · Philippe Mathieu-Daudé
+Paolo & Kevin.
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Philippe Mathieu-Daudé
As it is legal to WRITE/ERASE the address/block 0, change the value of this definition to an illegal
address:UINT32_MAX.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Markus Armbruster <[email protected]>Quoted 5 lines
Quoted 3 lines
Same problem I had with the pflash device last year... This break migration :(
What is the best way to do this?Remind me: did we solve the problem with pflash, and if yes, how?
No we can't. The best I could do is add a comment and as this is not fixable. See commit
aba53a12bd5: ("hw/block/pflash_cfi01:
Document use of non-CFI compliant command '0x00'").I now consider the device in maintenance-only
mode and won't add any new features.I started working on a new implementation, hoping it can be a drop in replacement. Laszlo still has hope that QEMU pflash device will support sector locking so firmware developers could test upgrading fw in VMs.
Quoted 4 lines
Back to the SDcard, it might be less critical, so a migration breaking change might be acceptable. I'm only aware of Paolo and Kevin using this device for testing. Not sure of its importance in production.
Neither am I.
Which machine types include this device by default?
How can a non-default device be added, and to which machine types?
I gather the fix changes device state incompatibly. Always, or only in certain states? I'm asking because if device state remains compatible most of the time, we might be able use subsection trickery to keep migration working most of the time. Has been done before, I think.
Re: [RFC PATCH 3/6] hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
Quoted 34 lines · * Markus Armbruster ([email protected]) wrote:
Quoted 32 lines · Philippe Mathieu-Daudé
+Paolo & Kevin.
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Philippe Mathieu-Daudé
As it is legal to WRITE/ERASE the address/block 0, change the value of this definition to an illegal
address:UINT32_MAX.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Markus Armbruster <[email protected]>Quoted 5 lines
Quoted 3 lines
Same problem I had with the pflash device last year... This break migration :(
What is the best way to do this?Remind me: did we solve the problem with pflash, and if yes, how?
No we can't. The best I could do is add a comment and as this is not fixable. See commit
aba53a12bd5: ("hw/block/pflash_cfi01:
Document use of non-CFI compliant command '0x00'").I now consider the device in maintenance-only
mode and won't add any new features.I started working on a new implementation, hoping it can be a drop in replacement. Laszlo still has hope that QEMU pflash device will support sector locking so firmware developers could test upgrading fw in VMs.
Quoted 8 lines
Quoted 4 lines
Back to the SDcard, it might be less critical, so a migration breaking change might be acceptable. I'm only aware of Paolo and Kevin using this device for testing. Not sure of its importance in production.
Neither am I.
Which machine types include this device by default?
To me it looks like it's some of the ARM boards.
Dave
Quoted 6 lines
How can a non-default device be added, and to which machine types?
I gather the fix changes device state incompatibly. Always, or only in certain states? I'm asking because if device state remains compatible most of the time, we might be able use subsection trickery to keep migration working most of the time. Has been done before, I think.
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Re: [RFC PATCH 3/6] hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
Quoted 40 lines · Dr. David Alan Gilbert
Quoted 39 lines · * Markus Armbruster ([email protected]) wrote:
Quoted 36 lines · Philippe Mathieu-Daudé
+Paolo & Kevin.
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Philippe Mathieu-Daudé
As it is legal to WRITE/ERASE the address/block 0, change the value of this definition to an illegal
address:UINT32_MAX.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Markus Armbruster <[email protected]>Quoted 5 lines
Quoted 3 lines
Same problem I had with the pflash device last year... This break migration :(
What is the best way to do this?Remind me: did we solve the problem with pflash, and if yes, how?
No we can't. The best I could do is add a comment and as this is not fixable. See commit
aba53a12bd5: ("hw/block/pflash_cfi01:
Document use of non-CFI compliant command '0x00'").I now consider the device in maintenance-only
mode and won't add any new features.I started working on a new implementation, hoping it can be a drop in replacement. Laszlo still has hope that QEMU pflash device will support sector locking so firmware developers could test upgrading fw in VMs.
Back to the SDcard, it might be less critical, so a migration breaking change might be acceptable. I'm only aware of Paolo and Kevin using this device for testing. Not sure of its importance in production.
Quoted 5 lines
Quoted 3 lines
Neither am I.
Which machine types include this device by default?
To me it looks like it's some of the ARM boards.
My worry is TYPE_PCI_SDHCI ("sdhci-pci"):
k->vendor_id = PCI_VENDOR_ID_REDHAT;
k->device_id = PCI_DEVICE_ID_REDHAT_SDHCI;
k->class_id = PCI_CLASS_SYSTEM_SDHCI;config SDHCI_PCI
bool
default y if PCI_DEVICES
Quoted 9 lines
Dave
Quoted 6 lines
How can a non-default device be added, and to which machine types?
I gather the fix changes device state incompatibly. Always, or only in certain states? I'm asking because if device state remains compatible most of the time, we might be able use subsection trickery to keep migration working most of the time. Has been done before, I think.
Re: [RFC PATCH 3/6] hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
Quoted 49 lines · Philippe Mathieu-Daudé
Quoted 40 lines · Dr. David Alan Gilbert
Quoted 39 lines · * Markus Armbruster ([email protected]) wrote:
Quoted 36 lines · Philippe Mathieu-Daudé
+Paolo & Kevin.
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Philippe Mathieu-Daudé
As it is legal to WRITE/ERASE the address/block 0, change the value of this definition to an illegal
address:UINT32_MAX.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Markus Armbruster <[email protected]>Quoted 5 lines
Quoted 3 lines
Same problem I had with the pflash device last year... This break migration :(
What is the best way to do this?Remind me: did we solve the problem with pflash, and if yes, how?
No we can't. The best I could do is add a comment and as this is not fixable. See commit
aba53a12bd5: ("hw/block/pflash_cfi01:
Document use of non-CFI compliant command '0x00'").I now consider the device in maintenance-only
mode and won't add any new features.I started working on a new implementation, hoping it can be a drop in replacement. Laszlo still has hope that QEMU pflash device will support sector locking so firmware developers could test upgrading fw in VMs.
Back to the SDcard, it might be less critical, so a migration breaking change might be acceptable. I'm only aware of Paolo and Kevin using this device for testing. Not sure of its importance in production.
Quoted 5 lines
Quoted 3 lines
Neither am I.
Which machine types include this device by default?
To me it looks like it's some of the ARM boards.
My worry is
TYPE_PCI_SDHCI("sdhci-pci"):
Quoted 7 lines
k->vendor_id = PCI_VENDOR_ID_REDHAT; k->device_id = PCI_DEVICE_ID_REDHAT_SDHCI; k->class_id = PCI_CLASS_SYSTEM_SDHCI;config
SDHCI_PCI
bool
default y ifPCI_DEVICES
Ah, now I remember. Not the first time I wished it wouldn't exist...
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
How can a non-default device be added, and to which machine types?
I gather the fix changes device state incompatibly. Always, or only in certain states?
I think we need to answer this question.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
I'm asking because if device state remains compatible
most of the time, we might be able use subsection trickery to keep migration working most of the time. Has been done before, I think.
Re: [RFC PATCH 3/6] hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
I think we can just bite the bullet and bump the version number. Just like not all boards are created equal in terms of migration compatibility, neither are all devices.
Unfortunately pflash is among those that need some care, but we have much more leeway with sdhci-pci.
Paolo
Il lun 21 set 2020, 17:08 Markus Armbruster <[email protected]> ha scritto:
Quoted 73 lines
Quoted 49 lines · Philippe Mathieu-Daudé
Quoted 40 lines · Dr. David Alan Gilbert
Quoted 39 lines · * Markus Armbruster ([email protected]) wrote:
Quoted 36 lines · Philippe Mathieu-Daudé
+Paolo & Kevin.
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Philippe Mathieu-Daudé
As it is legal to WRITE/ERASE the address/block 0, change the value of this definition to an illegal
address:UINT32_MAX.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Markus Armbruster <[email protected]>Quoted 5 lines
Quoted 3 lines
Same problem I had with the pflash device last year... This break migration :(
What is the best way to do this?Remind me: did we solve the problem with pflash, and if yes, how?
No we can't. The best I could do is add a comment and as this is not fixable. See commit
aba53a12bd5: ("hw/block/pflash_cfi01:
Document use of non-CFI compliant command '0x00'").I now consider the device in maintenance-only
mode and won't add any new features.I started working on a new implementation, hoping it can be a drop in replacement. Laszlo still has hope that QEMU pflash device will support sector locking so firmware developers could test upgrading fw in VMs.
Back to the SDcard, it might be less critical, so a migration breaking change might be acceptable. I'm only aware of Paolo and Kevin using this device for testing. Not sure of its importance in production.
Quoted 5 lines
Quoted 3 lines
Neither am I.
Which machine types include this device by default?
To me it looks like it's some of the ARM boards.
My worry is
TYPE_PCI_SDHCI("sdhci-pci"):Quoted 7 lines
k->vendor_id = PCI_VENDOR_ID_REDHAT; k->device_id = PCI_DEVICE_ID_REDHAT_SDHCI; k->class_id = PCI_CLASS_SYSTEM_SDHCI;config
SDHCI_PCI
bool
default y ifPCI_DEVICESAh, now I remember. Not the first time I wished it wouldn't exist...
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
How can a non-default device be added, and to which machine types?
I gather the fix changes device state incompatibly. Always, or only in certain states?
I think we need to answer this question.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
I'm asking because if device state remains compatible
most of the time, we might be able use subsection trickery to keep migration working most of the time. Has been done before, I think.
Re: [RFC PATCH 3/6] hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
Quoted 6 lines · Paolo Bonzini
I think we can just bite the bullet and bump the version number. Just like not all boards are created equal in terms of migration compatibility, neither are all devices.
Unfortunately pflash is among those that need some care, but we have much more leeway with sdhci-pci.
No objection.
Re: [RFC PATCH 3/6] hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
Quoted 5 lines · Markus Armbruster
Quoted 3 lines · Paolo Bonzini
I think we can just bite the bullet and bump the version number. Just like not all boards are created equal in terms of migration compatibility, neither are all devices.
Great. I'll add that to the commit description.
Quoted 6 lines
Quoted 3 lines
Unfortunately pflash is among those that need some care, but we have much more leeway with sdhci-pci.
No objection.
Re: [RFC PATCH 3/6] hw/sd/sdcard: Do not use legal address '0' for INVALID_ADDRESS
In reply to Philippe Mathieu-DaudéQuoted 4 lines · Philippe Mathieu-Daudé
Back to the SDcard, it might be less critical, so a migration breaking change might be acceptable. I'm only aware of Paolo and Kevin using this device for testing. Not sure of its importance in production.
FWIW, I only use the sdcard for testing (and only use sdhci-pci). I don't know if others use it in production, however.
Cheers,
-Kevin
RFC PATCH 4/6 hw/sd/sdcard: Reset both start/end addresses on error
In reply to Philippe Mathieu-DaudéFrom the Spec "4.3.5 Erase":
The host should adhere to the following command
sequence: ERASE_WR_BLK_START, ERASE_WR_BLK_END and ERASE (CMD38).
If an erase (CMD38) or address setting (CMD32, 33) command is received out of sequence, the card shall set the ERASE_SEQ_ERROR bit in the status register and reset the whole sequence.
Reset both addresses if the ERASE command occured
out of sequence (one of the start/end address is
not set).
--- hw/sd/sd.c | 2 ++ 1 file changed, 2 insertions(+)
hw/sd/sd.c +2 -0
@@ -755,6 +755,8 @@ static void sd_erase(SDState *sd)if (sd->erase_start ==INVALID_ADDRESS || sd->erase_end ==INVALID_ADDRESS ) { sd->card_status |=ERASE_SEQ_ERROR ; + sd->erase_start =INVALID_ADDRESS ; + sd->erase_end =INVALID_ADDRESS ;return ; }
Signature · 1 line
2.26.2
RFC PATCH 5/6 hw/sd/sdcard: Do not attempt to erase out of range addresses
In reply to Philippe Mathieu-DaudéWhile the Spec v3 is not very clear, v6 states:
If the host provides an out of range address as an argument to CMD32 or CMD33, the card shall indicate OUT_OF_RANGE error in R1 (ERX) for CMD38.
If an address is out of range, do not attempt to erase it:
return R1 with the error bit set.
--- hw/sd/sd.c | 7 +++++++ 1 file changed, 7 insertions(+)
hw/sd/sd.c +7 -0
@@ -766,6 +766,13 @@ static void sd_erase(SDState *sd) erase_end *=512 ; } +if (sd->erase_start > sd->size || sd->erase_end > sd->size) { + sd->card_status |=OUT_OF_RANGE ; + sd->erase_start =INVALID_ADDRESS ; + sd->erase_end =INVALID_ADDRESS ; +return ; + } + erase_start =sd_addr_to_wpnum (erase_start); erase_end =sd_addr_to_wpnum (erase_end); sd->erase_start =INVALID_ADDRESS ;
Signature · 1 line
2.26.2
RFC PATCH 6/6 hw/sd/sdcard: Assert if accessing an illegal group
In reply to Philippe Mathieu-DaudéWe can not have more group than 'wpgrps_size'. Assert if we are accessing a group above this limit.
--- hw/sd/sd.c | 2 ++ 1 file changed, 2 insertions(+)
hw/sd/sd.c +2 -0
@@ -780,6 +780,7 @@ static void sd_erase(SDState *sd) sd->csd[14 ] |=0x40 ;for (i = erase_start; i <= erase_end; i++) { +assert (i < sd->wpgrps_size);if (test_bit (i, sd->wp_groups)) { sd->card_status |=WP_ERASE_SKIP ; }
@@ -794,6 +795,7 @@ static uint32_t sd_wpbits(SDState *sd, uint64_t addr) wpnum =sd_addr_to_wpnum (addr);for (i =0 ; i <32 ; i++, wpnum++, addr +=WPGROUP_SIZE ) { +assert (wpnum < sd->wpgrps_size);if (addr < sd->size &&test_bit (wpnum, sd->wp_groups)) { ret |= (1 << i); }
Signature · 1 line
2.26.2