Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1948778AbdDYPIo (ORCPT ); Tue, 25 Apr 2017 11:08:44 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:54839 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1948577AbdDYPIc (ORCPT ); Tue, 25 Apr 2017 11:08:32 -0400 MIME-Version: 1.0 In-Reply-To: <20170425145340.GA25241@bistromath.localdomain> References: <20170421211448.16995-1-Jason@zx2c4.com> <20170425145340.GA25241@bistromath.localdomain> From: "Jason A. Donenfeld" Date: Tue, 25 Apr 2017 17:08:28 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] macsec: avoid heap overflow in skb_to_sgvec To: Sabrina Dubroca Cc: Netdev , LKML , David Miller , stable@vger.kernel.org, security@kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 763 Lines: 23 Hi Sabrina, On Tue, Apr 25, 2017 at 4:53 PM, Sabrina Dubroca wrote: > Ugh, good catch :/ > > AFAICT this patch doesn't really help, because NETIF_F_FRAGLIST > doesn't get tested in paths that can lead to triggering this. You're right. This fixes the xmit() path, but not the receive path, which appears to take skbs directly from the upper device. > I'll post a patch to allocate a properly-sized sg array. I just posted this series, which should fix things in a robust way: https://patchwork.ozlabs.org/patch/754861/ If you want to handle fraglists, it might be a decent idea to allocate things of the proper size, I guess. It's a good opportunity to call skb_cow_data, which you need to do anyway when modifying skbs, I think. Jason