lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <PU1P153MB01690D8A6D95ED88F8907745BFCD0@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM>
Date:   Wed, 31 Oct 2018 23:33:23 +0000
From:   Dexuan Cui <decui@...rosoft.com>
To:     Sasha Levin <sashal@...nel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     KY Srinivasan <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "Stable@...r.kernel.org" <Stable@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: RE: [PATCH AUTOSEL 4.19 109/146] Drivers: hv: kvp: Fix two "this
 statement may fall through" warnings

> From: Sasha Levin <sashal@...nel.org>
> Sent: Wednesday, October 31, 2018 16:05
> To: stable@...r.kernel.org; linux-kernel@...r.kernel.org
> Cc: Dexuan Cui <decui@...rosoft.com>; KY Srinivasan <kys@...rosoft.com>;
> Haiyang Zhang <haiyangz@...rosoft.com>; Stephen Hemminger
> <sthemmin@...rosoft.com>; Stable@...r.kernel.org; Greg Kroah-Hartman
> <gregkh@...uxfoundation.org>; Sasha Levin <sashal@...nel.org>
> Subject: [PATCH AUTOSEL 4.19 109/146] Drivers: hv: kvp: Fix two "this
> statement may fall through" warnings
> 
> From: Dexuan Cui <decui@...rosoft.com>
> 
> [ Upstream commit fc62c3b1977d62e6374fd6e28d371bb42dfa5c9d ]
> 
> We don't need to call process_ib_ipinfo() if message->kvp_hdr.operation is
> KVP_OP_GET_IP_INFO in kvp_send_key(), because here we just need to pass
> on
> the op code from the host to the userspace; when the userspace returns
> the info requested by the host, we pass the info on to the host in
> kvp_respond_to_host() -> process_ob_ipinfo(). BTW, the current buggy code
> actually doesn't cause any harm, because only message->kvp_hdr.operation
> is used by the userspace, in the case of KVP_OP_GET_IP_INFO.
> 
> The patch also adds a missing "break;" in kvp_send_key(). BTW, the current
> buggy code actually doesn't cause any harm, because in the case of
> KVP_OP_SET, the unexpected fall-through corrupts
> message->body.kvp_set.data.key_size, but that is not really used: see
> the definition of struct hv_kvp_exchg_msg_value.
> 
> Signed-off-by: Dexuan Cui <decui@...rosoft.com>
> Cc: K. Y. Srinivasan <kys@...rosoft.com>
> Cc: Haiyang Zhang <haiyangz@...rosoft.com>
> Cc: Stephen Hemminger <sthemmin@...rosoft.com>
> Cc: <Stable@...r.kernel.org>
> Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
>  drivers/hv/hv_kvp.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
> index 5eed1e7da15c..57715a0c8120 100644
> --- a/drivers/hv/hv_kvp.c
> +++ b/drivers/hv/hv_kvp.c
> @@ -353,7 +353,6 @@ static void process_ib_ipinfo(void *in_msg, void
> *out_msg, int op)
> 
>  		out->body.kvp_ip_val.dhcp_enabled = in->kvp_ip_val.dhcp_enabled;
> 
> -	default:
>  		utf16s_to_utf8s((wchar_t *)in->kvp_ip_val.adapter_id,
>  				MAX_ADAPTER_ID_SIZE,
>  				UTF16_LITTLE_ENDIAN,
> @@ -406,7 +405,7 @@ kvp_send_key(struct work_struct *dummy)
>  		process_ib_ipinfo(in_msg, message, KVP_OP_SET_IP_INFO);
>  		break;
>  	case KVP_OP_GET_IP_INFO:
> -		process_ib_ipinfo(in_msg, message, KVP_OP_GET_IP_INFO);
> +		/* We only need to pass on message->kvp_hdr.operation.  */
>  		break;
>  	case KVP_OP_SET:
>  		switch (in_msg->body.kvp_set.data.value_type) {
> @@ -446,6 +445,9 @@ kvp_send_key(struct work_struct *dummy)
>  			break;
> 
>  		}
> +
> +		break;
> +
>  	case KVP_OP_GET:
>  		message->body.kvp_set.data.key_size =
>  			utf16s_to_utf8s(
> --
> 2.17.1

This patch caused a regression and the fix (https://lkml.org/lkml/2018/10/18/288) 
has not been in Greg's tree yet...

For now, please don't backport this patch to the stable kernels (4.19, 4.18, 4.14, 4.9, 4.4, 3.18,etc). Sorry for the trouble!

-- Dexuan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ