1. 01 4月, 2009 12 次提交
  2. 31 3月, 2009 1 次提交
    • A
      proc 2/2: remove struct proc_dir_entry::owner · 99b76233
      Alexey Dobriyan 提交于
      Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
      as correctly noted at bug #12454. Someone can lookup entry with NULL
      ->owner, thus not pinning enything, and release it later resulting
      in module refcount underflow.
      
      We can keep ->owner and supply it at registration time like ->proc_fops
      and ->data.
      
      But this leaves ->owner as easy-manipulative field (just one C assignment)
      and somebody will forget to unpin previous/pin current module when
      switching ->owner. ->proc_fops is declared as "const" which should give
      some thoughts.
      
      ->read_proc/->write_proc were just fixed to not require ->owner for
      protection.
      
      rmmod'ed directories will be empty and return "." and ".." -- no harm.
      And directories with tricky enough readdir and lookup shouldn't be modular.
      We definitely don't want such modular code.
      
      Removing ->owner will also make PDE smaller.
      
      So, let's nuke it.
      
      Kudos to Jeff Layton for reminding about this, let's say, oversight.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=12454Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      99b76233
  3. 28 3月, 2009 2 次提交
  4. 26 3月, 2009 2 次提交
  5. 25 3月, 2009 2 次提交
  6. 21 3月, 2009 1 次提交
  7. 16 3月, 2009 2 次提交
    • J
      Rationalize fasync return values · 60aa4924
      Jonathan Corbet 提交于
      Most fasync implementations do something like:
      
           return fasync_helper(...);
      
      But fasync_helper() will return a positive value at times - a feature used
      in at least one place.  Thus, a number of other drivers do:
      
           err = fasync_helper(...);
           if (err < 0)
                   return err;
           return 0;
      
      In the interests of consistency and more concise code, it makes sense to
      map positive return values onto zero where ->fasync() is called.
      
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      60aa4924
    • J
      Use f_lock to protect f_flags · db1dd4d3
      Jonathan Corbet 提交于
      Traditionally, changes to struct file->f_flags have been done under BKL
      protection, or with no protection at all.  This patch causes all f_flags
      changes after file open/creation time to be done under protection of
      f_lock.  This allows the removal of some BKL usage and fixes a number of
      longstanding (if microscopic) races.
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      db1dd4d3
  8. 13 3月, 2009 1 次提交
  9. 11 3月, 2009 3 次提交
  10. 23 2月, 2009 1 次提交
  11. 22 2月, 2009 1 次提交
    • A
      hwrng: timeriomem - New driver · 9c3c133b
      Alexander Clouter 提交于
      Some hardware platforms, the TS-7800[1] is one for example, can
      supply the kernel with an entropy source, albeit a slow one for
      TS-7800 users, by just reading a particular IO address.  This
      source must not be read above a certain rate otherwise the quality
      suffers.
      
      The driver is then hooked into by calling
      platform_device_(register|add|del) passing a structure similar to:
      ------
      static struct timeriomem_rng_data ts78xx_ts_rng_data = {
              .address        = (u32 *__iomem) TS_RNG,
              .period         = 1000000, /* one second */
      };
      
      static struct platform_device ts78xx_ts_rng_device = {
              .name           = "timeriomem_rng",
              .id             = -1,
              .dev            = {
                      .platform_data  = &ts78xx_ts_rng_data,
              },
              .num_resources  = 0,
      };
      ------
      
      [1] http://www.embeddedarm.com/products/board-detail.php?product=TS-7800Signed-off-by: NAlexander Clouter <alex@digriz.org.uk>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      9c3c133b
  12. 21 2月, 2009 2 次提交
  13. 12 2月, 2009 1 次提交
  14. 09 2月, 2009 1 次提交
  15. 06 2月, 2009 2 次提交
  16. 03 2月, 2009 2 次提交
  17. 01 2月, 2009 1 次提交
    • M
      Fix memory corruption in console selection · 878b8619
      Mikulas Patocka 提交于
      Fix an off-by-two memory error in console selection.
      
      The loop below goes from sel_start to sel_end (inclusive), so it writes
      one more character.  This one more character was added to the allocated
      size (+1), but it was not multiplied by an UTF-8 multiplier.
      
      This patch fixes a memory corruption when UTF-8 console is used and the
      user selects a few characters, all of them 3-byte in UTF-8 (for example
      a frame line).
      
      When memory redzones are enabled, a redzone corruption is reported.
      When they are not enabled, trashing of random memory occurs.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      878b8619
  18. 31 1月, 2009 1 次提交
  19. 27 1月, 2009 1 次提交
  20. 24 1月, 2009 1 次提交