All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
To: "Hefty, Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org"
	<rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2.6.37] RDMA/cxgb3: When a user QP is marked in error, also mark the CQs in error.
Date: Wed, 20 Oct 2010 18:34:24 -0500	[thread overview]
Message-ID: <4CBF7C80.3080400@opengridcomputing.com> (raw)
In-Reply-To: <CF9C39F99A89134C9CF9C4CCB68B8DDF25B801FCA3-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>

On 10/20/2010 5:41 PM, Hefty, Sean wrote:
> You have this check:
>
>>>> +		if (udata->outlen<   sizeof uresp) {
>>>> +			if (!warned++)
>>>> +				printk(KERN_WARNING MOD "Warning - "
>>>> +				       "downlevel libcxgb3 (non-fatal).\n");
>>>> +			mm->len = PAGE_ALIGN((1UL<<   uresp.size_log2) *
>>>> +					     sizeof(struct t3_cqe));
> then fall through to here:
>
>>>>    		if (ib_copy_to_udata(udata,&uresp, sizeof (uresp))) {
>
>> The only way it can be less is if the library is using the ABI 0 version
>> of the response struct.  Or am I missing something?
> To me, this looks like the buffer referenced by udata will be smaller than the size of the data being copied, which I expect would either fail, or the kernel will overwrite some unsuspecting user memory.

You're right: the ib_copy_to_udata() size needs to be adjusted 
accordingly.  Good catch.  Although the testing didn't cause any faults.



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2010-10-20 23:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20 21:44 [PATCH 2.6.37] RDMA/cxgb3: When a user QP is marked in error, also mark the CQs in error Steve Wise
     [not found] ` <20101020214432.4869.50981.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org>
2010-10-20 21:54   ` Roland Dreier
     [not found]     ` <adapqv47co9.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-20 22:36       ` Steve Wise
2010-10-20 22:10   ` Hefty, Sean
     [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B801FC1F-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-10-20 22:37       ` Steve Wise
     [not found]         ` <4CBF6F3F.10507-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2010-10-20 22:41           ` Hefty, Sean
     [not found]             ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B801FCA3-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-10-20 23:34               ` Steve Wise [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=4CBF7C80.3080400@opengridcomputing.com \
    --to=swise-7bpotxp6k4+p2yhjcf5u+vpxobypeauw@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@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.