lkml.org 
[lkml]   [2012]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[ 85/95] dm ioctl: do not leak argv if target message only contains whitespace
    3.2-stable review patch.  If anyone has any objections, please let me know.

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

    From: Jesper Juhl <jj@chaosbits.net>

    commit 902c6a96a7cb9c50d2a8aed1788efad0a5d8f04c upstream.

    If 'argc' is zero we jump to the 'out:' label, but this leaks the
    (unused) memory that 'dm_split_args()' allocated for 'argv' if the
    string being split consisted entirely of whitespace. Jump to the
    'out_argv:' label instead to free up that memory.

    Signed-off-by: Jesper Juhl <jj@chaosbits.net>
    Signed-off-by: Alasdair G Kergon <agk@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/md/dm-ioctl.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/md/dm-ioctl.c
    +++ b/drivers/md/dm-ioctl.c
    @@ -1437,7 +1437,7 @@ static int target_message(struct dm_ioct

    if (!argc) {
    DMWARN("Empty message received.");
    - goto out;
    + goto out_argv;
    }

    table = dm_get_live_table(md);



    \
     
     \ /
      Last update: 2012-03-09 21:15    [W:0.020 / U:63.900 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site