1. 18 1月, 2013 10 次提交
  2. 17 1月, 2013 3 次提交
    • V
      sk-filter: Add ability to lock a socket filter program · d59577b6
      Vincent Bernat 提交于
      While a privileged program can open a raw socket, attach some
      restrictive filter and drop its privileges (or send the socket to an
      unprivileged program through some Unix socket), the filter can still
      be removed or modified by the unprivileged program. This commit adds a
      socket option to lock the filter (SO_LOCK_FILTER) preventing any
      modification of a socket filter program.
      
      This is similar to OpenBSD BIOCLOCK ioctl on bpf sockets, except even
      root is not allowed change/drop the filter.
      
      The state of the lock can be read with getsockopt(). No error is
      triggered if the state is not changed. -EPERM is returned when a user
      tries to remove the lock or to change/remove the filter while the lock
      is active. The check is done directly in sk_attach_filter() and
      sk_detach_filter() and does not affect only setsockopt() syscall.
      Signed-off-by: NVincent Bernat <bernat@luffy.cx>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d59577b6
    • C
      netpoll: fix a missing dev refcounting · 5bd30d39
      Cong Wang 提交于
      __dev_get_by_name() doesn't refcount the network device,
      so we have to do this by ourselves. Noticed by Eric.
      
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NCong Wang <amwang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5bd30d39
    • C
      netpoll: fix a rtnl lock assertion failure · f92d3180
      Cong Wang 提交于
      v4: hold rtnl lock for the whole netpoll_setup()
      v3: remove the comment
      v2: use RCU read lock
      
      This patch fixes the following warning:
      
      [   72.013864] RTNL: assertion failed at net/core/dev.c (4955)
      [   72.017758] Pid: 668, comm: netpoll-prep-v6 Not tainted 3.8.0-rc1+ #474
      [   72.019582] Call Trace:
      [   72.020295]  [<ffffffff8176653d>] netdev_master_upper_dev_get+0x35/0x58
      [   72.022545]  [<ffffffff81784edd>] netpoll_setup+0x61/0x340
      [   72.024846]  [<ffffffff815d837e>] store_enabled+0x82/0xc3
      [   72.027466]  [<ffffffff815d7e51>] netconsole_target_attr_store+0x35/0x37
      [   72.029348]  [<ffffffff811c3479>] configfs_write_file+0xe2/0x10c
      [   72.030959]  [<ffffffff8115d239>] vfs_write+0xaf/0xf6
      [   72.032359]  [<ffffffff81978a05>] ? sysret_check+0x22/0x5d
      [   72.033824]  [<ffffffff8115d453>] sys_write+0x5c/0x84
      [   72.035328]  [<ffffffff819789d9>] system_call_fastpath+0x16/0x1b
      
      In case of other races, hold rtnl lock for the entire netpoll_setup() function.
      
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NCong Wang <amwang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f92d3180
  3. 16 1月, 2013 1 次提交
  4. 15 1月, 2013 4 次提交
  5. 14 1月, 2013 7 次提交
  6. 13 1月, 2013 1 次提交
    • J
      netfilter: x_tables: print correct hook names for ARP · 5b76c494
      Jan Engelhardt 提交于
      arptables 0.0.4 (released on 10th Jan 2013) supports calling the
      CLASSIFY target, but on adding a rule to the wrong chain, the
      diagnostic is as follows:
      
      	# arptables -A INPUT -j CLASSIFY --set-class 0:0
      	arptables: Invalid argument
      	# dmesg | tail -n1
      	x_tables: arp_tables: CLASSIFY target: used from hooks
      	PREROUTING, but only usable from INPUT/FORWARD
      
      This is incorrect, since xt_CLASSIFY.c does specify
      (1 << NF_ARP_OUT) | (1 << NF_ARP_FORWARD).
      
      This patch corrects the x_tables diagnostic message to print the
      proper hook names for the NFPROTO_ARP case.
      
      Affects all kernels down to and including v2.6.31.
      Signed-off-by: NJan Engelhardt <jengelh@inai.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      5b76c494
  7. 12 1月, 2013 14 次提交