Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3208053pxb; Mon, 9 Nov 2020 05:37:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwa4jFGPubCd8MauGcfLn4G2K59vOuz61Lzkt7/h2I7qM779WcQq+4ZnpwUKBOt9qfDM4C8 X-Received: by 2002:a50:f68b:: with SMTP id d11mr15820787edn.64.1604929058334; Mon, 09 Nov 2020 05:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929058; cv=none; d=google.com; s=arc-20160816; b=TUyuYI0MFJpHdSKmsoKKfBl9Q0WHBUEyS+I1oPD5MHW7ya3R7gwdDhqSl33LpbnPki N9zu/nIdHT2zLbezd763PlJna7jadwa/as8y34KQf9S2Y1MMOtpIhAqhvZBVjnwEfnTe MaaJozFWHOu69OxURSAcyT8J/HbviTCRQzFSoK2IkxvXr8IDJKHGKn6k0BBoAXeBZ5Cr cOGgmL6ag8zTq4EIQ5/pxlphX2l735aEkxci218QMIKF5brfV9ScdawZswXqgcvJ+I3Y vE1l7/4aSRdCCoUPCpwk36UyLpQqvurACBf98VVvH7LliJrJRZBoSsrrKyPodHMS6PJZ YGIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7W71SjXhSFxZfvAUuEy2bdGc1fL1tVqxf68u9wogjDQ=; b=Uyp4qAFRIQ+UT37oMFUj8rqE8L3SfDZEt8IbBjT1sbcKWjhe8IkTPW5fjWaqZxHfhn fCshlPnZUdkdP2yp5PQzCLywmhmLsAwcfNmyePsBEe4hP7bCHrF+vp7D5vnm581aXtZT 7HqgoEPiXUbdiYxD4NL6vVadDy1CZwg8EQkya8bXIqjDtUms2yDd2l+UVNpY5SCfJBlp ClUya3zfsbHzKPbR2TdSPBlUFebgA+iqPNyJD2o8NN4Tu5OO2OhkVXa9xYn4m+YeElcM lgWD4JwU5sH7fq41zvjiR1uOmNIKMHITXwJhCf9zzTQ/4NU168Gbu8aMJjz3CABi2lx0 bENA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QGGDOEhV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si6744213ejb.604.2020.11.09.05.37.14; Mon, 09 Nov 2020 05:37:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QGGDOEhV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732321AbgKINeB (ORCPT + 99 others); Mon, 9 Nov 2020 08:34:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:58826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730974AbgKINGB (ORCPT ); Mon, 9 Nov 2020 08:06:01 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 11E96206C0; Mon, 9 Nov 2020 13:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927160; bh=C6nedIJpJZKheagyONJTZkJ4kWfca7XQdltWRj5Kw7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QGGDOEhVDMZTHFs3DopCO7X70wivwS5azzRkVcZN3pOgIO/annMOnZD2krcC/riSb 4P2lsntwsnpz97cOc/g8tnA6YQIVg4zNbdE2tPM29GOIkIHsHMELMs4XntOZSX7IQV ZfxYUXV0riiRHSQGmDgy4LVwvg70lRUIuvWzFrOY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martyna Szapar , Jeff Kirsher , Ben Hutchings Subject: [PATCH 4.14 14/48] i40e: Fix of memory leak and integer truncation in i40e_virtchnl.c Date: Mon, 9 Nov 2020 13:55:23 +0100 Message-Id: <20201109125017.444598697@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125016.734107741@linuxfoundation.org> References: <20201109125016.734107741@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martyna Szapar commit 24474f2709af6729b9b1da1c5e160ab62e25e3a4 upstream. Fixed possible memory leak in i40e_vc_add_cloud_filter function: cfilter is being allocated and in some error conditions the function returns without freeing the memory. Fix of integer truncation from u16 (type of queue_id value) to u8 when calling i40e_vc_isvalid_queue_id function. Signed-off-by: Martyna Szapar Signed-off-by: Jeff Kirsher [bwh: Backported to 4.14: i40e_vc_add_cloud_filter() does not exist but the integer truncation is still possible] Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -189,7 +189,7 @@ static inline bool i40e_vc_isvalid_vsi_i * check for the valid queue id **/ static inline bool i40e_vc_isvalid_queue_id(struct i40e_vf *vf, u16 vsi_id, - u8 qid) + u16 qid) { struct i40e_pf *pf = vf->pf; struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id);