commit 29e1d86af, LP: #1356207
Colin Ian King
colin.king at canonical.com
Thu Aug 28 21:52:40 UTC 2014
Hi,
Recent commit 29e1d86af "uefirtvariable: add test for setvariable with
both authenticated attributes are set (LP: #1356207)" has introduced
two regressions as found by Coverity Scan.
Can this be investigated/fixed?
Colin
________________________________________________________________________________________________________
*** CID 1232806: Wrong operator used (CONSTANT_EXPRESSION_RESULT)
/src/uefi/uefirtvariable/uefirtvariable.c: 783 in
setvariable_insertvariable()
777 setvariable.DataSize = datasize;
778 setvariable.Data = data;
779 setvariable.status = &status;
780 ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
781
782 if (ioret == -1) {
>>> CID 1232806: Wrong operator used (CONSTANT_EXPRESSION_RESULT)
>>> "attributes | FWTS_UEFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS" is
always 1/true regardless of the values of its operand. This occurs as
the logical first operand of '||'.
783 if ((status == EFI_INVALID_PARAMETER) &&
784 ((attributes | FWTS_UEFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) ||
785 (attributes |
FWTS_UEFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) ||
786 (attributes | FWTS_UEFI_VARIABLE_APPEND_WRITE))) {
787 fwts_uefi_print_status_info(fw, status);
788 fwts_skipped(fw,
________________________________________________________________________________________________________
*** CID 1232805: Wrong operator used (CONSTANT_EXPRESSION_RESULT)
/src/uefi/uefirtvariable/uefirtvariable.c: 944 in setvariable_invalidattr()
938 setvariable.Data = data;
939 setvariable.status = &status;
940
941 ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
942
943 if ((status == EFI_SUCCESS) && (ioret != -1)) {
>>> CID 1232805: Wrong operator used (CONSTANT_EXPRESSION_RESULT)
>>> "attributes | FWTS_UEFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS" is
always 1/true regardless of the values of its operand. This occurs as
the logical first operand of '&&'.
944 if ((attributes |
FWTS_UEFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) &&
945 (attributes |
FWTS_UEFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) &&
946 (status != EFI_INVALID_PARAMETER)) {
947 fwts_warning(fw,
948 "Both the EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute
and the "
949 "EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
attribute are set "
More information about the fwts-devel
mailing list