[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180416.125814.883736880189372257.davem@davemloft.net>
Date: Mon, 16 Apr 2018 12:58:14 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: gfree.wind@....163.com
Cc: kuznet@....inr.ac.ru, netdev@...r.kernel.org
Subject: Re: [PATCH net] net: Fix one possible memleak in ip_setup_cork
From: gfree.wind@....163.com
Date: Mon, 16 Apr 2018 10:16:45 +0800
> From: Gao Feng <gfree.wind@....163.com>
>
> It would allocate memory in this function when the cork->opt is NULL. But
> the memory isn't freed if failed in the latter rt check, and return error
> directly. It causes the memleak if its caller is ip_make_skb which also
> doesn't free the cork->opt when meet a error.
>
> Now move the rt check ahead to avoid the memleak.
>
> Signed-off-by: Gao Feng <gfree.wind@....163.com>
Looks good, applied and queued up for -stable.
I guess in the other code paths, ip_flush_pending_frames() or similar
would clean up the in-sock cork information.
Powered by blists - more mailing lists