[ovs-dev] [PATCH v1 ovn] Fix seg fault while encoding DHCP domain search option.

Numan Siddique numans at ovn.org
Wed Jul 1 06:10:01 UTC 2020


On Wed, Jul 1, 2020 at 6:08 AM Ankur Sharma <ankur.sharma at nutanix.com>
wrote:

> Hi Dhathri,
>
> Please Add "Fixes" header to commit message.
> Acked-by: Ankur Sharma <ankur.sharma at nutanix.com>
>


Thanks.

I applied this patch to master.

Numan


>
> Regards,
> Ankur
> ________________________________
> From: dev <ovs-dev-bounces at openvswitch.org> on behalf of
> svc.eng.git-patch at nutanix.com <svc.eng.git-patch at nutanix.com>
> Sent: Tuesday, June 30, 2020 10:04 AM
> To: ovs-dev at openvswitch.org <ovs-dev at openvswitch.org>
> Cc: Dhathri Purohith <dhathri.purohith at nutanix.com>
> Subject: [ovs-dev] [PATCH v1 ovn] Fix seg fault while encoding DHCP domain
> search option.
>
> From: Dhathri Purohith <dhathri.purohith at nutanix.com>
>
> Some versions of strtok_r make the original string NULL at the
> end of parsing. Adding Null check before ovs_strlcpy() to
> prevent segfault in such cases.
>
> Fixes: d79bb92c4b49 ("Add support for DHCP domain search option (119)")
>
> Signed-off-by: Dhathri Purohith <dhathri.purohith at nutanix.com>
> ---
>  lib/actions.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/actions.c b/lib/actions.c
> index ee7c825..c435188 100644
> --- a/lib/actions.c
> +++ b/lib/actions.c
> @@ -2382,7 +2382,9 @@ encode_put_dhcpv4_option(const struct
> ovnact_gen_option *o,
>                      memcpy(dns_encoded + encode_offset, label, len);
>                      encode_offset += len;
>                  }
> -               ovs_strlcpy(suffix, domain, strlen(domain));
> +                if (domain != NULL) {
> +                    ovs_strlcpy(suffix, domain, strlen(domain));
> +                }
>              }
>              /* Add the end marker (0 byte) to determine the end of the
>               * domain. */
> --
> 1.8.3.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=s883GpUCOChKOHiocYtGcg&r=mZwX9gFQgeJHzTg-68aCJgsODyUEVsHGFOfL90J6MJY&m=mrAPsNW3OUjyTaiBr9x2Wdad6HyRZlWB0aP_jabab2Q&s=BP9Lyas6JfOFnD5o4bicAfuqjSVXjXMSyUVHPki1Ijo&e=
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>


More information about the dev mailing list