1. 16 8月, 2006 3 次提交
    • G
    • H
      [PATCH] PATCH: 1 line 2.6.18 bugfix: modpost-64bit-fix.patch · e0e92632
      Hans de Goede 提交于
      There is a small but annoying bug in scripts/mod/file2alias.c which causes
      it to generate invalid aliases for input devices on 64 bit archs. This causes
      joydev.ko to not be automaticly loaded when inserting a joystick, resulting in
      a non working joystick (for the average user).
      
      In scripts/mod/file2alias.c is the following code for generating the input
      aliases:
      static void do_input(char *alias,
                           kernel_ulong_t *arr, unsigned int min, unsigned int max)
      {
              unsigned int i;
      
              for (i = min; i < max; i++)
                      if (arr[i / BITS_PER_LONG] & (1 << (i%BITS_PER_LONG)))
                              sprintf(alias + strlen(alias), "%X,*", i);
      }
      
      On 32 bits systems, this correctly generates "0,*" for the first alias, "8,*"
      for the second etc.
      
      However on 64 bits it generates: "0,*20,*" resp "8,*28,*" Notice how it adds 20
      + first entry (hex) ! to the list of hex codes, which is 32 more then the first
      entry, thus is because the bit test above wraps at 32 bits instead of 64.
      
      scripts/mod/file2alias.c, line 379 reads:
                      if (arr[i / BITS_PER_LONG] & (1 << (i%BITS_PER_LONG)))
      That should be:
                      if (arr[i / BITS_PER_LONG] & (1L << (i%BITS_PER_LONG)))
      
      Notice the added 'L' after the 1, otherwise that is an 32 bit int instead of a
      64 bit long, and when that int gets shifted >= 32 times, appearantly the number
      by which to shift is wrapped at 5 bits ( % 32) causing it to test a bit 32 bits
      too low.
      
      The patch below makes the nescesarry 1 char change :)
      Signed-off-by: NHans de Goede <j.w.r.degoede@hhs.nl>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e0e92632
    • G
  2. 15 8月, 2006 14 次提交
  3. 14 8月, 2006 8 次提交
  4. 12 8月, 2006 11 次提交
  5. 11 8月, 2006 2 次提交
  6. 10 8月, 2006 2 次提交
    • G
      99baa752
    • N
      [XFS] Fix xfs_free_extent related NULL pointer dereference. · 0e1edbd9
      Nathan Scott 提交于
      We recently fixed an out-of-space deadlock in XFS, and part of that fix
      involved the addition of the XFS_ALLOC_FLAG_FREEING flag to some of the
      space allocator calls to indicate they're freeing space, not allocating
      it. There was a missed xfs_alloc_fix_freelist condition test that did not
      correctly test "flags". The same test would also test an uninitialised
      structure field (args->userdata) and depending on its value either would
      or would not return early with a critical buffer pointer set to NULL.
      
      This fixes that up, adds asserts to several places to catch future botches
      of this nature, and skips sections of xfs_alloc_fix_freelist that are
      irrelevent for the space-freeing case.
      
      SGI-PV: 955303
      SGI-Modid: xfs-linux-melb:xfs-kern:26743a
      Signed-off-by: NNathan Scott <nathans@sgi.com>
      0e1edbd9