From: David Miller <davem@davemloft.net>
To: dan.carpenter@oracle.com
Cc: michael.jamet@intel.com, amir.jer.levy@intel.com,
mika.westerberg@linux.intel.com, yehezkel.bernat@intel.com,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/2 net-next] thunderbolt: Right shifting to zero bug in tbnet_handle_packet()
Date: Thu, 19 Oct 2017 13:05:07 +0100 (WEST) [thread overview]
Message-ID: <20171019.130507.171332903320471229.davem@davemloft.net> (raw)
In-Reply-To: <20171017123301.z6heqexdlo6lc52b@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 17 Oct 2017 15:33:01 +0300
> There is a problem when we do:
>
> sequence = pkg->hdr.length_sn & TBIP_HDR_SN_MASK;
> sequence >>= TBIP_HDR_SN_SHIFT;
>
> TBIP_HDR_SN_SHIFT is 27, and right shifting a u8 27 bits is always
> going to result in zero. The fix is to declare these variables as u32.
>
> Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
prev parent reply other threads:[~2017-10-19 12:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171013112959.sc2pwazrpk7fxbtw@mwanda>
2017-10-17 12:32 ` [PATCH 1/2 v2 net-next] thunderbolt: Fix a couple right shifting to zero bugs Dan Carpenter
2017-10-19 12:04 ` David Miller
2017-10-17 12:33 ` [PATCH 2/2 net-next] thunderbolt: Right shifting to zero bug in tbnet_handle_packet() Dan Carpenter
2017-10-17 13:17 ` Bernat, Yehezkel
2017-10-19 12:05 ` David Miller [this message]
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=20171019.130507.171332903320471229.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=amir.jer.levy@intel.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=michael.jamet@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=yehezkel.bernat@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).