[dm-devel] [PATCH 01/12] Fix memory issues in path reordering failure code paths

Christophe Varoqui christophe.varoqui at opensvc.com
Tue Jul 1 18:45:05 UTC 2014


Applied.
Thanks.


On Mon, Jun 30, 2014 at 7:13 AM, Benjamin Marzinski <bmarzins at redhat.com>
wrote:

> There were some possible NULL pointer dereferences and multiple frees
> in the failure code paths of the path reordering code.  This patch
> cleans them up.
>
> Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
> ---
>  libmultipath/configure.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/libmultipath/configure.c b/libmultipath/configure.c
> index 3ed6b55..6ad7a80 100644
> --- a/libmultipath/configure.c
> +++ b/libmultipath/configure.c
> @@ -160,8 +160,16 @@ int order_paths_in_pg_by_alt_adapters(struct
> pathgroup *pgp, vector adapters,
>
>         while (total_paths > 0) {
>                 agp = VECTOR_SLOT(adapters, next_adapter_index);
> +               if (!agp) {
> +                       condlog(0, "can't get adapter group %d",
> next_adapter_index);
> +                       return 1;
> +               }
>
>                 hgp = VECTOR_SLOT(agp->host_groups, agp->next_host_index);
> +               if (!hgp) {
> +                       condlog(0, "can't get host group %d of adapter
> group %d", next_adapter_index, agp->next_host_index);
> +                       return 1;
> +               }
>
>                 if (!hgp->num_paths) {
>                         agp->next_host_index++;
> @@ -223,8 +231,8 @@ int rr_optimize_path_order(struct pathgroup *pgp)
>         /* group paths in path group by host adapters
>          */
>         if (group_by_host_adapter(pgp, adapters)) {
> +               /* already freed adapters */
>                 condlog(3, "Failed to group paths by adapters");
> -               free_adaptergroup(adapters);
>                 return 0;
>         }
>
> --
> 1.8.3.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20140701/2cdb1e71/attachment.htm>


More information about the dm-devel mailing list