From patchwork Sat Apr 18 09:53:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 462262 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EE06E140301 for ; Sat, 18 Apr 2015 19:59:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751930AbbDRJxV (ORCPT ); Sat, 18 Apr 2015 05:53:21 -0400 Received: from smtp.transmode.se ([31.15.61.139]:62818 "EHLO smtp.transmode.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751328AbbDRJxT (ORCPT ); Sat, 18 Apr 2015 05:53:19 -0400 Received: from gentoo-jocke.transmode.se (gentoo-jocke.transmode.se [172.20.4.10]) by smtp.transmode.se (Postfix) with ESMTP id 09AA41186FE9; Sat, 18 Apr 2015 11:53:17 +0200 (CEST) Received: from gentoo-jocke.transmode.se (localhost [127.0.0.1]) by gentoo-jocke.transmode.se (8.14.9/8.14.9) with ESMTP id t3I9rGOj017210; Sat, 18 Apr 2015 11:53:16 +0200 Received: (from jocke@localhost) by gentoo-jocke.transmode.se (8.14.9/8.14.9/Submit) id t3I9rFa4017209; Sat, 18 Apr 2015 11:53:15 +0200 From: Joakim Tjernlund To: netdev@vger.kernel.org Cc: Joakim Tjernlund Subject: [PATCH v2] pppoe: Lacks DST MAC address check Date: Sat, 18 Apr 2015 11:53:14 +0200 Message-Id: <1429350794-17170-1-git-send-email-Joakim.Tjernlund@transmode.se> X-Mailer: git-send-email 2.0.5 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org A pppoe session is identified by its session ID and MAC address. Currently pppoe does not check if the received pkg has the correct MAC address. This is a problem when the eth I/F is in promisc mode as then any DST MAC address is accepted. --- v2 - The MAC address check should encompass all pppoe pkgs, not only the relay type. drivers/net/ppp/pppoe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c index ff059e1..aa1dd92 100644 --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c @@ -380,6 +380,9 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb) * can't change. */ + if (skb->pkt_type == PACKET_OTHERHOST) + goto abort_kfree; + if (sk->sk_state & PPPOX_BOUND) { ppp_input(&po->chan, skb); } else if (sk->sk_state & PPPOX_RELAY) {