lkml.org 
[lkml]   [2019]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.20 26/92] nvme-multipath: zero out ANA log buffer
    Date
    4.20-stable review patch.  If anyone has any objections, please let me know.

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

    [ Upstream commit c7055fd15ff46d92eb0dd1c16a4fe010d58224c8 ]

    When nvme_init_identify() fails the ANA log buffer is deallocated
    but _not_ set to NULL. This can cause double free oops when this
    controller is deleted without ever being reconnected.

    Signed-off-by: Hannes Reinecke <hare@suse.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/nvme/host/multipath.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
    index 9901afd804ce..2b1d1f066efa 100644
    --- a/drivers/nvme/host/multipath.c
    +++ b/drivers/nvme/host/multipath.c
    @@ -586,6 +586,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
    return 0;
    out_free_ana_log_buf:
    kfree(ctrl->ana_log_buf);
    + ctrl->ana_log_buf = NULL;
    out:
    return error;
    }
    @@ -593,5 +594,6 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
    void nvme_mpath_uninit(struct nvme_ctrl *ctrl)
    {
    kfree(ctrl->ana_log_buf);
    + ctrl->ana_log_buf = NULL;
    }

    --
    2.19.1


    \
     
     \ /
      Last update: 2019-02-18 14:46    [W:4.142 / U:0.200 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site