1. 22 Oct, 2012 11 commits
    • Nitin Gupta's avatar
      staging: zram: Fix handling of incompressible pages · c8f2f0db
      Nitin Gupta authored
      Change 130f315a (staging: zram: remove special handle of uncompressed page)
      introduced a bug in the handling of incompressible pages which resulted in
      memory allocation failure for such pages.
      
      When a page expands on compression, say from 4K to 4K+30, we were trying to
      do zsmalloc(pool, 4K+30). However, the maximum size which zsmalloc can
      allocate is PAGE_SIZE (for obvious reasons), so such allocation requests
      always return failure (0).
      
      For a page that has compressed size larger than the original size (this may
      happen with already compressed or random data), there is no point storing
      the compressed version as that would take more space and would also require
      time for decompression when needed again. So, the fix is to store any page,
      whose compressed size exceeds a threshold (max_zpage_size), as-it-is i.e.
      without compression.  Memory required for storing this uncompressed page can
      then be requested from zsmalloc which supports PAGE_SIZE sized allocations.
      
      Lastly, the fix checks that we do not attempt to "decompress" the page which
      we stored in the uncompressed form -- we just memcpy() out such pages.
      Signed-off-by: default avatarNitin Gupta <ngupta@vflare.org>
      Reported-by: viechweg@gmail.com
      Reported-by: paerley@gmail.com
      Reported-by: wu.tommy@gmail.com
      Acked-by: default avatarMinchan Kim <minchan@kernel.org>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c8f2f0db
    • Arve Hjønnevåg's avatar
      Staging: android: binder: Allow using highmem for binder buffers · 585650dc
      Arve Hjønnevåg authored
      The default kernel mapping for the pages allocated for the binder
      buffers is never used. Set the __GFP_HIGHMEM flag when allocating
      these pages so we don't needlessly use low memory pages that may
      be required elsewhere.
      Signed-off-by: default avatarArve Hjønnevåg <arve@android.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      585650dc
    • Arve Hjønnevåg's avatar
      Staging: android: binder: Fix memory leak on thread/process exit · 675d66b0
      Arve Hjønnevåg authored
      If a thread or process exited while a reply, one-way transaction or
      death notification was pending, the struct holding the pending work
      was leaked.
      Signed-off-by: default avatarArve Hjønnevåg <arve@android.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      675d66b0
    • Ian Abbott's avatar
      staging: comedi: ni_labpc: fix possible NULL deref during detach · 922b67c1
      Ian Abbott authored
      `labpc_common_detach()` is called by the comedi core to clean up if
      either `labpc_attach()` (including the one in the "ni_labpc_cs" module)
      or `labpc_attach_pci()` returns an error.  It assumes the `thisboard`
      macro (expanding to `((struct labpc_board_struct *)dev->board_ptr)`) is
      non-null.  This is a valid assumption if `labpc_attach()` fails, but not
      if `labpc_attach_pci()` fails, leading to a possible NULL pointer
      dereference.
      
      Check `thisboard` at the top of `labpc_common_detach()` and return early
      if it is `NULL`.  This is okay because the only other thing that could
      have been allocated is `dev->private` and that is freed by the comedi
      core, not by this function.
      
      Cc: <stable@vger.kernel.org> # 3.6.x
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      922b67c1
    • Ian Abbott's avatar
      staging: comedi: das08: fix possible NULL deref during detach · ee280d13
      Ian Abbott authored
      `das08_detach()` is called by the comedi core to clean up if either
      `das08_attach()` or `das08_attach_pci()` returns an error.  It sets
      `thisboard` to the return value of `comedi_board(dev)` and assumes it is
      non-null.  This is a valid assumption if `das08_attach()` fails, but not
      if `das08_attach_pci()` fails, leading to a possible NULL pointer
      dereference.
      
      Check `thisboard` at the top of `das08_detach()` and return early if it
      is `NULL`.  This is okay because the only other thing that could have
      been allocated is `dev->private` and that is freed by the comedi core,
      not by this function.
      
      Cc: <stable@vger.kernel.org> # 3.6.x
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ee280d13
    • Ian Abbott's avatar
      staging: comedi: amplc_pc263: fix possible NULL deref during detach · 1d1171ff
      Ian Abbott authored
      `pc263_detach()` is called by the comedi core to clean up if either
      `pc263_attach()` or `pc263_attach_pci()` returns an error.  It sets
      `thisboard` to the return value of `comedi_board(dev)` and assumes it is
      non-null.  This is a valid assumption if `pc263_attach()` fails, but not
      if `pc263_attach_pci()` fails, leading to a possible NULL pointer
      dereference.
      
      Check `thisboard` at the top of `pc263_detach()` and return early if it
      is `NULL`.  This is okay because no other resources need cleaning up in
      this case.
      
      Cc: <stable@vger.kernel.org> # 3.6.x
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1d1171ff
    • Ian Abbott's avatar
      staging: comedi: amplc_pc236: fix possible NULL deref during detach · 2db012bd
      Ian Abbott authored
      `pc236_detach()` is called by the comedi core to clean up if either
      `pc236_attach()` or `pc236_attach_pci()` returns an error.  It sets
      `thisboard` to the return value of `comedi_board(dev)` and assumes it is
      non-null.  This is a valid assumption if `pc236_attach()` fails, but not
      if `pc236_attach_pci()` fails, leading to a possible NULL pointer
      dereference.
      
      Check `thisboard` at the top of `pc236_detach()` and return early if it
      is `NULL`.  This is okay because the only other thing that could have
      been allocated is `dev->private` and that is freed by the comedi core,
      not by this function.
      
      Cc: <stable@vger.kernel.org> # 3.6.x
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2db012bd
    • Ian Abbott's avatar
      staging: comedi: amplc_pc236: fix invalid register access during detach · aaeb61a9
      Ian Abbott authored
      `pc236_detach()` is called by the comedi core if it attempted to attach
      a device and failed.  `pc236_detach()` calls `pc236_intr_disable()` if
      the comedi device private data pointer (`devpriv`) is non-null.  This
      test is insufficient as `pc236_intr_disable()` accesses hardware
      registers and the attach routine may have failed before it has saved
      their I/O base addresses.
      
      Fix it by checking `dev->iobase` is non-zero before calling
      `pc236_intr_disable()` as that means the I/O base addresses have been
      saved and the hardware registers can be accessed.  It also implies the
      comedi device private data pointer is valid, so there is no need to
      check it.
      
      Cc: <stable@vger.kernel.org> # 3.5.x, 3.6.x
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aaeb61a9
    • Ian Abbott's avatar
      staging: comedi: amplc_dio200: fix possible NULL deref during detach · dfb2540e
      Ian Abbott authored
      `dio200_detach()` is called by the comedi core to clean up if either
      `dio200_attach()` or `dio200_attach_pci()` return an error.  It assigns
      `thisboard` to the return value of `comedi_board(dev)` and assumes it is
      non-null.  In the case of a previous call to `dio200_attach()` it won't
      be `NULL` because the comedi core will have pointed it to one of the
      elements of `dio200_boards[]`, but in the case of a previous call to
      `dio200_attach_pci()` it could be `NULL`, leading to a null pointer
      dereference.
      
      Check that `thisboard` is valid at the top of `dio200_detach()` and
      return early if it is `NULL`.  This is okay because the only other thing
      that could have been allocated is `dev->private` and that is freed by
      the comedi core, not by this function.
      
      Cc: <stable@vger.kernel.org> # 3.6.x
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dfb2540e
    • Ian Abbott's avatar
      staging: comedi: 8255_pci: fix possible NULL deref during detach · f4dd2367
      Ian Abbott authored
      `pci_8255_detach()` will be called by the comedi core if
      `pci_8255_attach_pci()` returns an error.  It currently assumes that
      both `board` (assigned from the return value of `comedi_board(dev)`) and
      `devpriv` (assigned from `dev->private`) are non-null, but they might
      be null, leading to a null pointer dereference.
      
      `pci_8255_detach()` doesn't need to do anything if either `board` or
      `devpriv` are null, so just return early in this case.
      
      Cc: <stable@vger.kernel.org> # 3.6.x
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4dd2367
    • Fred Brooks's avatar
      staging: comedi: ni_daq_700: fix dio subdevice regression · 6681e633
      Fred Brooks authored
      Here is a small patch to fix a problem caused by a previous patch that
      removed the  callback function.  The callback remove patch:
      http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=1de02225358988e8fd48d1dc3fd12336bbae258a
      
      I finally booted my dev machine on the latest kernel (running Debian
      here so it's still on 3.2 normally) to test the ni_daq_700 driver with
      my test program and noticed this bug.
      
      Shift the DIO_R read result to bits 8..15 Digital direction
      configuration: channels 0-7 output, 8-15 input (8225 device emu as port
      A output, port B input, port C N/A).
      
      Cc: <stable@vger.kernel.org> # 3.6.x
      Signed-off-by: default avatarFred Brooks <nsaspook@nsaspook.com>
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6681e633
  2. 20 Oct, 2012 1 commit
  3. 19 Oct, 2012 12 commits
  4. 14 Oct, 2012 6 commits
    • Linus Torvalds's avatar
      Linux 3.7-rc1 · ddffeb8c
      Linus Torvalds authored
      ddffeb8c
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · a5ef3f7d
      Linus Torvalds authored
      Pull MIPS update from Ralf Baechle:
       "Cleanups and fixes for breakage that occured earlier during this merge
        phase.  Also a few patches that didn't make the first pull request.
        Of those is the Alchemy work that merges code for many of the SOCs and
        evaluation boards thus among other code shrinkage, reduces the number
        of MIPS defconfigs by 5."
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (22 commits)
        MIPS: SNI: Switch RM400 serial to SCCNXP driver
        MIPS: Remove unused empty_bad_pmd_table[] declaration.
        MIPS: MT: Remove kspd.
        MIPS: Malta: Fix section mismatch.
        MIPS: asm-offset.c: Delete unused irq_cpustat_t struct offsets.
        MIPS: Alchemy: Merge PB1100/1500 support into DB1000 code.
        MIPS: Alchemy: merge PB1550 support into DB1550 code
        MIPS: Alchemy: Single kernel for DB1200/1300/1550
        MIPS: Optimize TLB refill for RI/XI configurations.
        MIPS: proc: Cleanup printing of ASEs.
        MIPS: Hardwire detection of DSP ASE Rev 2 for systems, as required.
        MIPS: Add detection of DSP ASE Revision 2.
        MIPS: Optimize pgd_init and pmd_init
        MIPS: perf: Add perf functionality for BMIPS5000
        MIPS: perf: Split the Kconfig option CONFIG_MIPS_MT_SMP
        MIPS: perf: Remove unnecessary #ifdef
        MIPS: perf: Add cpu feature bit for PCI (performance counter interrupt)
        MIPS: perf: Change the "mips_perf_event" table unsupported indicator.
        MIPS: Align swapper_pg_dir to 64K for better TLB Refill code.
        vmlinux.lds.h: Allow architectures to add sections to the front of .bss
        ...
      a5ef3f7d
    • Linus Torvalds's avatar
      Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux · d25282d1
      Linus Torvalds authored
      Pull module signing support from Rusty Russell:
       "module signing is the highlight, but it's an all-over David Howells frenzy..."
      
      Hmm "Magrathea: Glacier signing key". Somebody has been reading too much HHGTTG.
      
      * 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (37 commits)
        X.509: Fix indefinite length element skip error handling
        X.509: Convert some printk calls to pr_devel
        asymmetric keys: fix printk format warning
        MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking
        MODSIGN: Make mrproper should remove generated files.
        MODSIGN: Use utf8 strings in signer's name in autogenerated X.509 certs
        MODSIGN: Use the same digest for the autogen key sig as for the module sig
        MODSIGN: Sign modules during the build process
        MODSIGN: Provide a script for generating a key ID from an X.509 cert
        MODSIGN: Implement module signature checking
        MODSIGN: Provide module signing public keys to the kernel
        MODSIGN: Automatically generate module signing keys if missing
        MODSIGN: Provide Kconfig options
        MODSIGN: Provide gitignore and make clean rules for extra files
        MODSIGN: Add FIPS policy
        module: signature checking hook
        X.509: Add a crypto key parser for binary (DER) X.509 certificates
        MPILIB: Provide a function to read raw data into an MPI
        X.509: Add an ASN.1 decoder
        X.509: Add simple ASN.1 grammar compiler
        ...
      d25282d1
    • Matt Fleming's avatar
      x86, boot: Explicitly include autoconf.h for hostprogs · b6eea87f
      Matt Fleming authored
      The hostprogs need access to the CONFIG_* symbols found in
      include/generated/autoconf.h.  But commit abbf1590 ("UAPI: Partition
      the header include path sets and add uapi/ header directories") replaced
      $(LINUXINCLUDE) with $(USERINCLUDE) which doesn't contain the necessary
      include paths.
      
      This has the undesirable effect of breaking the EFI boot stub because
      the #ifdef CONFIG_EFI_STUB code in arch/x86/boot/tools/build.c is
      never compiled.
      
      It should also be noted that because $(USERINCLUDE) isn't exported by
      the top-level Makefile it's actually empty in arch/x86/boot/Makefile.
      
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Acked-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b6eea87f
    • Ingo Molnar's avatar
      perf: Fix UAPI fallout · 7d380c8f
      Ingo Molnar authored
      The UAPI commits forgot to test tooling builds such as tools/perf/,
      and this fixes the fallout.
      
      Manual conversion.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7d380c8f
    • Linus Torvalds's avatar
      Merge branch 'late-for-linus' of git://git.linaro.org/people/rmk/linux-arm · 3d6ee36d
      Linus Torvalds authored
      Pull ARM update from Russell King:
       "This is the final round of stuff for ARM, left until the end of the
        merge window to reduce the number of conflicts.  This set contains the
        ARM part of David Howells UAPI changes, and a fix to the ordering of
        'select' statements in ARM Kconfig files (see the appropriate commit
        for why this happened - thanks to Andrew Morton for pointing out the
        problem.)
      
        I've left this as long as I dare for this window to avoid conflicts,
        and I regenerated the config patch yesterday, posting it to our
        mailing list for review and testing.  I have several acks which
        include successful test reports for it.
      
        However, today I notice we've got new conflicts with previously unseen
        code...  though that conflict should be trivial (it's my changes vs a
        one liner.)"
      
      * 'late-for-linus' of git://git.linaro.org/people/rmk/linux-arm:
        ARM: config: make sure that platforms are ordered by option string
        ARM: config: sort select statements alphanumerically
        UAPI: (Scripted) Disintegrate arch/arm/include/asm
      
      Fix up fairly conflict in arch/arm/Kconfig (the select re-organization
      vs recent addition of GENERIC_KERNEL_EXECVE)
      3d6ee36d
  5. 13 Oct, 2012 10 commits