Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932383AbbKXWl2 (ORCPT ); Tue, 24 Nov 2015 17:41:28 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:40417 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755487AbbKXWfp (ORCPT ); Tue, 24 Nov 2015 17:35:45 -0500 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Marek Vasut" , "Marc Kleine-Budde" , "Wolfgang Grandegger" , netdev@vger.kernel.org Date: Tue, 24 Nov 2015 22:33:59 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.2 24/52] can: Use correct type in sizeof() in nla_put() In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.247 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1504 Lines: 40 3.2.74-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Marek Vasut commit 562b103a21974c2f9cd67514d110f918bb3e1796 upstream. The sizeof() is invoked on an incorrect variable, likely due to some copy-paste error, and this might result in memory corruption. Fix this. Signed-off-by: Marek Vasut Cc: Wolfgang Grandegger Cc: netdev@vger.kernel.org Signed-off-by: Marc Kleine-Budde [bwh: Backported to 3.2: - Keep using the old NLA_PUT macro - Adjust context] Signed-off-by: Ben Hutchings --- drivers/net/can/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -693,7 +693,7 @@ static int can_fill_info(struct sk_buff NLA_PUT_U32(skb, IFLA_CAN_RESTART_MS, priv->restart_ms); NLA_PUT(skb, IFLA_CAN_BITTIMING, sizeof(priv->bittiming), &priv->bittiming); - NLA_PUT(skb, IFLA_CAN_CLOCK, sizeof(cm), &priv->clock); + NLA_PUT(skb, IFLA_CAN_CLOCK, sizeof(priv->clock), &priv->clock); if (priv->do_get_berr_counter && !priv->do_get_berr_counter(dev, &bec)) NLA_PUT(skb, IFLA_CAN_BERR_COUNTER, sizeof(bec), &bec); if (priv->bittiming_const) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/