Re: [PATCH 10/17] delta: Fix buffer overrun in delta_ipc_open

2019-04-02 Thread Hugues FRUCHET
Hi Andi, So do both, memset then strscpy: + memset(msg.name, 0, sizeof(msg.name)); + if (strscpy(msg.name, name, sizeof(msg.name)) <= 0) + goto err; BR, Hugues. On 4/1/19 6:54 PM, Andi Kleen wrote: > On Mon, Apr 01, 2019 at 01:37:56PM +, Hugues FRUCHET wrote: >> Hi Andi,

Re: [PATCH 10/17] delta: Fix buffer overrun in delta_ipc_open

2019-04-01 Thread Andi Kleen
On Mon, Apr 01, 2019 at 01:37:56PM +, Hugues FRUCHET wrote: > Hi Andi, > > We have already discussed about that here: > https://lore.kernel.org/patchwork/patch/866406/ > > Now that strscpy is largely deployed within kernel, could you retest > with the change I suggested ? strscpy is not the

Re: [PATCH 10/17] delta: Fix buffer overrun in delta_ipc_open

2019-04-01 Thread Hugues FRUCHET
Hi Andi, We have already discussed about that here: https://lore.kernel.org/patchwork/patch/866406/ Now that strscpy is largely deployed within kernel, could you retest with the change I suggested ? Best regards, Hugues. On 3/21/19 11:00 PM, Andi Kleen wrote: > From: Andi Kleen > > delta_ipc

[PATCH 10/17] delta: Fix buffer overrun in delta_ipc_open

2019-03-21 Thread Andi Kleen
From: Andi Kleen delta_ipc_open is always called with a single constant string as name, but it uses a longer memcpy to copy the string to a different structure. The memcpy would read outside the bounds of the string, potentially accessing unmapped memory. Just use strcpy instead after clearing t