All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Dennis Dalessandro
	<dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Mitko Haralanov
	<mitko.haralanov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 3/3] IB/hfi1: Don't attempt to free resources if initialization failed
Date: Thu, 21 Apr 2016 12:40:35 +0300	[thread overview]
Message-ID: <20160421094035.GC26951@leon.nu> (raw)
In-Reply-To: <20160420130535.28231.36344.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2782 bytes --]

On Wed, Apr 20, 2016 at 06:05:36AM -0700, Dennis Dalessandro wrote:
> From: Mitko Haralanov <mitko.haralanov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> Attempting to free resources which have not been allocated and
> initialized properly led to the following kernel backtrace:
> 
>     BUG: unable to handle kernel NULL pointer dereference at           (null)
>     IP: [<ffffffffa09658fe>] unlock_exp_tids.isra.8+0x2e/0x120 [hfi1]
>     PGD 852a43067 PUD 85d4a6067 PMD 0
>     Oops: 0000 [#1] SMP
>     CPU: 0 PID: 2831 Comm: osu_bw Tainted: G          IO 3.12.18-wfr+ #1
>     task: ffff88085b15b540 ti: ffff8808588fe000 task.ti: ffff8808588fe000
>     RIP: 0010:[<ffffffffa09658fe>]  [<ffffffffa09658fe>] unlock_exp_tids.isra.8+0x2e/0x120 [hfi1]
>     RSP: 0018:ffff8808588ffde0  EFLAGS: 00010282
>     RAX: 0000000000000000 RBX: ffff880858a31800 RCX: 0000000000000000
>     RDX: ffff88085d971bc0 RSI: ffff880858a318f8 RDI: ffff880858a318c0
>     RBP: ffff8808588ffe20 R08: 0000000000000000 R09: 0000000000000000
>     R10: ffff88087ffd6f40 R11: 0000000001100348 R12: ffff880852900000
>     R13: ffff880858a318c0 R14: 0000000000000000 R15: ffff88085d971be8
>     FS:  00007f4674e83740(0000) GS:ffff88087f400000(0000) knlGS:0000000000000000
>     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>     CR2: 0000000000000000 CR3: 000000085c377000 CR4: 00000000001407f0
>     Stack:
>      ffffffffa0941a71 ffff880858a318f8 ffff88085d971bc0 ffff880858a31800
>      ffff880852900000 ffff880858a31800 00000000003ffff7 ffff88085d971bc0
>      ffff8808588ffe60 ffffffffa09663fc ffff8808588ffe60 ffff880858a31800
>     Call Trace:
>      [<ffffffffa0941a71>] ? find_mmu_handler+0x51/0x70 [hfi1]
>      [<ffffffffa09663fc>] hfi1_user_exp_rcv_free+0x6c/0x120 [hfi1]
>      [<ffffffffa0932809>] hfi1_file_close+0x1a9/0x340 [hfi1]
>      [<ffffffff8116c189>] __fput+0xe9/0x270
>      [<ffffffff8116c35e>] ____fput+0xe/0x10
>      [<ffffffff81065707>] task_work_run+0xa7/0xe0
>      [<ffffffff81002969>] do_notify_resume+0x59/0x80
>      [<ffffffff814ffc1a>] int_signal+0x12/0x17
> 
> This commit re-arranges the context initialization code in a way that
> would allow for context event flags to be used to determine whether
> the context has been successfully initialized.
> 
> In turn, this can be used to skip the resource de-allocation if they
> were never allocated in the first place.
> 
> Fixes: 3abb33ac6521 ("staging/hfi1: Add TID cache receive init and free funcs")
> Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Mitko Haralanov <mitko.haralanov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzUU04JRNCRQjg@public.gmane.org

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2016-04-21  9:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20 13:05 [PATCH 0/3] IB/hfi1, rdmavt: Additional bug fixes for 4.6 RC Dennis Dalessandro
     [not found] ` <20160420125205.28231.86818.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-04-20 13:05   ` [PATCH 1/3] IB/rdmavt,hfi1,qib: Fix memory leak Dennis Dalessandro
     [not found]     ` <20160420130523.28231.90454.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-04-21  9:38       ` Leon Romanovsky
     [not found]         ` <20160421093827.GA26951-2ukJVAZIZ/Y@public.gmane.org>
2016-04-21 12:22           ` Dennis Dalessandro
     [not found]             ` <20160421122216.GA13471-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2016-04-21 12:50               ` Leon Romanovsky
     [not found]                 ` <20160421125042.GH26951-2ukJVAZIZ/Y@public.gmane.org>
2016-04-21 13:42                   ` Dennis Dalessandro
2016-04-20 13:05   ` [PATCH 2/3] IB/hfi1: Fix missing lock/unlock in verbs drain callback Dennis Dalessandro
     [not found]     ` <20160420130529.28231.58580.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-04-21  9:39       ` Leon Romanovsky
2016-04-20 13:05   ` [PATCH 3/3] IB/hfi1: Don't attempt to free resources if initialization failed Dennis Dalessandro
     [not found]     ` <20160420130535.28231.36344.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-04-21  9:40       ` Leon Romanovsky [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=20160421094035.GC26951@leon.nu \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mitko.haralanov-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.