[PATCH] Fix memory overwriting issue when copy an address to user space

2020-07-20 Thread lebon zhou
On Mon, Jul 20, 2020 at 11:12 PM David Laight wrote: > > From: lebon zhou > > Sent: 20 July 2020 05:35 > > To: da...@davemloft.net; k...@kernel.org > > Cc: linux-kernel@vger.kernel.org; net...@vger.kernel.org > > Subject: [PATCH] Fix memory overwriting issu

RE: [PATCH] Fix memory overwriting issue when copy an address to user space

2020-07-20 Thread David Laight
From: lebon zhou > Sent: 20 July 2020 05:35 > To: da...@davemloft.net; k...@kernel.org > Cc: linux-kernel@vger.kernel.org; net...@vger.kernel.org > Subject: [PATCH] Fix memory overwriting issue when copy an address to user > space > > When application provided

[PATCH] Fix memory overwriting issue when copy an address to user space

2020-07-19 Thread lebon zhou
When application provided buffer size less than sockaddr_storage, then kernel will overwrite some memory area which may cause memory corruption, e.g.: in recvmsg case, let msg_name=malloc(8) and msg_namelen=8, then usually application can call recvmsg successful but actually application memory get

Re: [PATCH] Fix memory overwriting issue when copy an address to user space

2020-07-17 Thread David Miller
From: lebon zhou Date: Fri, 17 Jul 2020 10:31:54 + > When application provided buffer size less than sockaddr_storage, then > kernel will overwrite some memory area which may cause memory corruption, > e.g.: in recvmsg case, let msg_name=malloc(8) and msg_namelen=8, then > usually

Re: [PATCH] Fix memory overwriting issue when copy an address to user space

2020-07-17 Thread Jakub Kicinski
On Fri, 17 Jul 2020 10:31:54 + lebon zhou wrote: > When application provided buffer size less than sockaddr_storage, then > kernel will overwrite some memory area which may cause memory corruption, > e.g.: in recvmsg case, let msg_name=malloc(8) and msg_namelen=8, then > usually application

[PATCH] Fix memory overwriting issue when copy an address to user space

2020-07-17 Thread lebon zhou
When application provided buffer size less than sockaddr_storage, then kernel will overwrite some memory area which may cause memory corruption, e.g.: in recvmsg case, let msg_name=malloc(8) and msg_namelen=8, then usually application can call recvmsg successful but actually application memory get