linux/drivers/net
Christoph Schulz 3916a31927 net: ppp: don't call sk_chk_filter twice
Commit 568f194e8b ("net: ppp: use
sk_unattached_filter api") causes sk_chk_filter() to be called twice when
setting a PPP pass or active filter. This applies to both the generic PPP
subsystem implemented by drivers/net/ppp/ppp_generic.c and the ISDN PPP
subsystem implemented by drivers/isdn/i4l/isdn_ppp.c. The first call is from
within get_filter(). The second one is through the call chain

  ppp_ioctl() or isdn_ppp_ioctl()
  --> sk_unattached_filter_create()
      --> __sk_prepare_filter()
          --> sk_chk_filter()

The first call from within get_filter() should be deleted as get_filter() is
called just before calling sk_unattached_filter_create() later on, which
eventually calls sk_chk_filter() anyway.

For 3.15.x, this proposed change is a bugfix rather than a pure optimization as
in that branch, sk_chk_filter() may replace filter codes by other codes which
are not recognized when executing sk_chk_filter() a second time. So with
3.15.x, if sk_chk_filter() is called twice, the second invocation may yield
EINVAL (this depends on the filter codes found in the filter to be set, but
because the replacement is done for frequently used codes, this is almost
always the case). The net effect is that setting pass and/or active PPP filters
does not work anymore, since sk_unattached_filter_create() always returns
EINVAL due to the second call to sk_chk_filter(), regardless whether the filter
was originally sane or not.

Signed-off-by: Christoph Schulz <develop@kristov.de>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-14 16:15:12 -07:00
..
appletalk
arcnet
bonding bonding: fix ad_select module param check 2014-07-14 14:36:58 -07:00
caif
can slcan: Port write_wakeup deadlock fix from slip 2014-06-16 21:29:13 -07:00
cris
dsa net: dsa: update DSA drivers to use ds_to_priv 2014-04-30 13:31:25 -04:00
ethernet mlx4: mark napi id for gro_skb 2014-07-14 16:14:16 -07:00
fddi defxx: Fix !DYNAMIC_BUFFERS compilation warnings 2014-07-02 18:26:29 -07:00
hamradio yam: replace del_timer by del_timer_sync 2014-03-27 15:28:06 -04:00
hippi
hyperv hyperv: fix apparent cut-n-paste error in send path teardown 2014-06-16 21:36:13 -07:00
ieee802154 at86rf230: fix irq setup 2014-06-22 18:04:03 -07:00
irda Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-06-12 14:27:40 -07:00
phy dp83640: Always decode received status frames 2014-07-09 17:00:34 -07:00
plip
ppp net: ppp: don't call sk_chk_filter twice 2014-07-14 16:15:12 -07:00
slip slip: Fix deadlock in write_wakeup 2014-06-16 21:29:12 -07:00
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-06-03 23:32:12 -07:00
usb r8152: fix r8152_csum_workaround function 2014-07-11 14:51:21 -07:00
vmxnet3 vmxnet3: adjust ring sizes when interface is down 2014-06-16 21:26:40 -07:00
wan farsync: fix invalid memory accesses in fst_add_one() and fst_init_card() 2014-07-11 13:34:48 -07:00
wimax net: wimax: i2400m: control.c: Cleaning up conjunction always evaluates to false 2014-06-11 00:13:16 -07:00
wireless rt2800usb: Don't perform DMA from stack 2014-07-07 15:04:34 -04:00
xen-netback xen-netback: bookkeep number of active queues in our own module 2014-06-25 15:59:47 -07:00
dummy.c
eql.c
ifb.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-03-29 18:48:54 -04:00
Kconfig
LICENSE.SRC
loopback.c
macvlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-06-11 16:02:55 -07:00
macvtap.c mactap: Fix checksum errors for non-gso packets in bridge mode 2014-04-30 16:12:22 -04:00
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c net: nlmon: flag nlmon devs with LLTX/SG 2014-03-28 16:49:47 -04:00
ntb_netdev.c net: use ethtool_cmd_speed_set helper to set ethtool speed value 2014-06-06 16:24:07 -07:00
rionet.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
sb1000.c
Space.c
sungem_phy.c
tun.c net-tun: restructure tun_do_read for better sleep/wakeup efficiency 2014-05-21 15:50:28 -04:00
veth.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-03-29 18:48:54 -04:00
virtio_net.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
vxlan.c vxlan: Checksum fixes 2014-06-15 01:00:50 -07:00
xen-netfront.c xen-netfront: call netif_carrier_off() only once when disconnecting 2014-07-08 11:21:03 -07:00