Skip to content

Commit 6f0dee7

Browse files
EricSesterhennX41gregkh
authored andcommitted
pkcs7: Prevent NULL pointer dereference, since sinfo is not always set.
commit 68a1fdbbf8bd3378325e45c19e167a165f9ffc3a upstream. The ASN.1 parser does not necessarily set the sinfo field, this patch prevents a NULL pointer dereference on broken input. Fixes: 99db443 ("PKCS#7: Appropriately restrict authenticated attributes and content type") Signed-off-by: Eric Sesterhenn <eric.sesterhenn@x41-dsec.de> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 33dea30 commit 6f0dee7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

crypto/asymmetric_keys/pkcs7_parser.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ static int pkcs7_check_authattrs(struct pkcs7_message *msg)
9090
bool want;
9191

9292
sinfo = msg->signed_infos;
93+
if (!sinfo)
94+
goto inconsistent;
95+
9396
if (sinfo->authattrs) {
9497
want = true;
9598
msg->have_authattrs = true;

0 commit comments

Comments
 (0)