[PATCH 1/1] drivers/net/i40e: define proper net_device::neigh_priv_len

2018-11-23 Thread Konstantin Khorenko
But the driver does not setup dev->neigh_priv_len and we read beyond the neigh entry allocated memory, so the patch in the next mail fixes this. Signed-off-by: Konstantin Khorenko --- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/et

[PATCH 0/1] drivers/i40iw: out of bound access in i40iw_net_event()

2018-11-23 Thread Konstantin Khorenko
00\000" neigh_priv_len = 16 880650932200 name = "enp6s0f1\000\000\000\000\000\000\000" neigh_priv_len = 16 880642903300 name = "ib0\000\000\000\000\000\000\000\000\000\000\000\000" neigh_priv_len = 200 = Konstantin Khorenko (1): drivers/net/i40e: define proper net_device::neigh_priv_len drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.15.1

[PATCH v3 2/2] net/sctp: Replace in/out stream arrays with flex_array

2018-08-10 Thread Konstantin Khorenko
This path replaces physically contiguous memory arrays allocated using kmalloc_array() with flexible arrays. This enables to avoid memory allocation failures on the systems under a memory stress. Signed-off-by: Oleg Babin Signed-off-by: Konstantin Khorenko --- include/net/sctp/structs.h | 9

[PATCH v3 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-10 Thread Konstantin Khorenko
Each SCTP association can have up to 65535 input and output streams. For each stream type an array of sctp_stream_in or sctp_stream_out structures is allocated using kmalloc_array() function. This function allocates physically contiguous memory regions, so this can lead to allocation of memory regi

[PATCH v3 1/2] net/sctp: Make wrappers for accessing in/out streams

2018-08-10 Thread Konstantin Khorenko
-by: Konstantin Khorenko --- v2 changes: sctp_stream_in() users are updated to provide stream as an argument, sctp_stream_{in,out}_ptr() are now just sctp_stream_{in,out}(). v3 changes: Move type chages struct sctp_stream_out -> flex_array to next patch. Make sctp_stream_{in,out}() sta

Re: [PATCH v2 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-10 Thread Konstantin Khorenko
On 08/09/2018 11:43 AM, Konstantin Khorenko wrote: On 08/04/2018 02:36 AM, Marcelo Ricardo Leitner wrote: On Fri, Aug 03, 2018 at 07:21:00PM +0300, Konstantin Khorenko wrote: ... Performance results: * Kernel: v4.18-rc6 - stock and with 2 patches from Oleg (earlier in

Re: [PATCH v2 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-09 Thread Konstantin Khorenko
On 08/04/2018 02:36 AM, Marcelo Ricardo Leitner wrote: On Fri, Aug 03, 2018 at 07:21:00PM +0300, Konstantin Khorenko wrote: ... Performance results: * Kernel: v4.18-rc6 - stock and with 2 patches from Oleg (earlier in this thread) * Node: CPU (8 cores): Intel(R) Xeon(R

Re: [PATCH v2 1/2] net/sctp: Make wrappers for accessing in/out streams

2018-08-09 Thread Konstantin Khorenko
On 08/03/2018 11:40 PM, Marcelo Ricardo Leitner wrote: On Fri, Aug 03, 2018 at 07:21:01PM +0300, Konstantin Khorenko wrote: This patch introduces wrappers for accessing in/out streams indirectly. This will enable to replace physically contiguous memory arrays of streams with flexible arrays (or

Re: [PATCH v2 1/2] net/sctp: Make wrappers for accessing in/out streams

2018-08-09 Thread Konstantin Khorenko
On 08/03/2018 10:50 PM, David Miller wrote: From: Konstantin Khorenko Date: Fri, 3 Aug 2018 19:21:01 +0300 +struct sctp_stream_out *sctp_stream_out(const struct sctp_stream *stream, + __u16 sid) +{ + return ((struct sctp_stream_out *)(stream->

[PATCH v2 1/2] net/sctp: Make wrappers for accessing in/out streams

2018-08-03 Thread Konstantin Khorenko
-by: Konstantin Khorenko --- v2 changes: sctp_stream_in() users are updated to provide stream as an argument, sctp_stream_{in,out}_ptr() are now just sctp_stream_{in,out}(). --- include/net/sctp/structs.h | 30 +++- net/sctp/chunk.c | 6 ++- net/sctp/outqueue.c

[PATCH v2 2/2] net/sctp: Replace in/out stream arrays with flex_array

2018-08-03 Thread Konstantin Khorenko
This path replaces physically contiguous memory arrays allocated using kmalloc_array() with flexible arrays. This enables to avoid memory allocation failures on the systems under a memory stress. Signed-off-by: Oleg Babin --- include/net/sctp/structs.h | 1 + net/sctp/stream.c | 78 +++

[PATCH v2 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-03 Thread Konstantin Khorenko
Each SCTP association can have up to 65535 input and output streams. For each stream type an array of sctp_stream_in or sctp_stream_out structures is allocated using kmalloc_array() function. This function allocates physically contiguous memory regions, so this can lead to allocation of memory regi

Re: [PATCH net-next 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-07-24 Thread Konstantin Khorenko
On 04/27/2018 01:28 AM, Marcelo Ricardo Leitner wrote: > On Fri, Apr 27, 2018 at 01:14:56AM +0300, Oleg Babin wrote: >> Hi Marcelo, >> >> On 04/24/2018 12:33 AM, Marcelo Ricardo Leitner wrote: >>> Hi, >>> >>> On Mon, Apr 23, 2018 at 09:41:04PM +0300, Oleg Babin wrote: Each SCTP association ca