From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754418AbdEHLtY (ORCPT ); Mon, 8 May 2017 07:49:24 -0400 Received: from a.mx.secunet.com ([62.96.220.36]:36416 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752845AbdEHLtW (ORCPT ); Mon, 8 May 2017 07:49:22 -0400 Date: Mon, 8 May 2017 13:49:19 +0200 From: Steffen Klassert To: Andrey Konovalov CC: Herbert Xu , "David S. Miller" , netdev , LKML , Dmitry Vyukov , "Kostya Serebryany" , Eric Dumazet , Cong Wang , syzkaller Subject: Re: net/key: slab-out-of-bounds in pfkey_compile_policy Message-ID: <20170508114918.GB9813@secunet.com> References: <20170505091105.GA9813@secunet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.182.7.193] X-G-Data-MailSecurity-for-Exchange-State: 0 X-G-Data-MailSecurity-for-Exchange-Error: 0 X-G-Data-MailSecurity-for-Exchange-Sender: 23 X-G-Data-MailSecurity-for-Exchange-Server: d65e63f7-5c15-413f-8f63-c0d707471c93 X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-G-Data-MailSecurity-for-Exchange-Guid: 815DB195-0CDB-4923-854E-537BED43CB76 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 05, 2017 at 02:18:01PM +0200, Andrey Konovalov wrote: > On Fri, May 5, 2017 at 11:11 AM, Steffen Klassert > wrote: > > On Tue, May 02, 2017 at 06:45:03PM +0200, Andrey Konovalov wrote: > >> Hi, > >> > >> I've got the following error report while fuzzing the kernel with syzkaller. > >> > >> On commit d3b5d35290d729a2518af00feca867385a1b08fa (4.11). > >> > >> A reproducer and .config are attached. > >> > >> ================================================================== > >> BUG: KASAN: slab-out-of-bounds in pfkey_compile_policy+0x8e6/0xd40 at > >> addr ffff88006701f798 > >> Read of size 1280 by task a.out/4181 > > > > > > This bug was introduced twelve years ago... > > > > This patch is based just on code review, I don't have an option to > > function test this. But I see that we now exit with -EINVAL before the > > memcpy that causes the slab-out-of-bounds when using your reproducer, > > so it should at least fix the bug. > > Hi Steffen, > > This patch fixes the issue for me. > > Thanks! > > Tested-by: Andrey Konovalov Patch is now applied to the ipsec tree. Thanks for reporting and testing!