Received: by 10.213.65.68 with SMTP id h4csp246484imn; Fri, 23 Mar 2018 03:50:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELtKmPgEQ668VCZxKPrr028fQMVxEsjS8QZ4HivrtiEYG6MDFlnYY0iBLnA8nH4swFoU0pCc X-Received: by 10.98.147.135 with SMTP id r7mr13904464pfk.31.1521802259093; Fri, 23 Mar 2018 03:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521802259; cv=none; d=google.com; s=arc-20160816; b=biM6vJhg2non7ZvuUgCgS4W9nV1nGWWdt2DUbM8YW7PQ1kZx5VwhFfqoUANhe/BRPM +fVSxOI2VEbOaQArBfYWknv1hVEWbnn0p7kT9Imd/jA0joakJ5j1gDGgoLane5J0KRY3 s66g31x0PIuAVEec3yI8ZWbtGGCzll9xnV/VfU6ULZeuQsUM/Nj961YELoPXQmqNdfYs fCE4kicRab8acDyXYmLZ05MJmES5ZfEVG4sJoEeM1T7r2rixMeU/4ZskiXF3lcN4zGvl GiCYt18BLBTiPXbYNsNVoEDM/f1KrOjCpriON2o5Bwht4MCSd0zumHuB6vy1WEsON07L 1ykw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=StFHjA8onAPpn58Zp7uW8E2FhafJ0Z6Du3xS/DDkD7w=; b=fQ4lxqcfVXxLAsz46zzH2XedwAYlMeXloSitVNqlH0+0YYz0650NYB7Qev2AhWAzZF tzjsIjbgoJifZZI0y4P2qbzCaUEaxHBcJK4D/qtkppXR1aZI0Q28tAh6BlhNh7+qzOmJ SAsj6I4EhAijLrZs1R7GmlnAfkGgYgGwdNlHf5ASi+tyhts9ZsCUOqDyX/EAlWZnV48n Uhr6CVB4lIGLrbdgSLyACrWNPqPDGGIcziR+dcD5AMqeg7xiLswe24/UlUpGLmAlM7yX v1dCKd9fKw9XJ0+ZyeWF/ZwfYF7E6fcLenwaHWmSjBa2CxPnGXfgiEpWVLeNyhtNnWEk flXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf5-v6si7916391plb.583.2018.03.23.03.50.44; Fri, 23 Mar 2018 03:50:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933357AbeCWKOm (ORCPT + 99 others); Fri, 23 Mar 2018 06:14:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45312 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933345AbeCWKOh (ORCPT ); Fri, 23 Mar 2018 06:14:37 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0DE2C1253; Fri, 23 Mar 2018 10:14:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Sebastian Reichel , Sasha Levin Subject: [PATCH 4.4 33/97] HSI: ssi_protocol: double free in ssip_pn_xmit() Date: Fri, 23 Mar 2018 10:54:20 +0100 Message-Id: <20180323094159.518124544@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter [ Upstream commit 3026050179a3a9a6f5c892c414b5e36ecf092081 ] If skb_pad() fails then it frees skb and we don't need to free it again at the end of the function. Fixes: dc7bf5d7 ("HSI: Introduce driver for SSI Protocol") Signed-off-by: Dan Carpenter Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/hsi/clients/ssi_protocol.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/hsi/clients/ssi_protocol.c +++ b/drivers/hsi/clients/ssi_protocol.c @@ -976,7 +976,7 @@ static int ssip_pn_xmit(struct sk_buff * goto drop; /* Pad to 32-bits - FIXME: Revisit*/ if ((skb->len & 3) && skb_pad(skb, 4 - (skb->len & 3))) - goto drop; + goto inc_dropped; /* * Modem sends Phonet messages over SSI with its own endianess... @@ -1028,8 +1028,9 @@ static int ssip_pn_xmit(struct sk_buff * drop2: hsi_free_msg(msg); drop: - dev->stats.tx_dropped++; dev_kfree_skb(skb); +inc_dropped: + dev->stats.tx_dropped++; return 0; }