[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20180605.123102.90625248904541086.davem@davemloft.net>
Date: Tue, 05 Jun 2018 12:31:02 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: sd@...asysnail.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com,
nikolay@...ulusnetworks.com, yuvalm@...lanox.com,
ivecera@...hat.com
Subject: Re: [PATCH net v2 2/2] ipmr: fix error path when ipmr_new_table
fails
From: Sabrina Dubroca <sd@...asysnail.net>
Date: Tue, 5 Jun 2018 15:02:00 +0200
> commit 0bbbf0e7d0e7 ("ipmr, ip6mr: Unite creation of new mr_table")
> refactored ipmr_new_table, so that it now returns NULL when
> mr_table_alloc fails. Unfortunately, all callers of ipmr_new_table
> expect an ERR_PTR.
>
> This can result in NULL deref, for example when ipmr_rules_exit calls
> ipmr_free_table with NULL net->ipv4.mrt in the
> !CONFIG_IP_MROUTE_MULTIPLE_TABLES version.
>
> This patch makes mr_table_alloc return errors, and changes
> ip6mr_new_table and its callers to return/expect error pointers as
> well. It also removes the version of mr_table_alloc defined under
> !CONFIG_IP_MROUTE_COMMON, since it is never used.
>
> Fixes: 0bbbf0e7d0e7 ("ipmr, ip6mr: Unite creation of new mr_table")
> Signed-off-by: Sabrina Dubroca <sd@...asysnail.net>
> ---
> v2: - fixed brainfart that shadowed mrt variable in ip6_mroute_setsockopt
> - rebased on top of ip6_mroute_setsockopt fix
Applied and queued up for -stable.
Powered by blists - more mailing lists