1. 24 2月, 2009 1 次提交
    • J
      netfilter: xt_recent: fix proc-file addition/removal of IPv4 addresses · 325fb5b4
      Josef Drexler 提交于
      Fix regression introduded by commit 079aa88f (netfilter: xt_recent: IPv6 support):
      
      From http://bugzilla.kernel.org/show_bug.cgi?id=12753:
      
      Problem Description:
      An uninitialized buffer causes IPv4 addresses added manually (via the +IP
      command to the proc interface) to never match any packets. Similarly, the -IP
      command fails to remove IPv4 addresses.
      
      Details:
      In the function recent_entry_lookup, the xt_recent module does comparisons of
      the entire nf_inet_addr union value, both for IPv4 and IPv6 addresses. For
      addresses initialized from actual packets the remaining 12 bytes not occupied
      by the IPv4 are zeroed so this works correctly. However when setting the
      nf_inet_addr addr variable in the recent_mt_proc_write function, only the IPv4
      bytes are initialized and the remaining 12 bytes contain garbage.
      
      Hence addresses added in this way never match any packets, unless these
      uninitialized 12 bytes happened to be zero by coincidence. Similarly, addresses
      cannot consistently be removed using the proc interface due to mismatch of the
      garbage bytes (although it will sometimes work to remove an address that was
      added manually).
      
      Reading the /proc/net/xt_recent/ entries hides this problem because this only
      uses the first 4 bytes when displaying IPv4 addresses.
      
      Steps to reproduce:
      $ iptables -I INPUT -m recent --rcheck -j LOG
      $ echo +169.254.156.239 > /proc/net/xt_recent/DEFAULT
      $ cat /proc/net/xt_recent/DEFAULT
      src=169.254.156.239 ttl: 0 last_seen: 119910 oldest_pkt: 1 119910
      
      [At this point no packets from 169.254.156.239 are being logged.]
      
      $ iptables -I INPUT -s 169.254.156.239 -m recent --set
      $ cat /proc/net/xt_recent/DEFAULT
      src=169.254.156.239 ttl: 0 last_seen: 119910 oldest_pkt: 1 119910
      src=169.254.156.239 ttl: 255 last_seen: 126184 oldest_pkt: 4 125434, 125684, 125934, 126184
      
      [At this point, adding the address via an iptables rule, packets are being
      logged correctly.]
      
      $ echo -169.254.156.239 > /proc/net/xt_recent/DEFAULT
      $ cat /proc/net/xt_recent/DEFAULT
      src=169.254.156.239 ttl: 0 last_seen: 119910 oldest_pkt: 1 119910
      src=169.254.156.239 ttl: 255 last_seen: 126992 oldest_pkt: 10 125434, 125684, 125934, 126184, 126434, 126684, 126934, 126991, 126991, 126992
      $ echo -169.254.156.239 > /proc/net/xt_recent/DEFAULT
      $ cat /proc/net/xt_recent/DEFAULT
      src=169.254.156.239 ttl: 0 last_seen: 119910 oldest_pkt: 1 119910
      src=169.254.156.239 ttl: 255 last_seen: 126992 oldest_pkt: 10 125434, 125684, 125934, 126184, 126434, 126684, 126934, 126991, 126991, 126992
      
      [Removing the address via /proc interface failed evidently.]
      
      Possible solutions:
      - initialize the addr variable in recent_mt_proc_write
      - compare only 4 bytes for IPv4 addresses in recent_entry_lookup
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      325fb5b4
  2. 18 2月, 2009 35 次提交
  3. 17 2月, 2009 4 次提交
    • H
      V4L/DVB (10626): ivtv: fix regression in get sliced vbi format · 7bf432d6
      Hans Verkuil 提交于
      The new v4l2_subdev_call used s_fmt instead of g_fmt.
      
      Thanks-to: Andy Walls <awalls@radix.net>
      Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      7bf432d6
    • H
      V4L/DVB (10625): ivtv: fix decoder crash regression · ac9575f7
      Hans Verkuil 提交于
      The video_ioctl2 conversion of ivtv in kernel 2.6.27 introduced a bug
      causing decoder commands to crash. The decoder commands should have been
      handled from the video_ioctl2 default handler, ensuring correct mapping
      of the argument between user and kernel space. Unfortunately they ended
      up before the video_ioctl2 call, causing random crashes.
      
      Thanks to hannes@linus.priv.at for testing and helping me track down the
      cause!
      Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      ac9575f7
    • A
      V4L/DVB (10619): gspca - main: Destroy the URBs at disconnection time. · ad28127d
      Adam Baker 提交于
      If a device using the gspca framework is unplugged while it is still streaming
      then the call that is used to free the URBs that have been allocated occurs
      after the pointer it uses becomes invalid at the end of gspca_disconnect.
      Make another cleanup call in gspca_disconnect while the pointer is still
      valid (multiple calls are OK as destroy_urbs checks for pointers already
      being NULL.
      Signed-off-by: NAdam Baker <linux@baker-net.org.uk>
      Signed-off-by: NJean-Francois Moine <moinejf@free.fr>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      ad28127d
    • M
      V4L/DVB (10572): Revert commit dda06a8e · 28100165
      Mauro Carvalho Chehab 提交于
      On Mon, 02 Feb 2009, Hartmut wrote:
      
      This change set is wrong. The affected functions cannot be called from
      an interrupt context, because they may process large buffers. In this
      case, interrupts are disabled for a long time. Functions, like
      dvb_dmx_swfilter_packets(), could be called only from a tasklet.
      
      This change set does hide some strong design bugs in dm1105.c and
      au0828-dvb.c.
      
      Please revert this change set and do fix the bugs in dm1105.c and
      au0828-dvb.c (and other files).
      
      On Sun, 15 Feb 2009, Oliver Endriss wrote:
      
      This changeset _must_ be reverted! It breaks all kernels since 2.6.27
      for applications which use DVB and require a low interrupt latency.
      
      It is a very bad idea to call the demuxer to process data buffers with
      interrupts disabled!
      
      On Mon, 16 Feb 2009, Trent Piepho wrote:
      
      I agree, this is bad.  The demuxer is far too much work to be done with
      IRQs off.  IMHO, even doing it under a spin-lock is excessive.  It should
      be a mutex.  Drivers should use a work-queue to feed the demuxer.
      
      Thank you for testing this changeset and discovering the issues on it.
      
      Cc: Trent Piepho <xyzzy@speakeasy.org>
      Cc: Hartmut <e9hack@googlemail.com>
      Cc: Oliver Endriss <o.endriss@gmx.de>
      Cc: Andreas Oberritter <obi@linuxtv.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      28100165