From nobody Tue Apr 04 19:28:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Prd9G596bz443wV; Tue, 4 Apr 2023 19:28:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Prd9G4Z5Lz4HG1; Tue, 4 Apr 2023 19:28:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680636530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SBTfwxhbBqJQ/4ZawxBr3RZIdebsdXaFOVJnYZMGgBo=; b=oMZ90XSLzQuFYuCK0lAywGg1riwY26ezdmCybm2Ysbzag8QmU93wupsvzX4+0iEpcmceKI urWdYaq2xD/cnPhIE8lnw/MU0L9OBbDM2LODE0kSFuoycSuJJ90o8j3IR0wrV9KwfdiHVu Sf9uL31cWYkPFzQG2224CZ/3fucT929OE/+CyBwRBTBeebAcWPH/ZLNMRgF/RoZrHbdII0 d7TFrshHfA449yrlP0IYsyJ+Bc++giqTww2jKIl0wuXDBtS9m8wVJMGfRvLz33zfxGlUyb TkJM/4NWlX0D3VGO3eWfXjGmstVwFXxHtDnjDDBwtmswiDeT2V/lP1S9vTm/Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680636530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SBTfwxhbBqJQ/4ZawxBr3RZIdebsdXaFOVJnYZMGgBo=; b=LNlJlx1r5jZLj9oRUON5pxeSrl5cxSOU9Kzpmx6fGpMnc/Fdpl3YA10iKtWWZLaJd+ZRYA 80BleURnqVTf2aJGhlmONndPZdKrDl+8SZuimH0dG5SfsVdCVOe6dGfcoVkYnLnqE96KvP BBpeXpMijtaso0dhFzF90TYkp5WoeL0fxIOpicuCk+gwL4DhUK9iCNp4sA5AGVxIR/sMTX +XOP8iLZuyJkN7PpEUoD1w4z6fTk5Q7ZXFNAayMBfFWVRDmFyfnJ30W+MRS+nYo04/xycP 6ybLUc+dfyVlnBdepX/Gr8Y9BZLzXZ+TzyUrItyuvH9ChMotloMvhZSk7kJ5Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680636530; a=rsa-sha256; cv=none; b=KXykHl2jSmpAGkXZMzXV08muPjHMPwvnOfIvBampFCHTNTSFLgoF5p0U3F8p19omCReJW9 h+1NxINgB6sPAVMf3/AQNL1z28b95i71SXY/2Nd4FR6R2bZNyieCFcXW/w7e7wfS8w4Rfw jAVAEL9zBucvBtDcgKDAcbbCw/YpMHQT0AshVN50VH2yNBeZ8IBGBDHqs6lFGYnQycNN+n ZaeVGFjG5l225KZmXJ0JpFYAVdeoYxUBbrOSvBcJpY/W99sS49nPVFgGtfQYLwU2vpzwdJ lhTUuJOS/8GjI14+Uynzn55/vLAojPV7K3l7CWpsSYkEQ7k8DQbKKb5x+4O9qw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Prd9G3gNpzssD; Tue, 4 Apr 2023 19:28:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 334JSoBO093129; Tue, 4 Apr 2023 19:28:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 334JSoOX093128; Tue, 4 Apr 2023 19:28:50 GMT (envelope-from git) Date: Tue, 4 Apr 2023 19:28:50 GMT Message-Id: <202304041928.334JSoOX093128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: ecaeac805b04 - main - mlxfw: fix potential NULL pointer dereference List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecaeac805b044f715c98960a8fbf19fe2b76ae6b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=ecaeac805b044f715c98960a8fbf19fe2b76ae6b commit ecaeac805b044f715c98960a8fbf19fe2b76ae6b Author: Eric van Gyzen AuthorDate: 2023-03-30 23:27:06 +0000 Commit: Eric van Gyzen CommitDate: 2023-04-04 20:27:46 +0000 mlxfw: fix potential NULL pointer dereference Reported by: Coverity (an internal run at Dell) Reviewed by: kib MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D39348 --- sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c b/sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c index 1b6080930724..78ddf10f359d 100644 --- a/sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c +++ b/sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c @@ -60,6 +60,8 @@ mlxfw_mfa2_tlv_next(const struct mlxfw_mfa2_file *mfa2_file, if (tlv->type == MLXFW_MFA2_TLV_MULTI_PART) { multi = mlxfw_mfa2_tlv_multi_get(mfa2_file, tlv); + if (!multi) + return NULL; tlv_len = NLA_ALIGN(tlv_len + be16_to_cpu(multi->total_len)); }