public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation•org>
To: linux-kernel@vger•kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
	stable@vger•kernel.org, Marek Vasut <marex@denx•de>,
	Wolfgang Grandegger <wg@grandegger•com>,
	netdev@vger•kernel.org, Marc Kleine-Budde <mkl@pengutronix•de>
Subject: [PATCH 4.1 62/95] can: Use correct type in sizeof() in nla_put()
Date: Mon,  7 Dec 2015 09:35:56 -0500	[thread overview]
Message-ID: <20151207142742.326814939@linuxfoundation.org> (raw)
In-Reply-To: <20151207142739.317088107@linuxfoundation.org>

4.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Marek Vasut <marex@denx•de>

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 <marex@denx•de>
Cc: Wolfgang Grandegger <wg@grandegger•com>
Cc: netdev@vger•kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix•de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation•org>

---
 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
@@ -915,7 +915,7 @@ static int can_fill_info(struct sk_buff
 	     nla_put(skb, IFLA_CAN_BITTIMING_CONST,
 		     sizeof(*priv->bittiming_const), priv->bittiming_const)) ||
 
-	    nla_put(skb, IFLA_CAN_CLOCK, sizeof(cm), &priv->clock) ||
+	    nla_put(skb, IFLA_CAN_CLOCK, sizeof(priv->clock), &priv->clock) ||
 	    nla_put_u32(skb, IFLA_CAN_STATE, state) ||
 	    nla_put(skb, IFLA_CAN_CTRLMODE, sizeof(cm), &cm) ||
 	    nla_put_u32(skb, IFLA_CAN_RESTART_MS, priv->restart_ms) ||

           reply	other threads:[~2015-12-07 14:35 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20151207142739.317088107@linuxfoundation.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151207142742.326814939@linuxfoundation.org \
    --to=gregkh@linuxfoundation$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=marex@denx$(echo .)de \
    --cc=mkl@pengutronix$(echo .)de \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=stable@vger$(echo .)kernel.org \
    --cc=wg@grandegger$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox