RE: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()
From: YUAN Linyu <hidden>
Date: 2017-05-31 00:21:37
From: YUAN Linyu <hidden>
Date: 2017-05-31 00:21:37
Hi joe,
-----Original Message----- From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Joe Perches Sent: Tuesday, May 30, 2017 11:41 AM To: David Miller; cugyly@163.com Cc: netdev@vger.kernel.org; dsahern@gmail.com; YUAN Linyu Subject: Re: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option() On Mon, 2017-05-29 at 23:30 -0400, David Miller wrote:quoted
From: yuan linyu <redacted> Date: Sat, 27 May 2017 06:00:52 +0800quoted
From: yuan linyu <redacted> Signed-off-by: yuan linyu <redacted>Applied, thanks.OK, but is it really safe though? Could "space" (an int) ever be negative after subtracting "pad" and "data_len"?
It's safe, check int space = __ndisc_opt_addr_space(data_len, pad); space is maximum aligned value. And I check current pad, the maximum value is 2.