From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754605AbaDNSYO (ORCPT ); Mon, 14 Apr 2014 14:24:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49830 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751686AbaDNSYL (ORCPT ); Mon, 14 Apr 2014 14:24:11 -0400 Message-ID: <534C27BE.9020709@redhat.com> Date: Mon, 14 Apr 2014 20:23:58 +0200 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Kees Cook CC: linux-kernel@vger.kernel.org, Masami Ichikawa , Alexei Starovoitov , Will Drewry , Josh Triplett , Rashika Kheria , James Morris , davem@davemloft.net, eparis@redhat.com, netdev@vger.kernel.org Subject: Re: [PATCH] seccomp: fix memory leak on filter attach References: <20140414171114.GA31384@www.outflux.net> In-Reply-To: <20140414171114.GA31384@www.outflux.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/14/2014 07:11 PM, Kees Cook wrote: > This sets the correct error code when final filter memory is unavailable, > and frees the raw filter no matter what. > > unreferenced object 0xffff8800d6ea4000 (size 512): > comm "sshd", pid 278, jiffies 4294898315 (age 46.653s) > hex dump (first 32 bytes): > 21 00 00 00 04 00 00 00 15 00 01 00 3e 00 00 c0 !...........>... > 06 00 00 00 00 00 00 00 21 00 00 00 00 00 00 00 ........!....... > backtrace: > [] kmemleak_alloc+0x4e/0xb0 > [] __kmalloc+0x280/0x320 > [] prctl_set_seccomp+0x11e/0x3b0 > [] SyS_prctl+0x3bb/0x4a0 > [] system_call_fastpath+0x1a/0x1f > [] 0xffffffffffffffff > > Reported-by: Masami Ichikawa > Signed-off-by: Kees Cook > Cc: stable@vger.kernel.org Acked-by: Daniel Borkmann