From: "Woodhouse, David" <david.woodhouse@intel.com>
To: "joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org"
<joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>,
"dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org"
<dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
"kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [patch] iommu/vt-d: shift wrapping bug in prq_event_thread()
Date: Fri, 16 Oct 2015 16:28:34 +0000 [thread overview]
Message-ID: <1445012914.53393.134.camel@intel.com> (raw)
In-Reply-To: <20151015182515.GE3163@mwanda>
[-- Attachment #1: Type: text/plain, Size: 846 bytes --]
On Thu, 2015-10-15 at 21:25 +0300, Dan Carpenter wrote:
> The "req->addr" variable is a bit field declared as "u64 addr:52;".
> The "address" variable is a u64. We need to cast "req->addr" to a u64
> before the shift or the result is truncated to 52 bits.
>
> Fixes: 0b9252a34858 ('iommu/vt-d: Implement page request handling')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied; thanks.
> Also does this code work if PAGE_SHIFT is more than 12? (I am a newbie
> so this is not rhetorical, I don't know the answer).
Er, no it doesn't. That should have been VTD_PAGE_SHIFT, not PAGE_SHIFT
— and then it *will* always be 12. Thanks for pointing it out.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3437 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: "Woodhouse, David" <david.woodhouse-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: "joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org"
<joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>,
"dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org"
<dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
"kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [patch] iommu/vt-d: shift wrapping bug in prq_event_thread()
Date: Fri, 16 Oct 2015 16:28:34 +0000 [thread overview]
Message-ID: <1445012914.53393.134.camel@intel.com> (raw)
In-Reply-To: <20151015182515.GE3163@mwanda>
[-- Attachment #1.1: Type: text/plain, Size: 905 bytes --]
On Thu, 2015-10-15 at 21:25 +0300, Dan Carpenter wrote:
> The "req->addr" variable is a bit field declared as "u64 addr:52;".
> The "address" variable is a u64. We need to cast "req->addr" to a u64
> before the shift or the result is truncated to 52 bits.
>
> Fixes: 0b9252a34858 ('iommu/vt-d: Implement page request handling')
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Applied; thanks.
> Also does this code work if PAGE_SHIFT is more than 12? (I am a newbie
> so this is not rhetorical, I don't know the answer).
Er, no it doesn't. That should have been VTD_PAGE_SHIFT, not PAGE_SHIFT
— and then it *will* always be 12. Thanks for pointing it out.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org Intel Corporation
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3437 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2015-10-16 16:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 18:25 [patch] iommu/vt-d: shift wrapping bug in prq_event_thread() Dan Carpenter
2015-10-15 18:25 ` Dan Carpenter
2015-10-16 16:28 ` Woodhouse, David [this message]
2015-10-16 16:28 ` Woodhouse, David
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=1445012914.53393.134.camel@intel.com \
--to=david.woodhouse@intel.com \
--cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
--cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.