From: REITHER Robert - Contractor Date: Thu, 16 Jul 2020 11:39:36 +0000 Subject: [PATCH v3 7/8] efi_loader: signature: rework for intermediate Message-ID: <829b39d9703e4a5db2c99fc200a0e189@external.thalesgroup.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, I think I have found a bug in lib/efi_loader/efi_signature.c efi_verify_certificate() + cert = x509_cert_parse(sig_data->data, sig_data->size); + if (!cert) { + EFI_PRINT("Cannot parse x509 certificate\n"); + continue; + } x509_cert_parse() not only returns a pointer, but also embed a linux error_code, so if an error happens there, the (!cert) check will fail! I suggest using: - if (!cert) { + if (IS_ERR(cert)) { Regards Robert