Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752057Ab0LAJjX (ORCPT ); Wed, 1 Dec 2010 04:39:23 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:41108 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992Ab0LAJjV convert rfc822-to-8bit (ORCPT ); Wed, 1 Dec 2010 04:39:21 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=AkmxbSIQzcIghTl2ImbWiFJEKbSP52U3yy1Ysl9NmzkNpoQK6TxUvDvB4hBubqVJ6j vlJ1W8eGDXxpyrDiUNpbUGcf113/W53K0JS9ZbYeE8OLk5MwXFU/7rVnPlKXY43J5CgT 6Xn7g9UhHpn93wgbnEFlajSzV201lHsqLbtmM= MIME-Version: 1.0 In-Reply-To: References: From: Changli Gao Date: Wed, 1 Dec 2010 17:38:59 +0800 Message-ID: Subject: Re: [PATCH v16 11/17]Add a hook to intercept external buffers from NIC driver. To: xiaohui.xin@intel.com Cc: netdev@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mst@redhat.com, mingo@elte.hu, davem@davemloft.net, herbert@gondor.hengli.com.au, jdike@linux.intel.com, Eric Dumazet Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1450 Lines: 36 On Wed, Dec 1, 2010 at 4:08 PM, wrote: > From: Xin Xiaohui > @@ -2891,6 +2925,11 @@ static int __netif_receive_skb(struct sk_buff *skb) > ?ncls: > ?#endif > > + ? ? ? /* To intercept mediate passthru(zero-copy) packets here */ > + ? ? ? skb = handle_mpassthru(skb, &pt_prev, &ret, orig_dev); > + ? ? ? if (!skb) > + ? ? ? ? ? ? ? goto out; > + > ? ? ? ?/* Handle special case of bridge or macvlan */ I think it won't work if the skbs is captured by the previous ptype. We need to trace the skb pages(skb_shared_info.frags[*].page), but currently, there isn't a easy way to do that. skb pages are treated as normal pages, and anyone can get it freely. And it is the problem in the way to fix the potential data corruption bug. Eric thinks af_packets(mmap) isn't worth fixing. But if this patch serial has the same problem. It will be worth. My idea is adding a new function dtor pointer and some other args pointers to the struct skb_shared_info. If skb_shared_info.dtor exists, the pages in skb_shared_info.frags are private to this skb->head. Anyone who wants to get these pages, should copy them instead. -- Regards, Changli Gao(xiaosuo@gmail.com) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/