12 May, 2011

2 commits

  • Description:
    This bug hardly appears during real kernel compiling,
    because the vmlinux symbols table is huge.

    But we can still catch it under strict condition , as follows.
    $ echo "c101b97b T do_fork" | ./scripts/kallsyms --all-symbols
    #include
    ......
    ......
    .globl kallsyms_token_table
    ALGN
    kallsyms_token_table:
    Segmentation fault (core dumped)
    $

    If symbols table is small, all entries in token_profit[0x10000] may
    decrease to 0 after several calls of compress_symbols() in optimize_result().
    In that case, find_best_token() always return 0 and
    best_table[i] is set to "\0\0" and best_table_len[i] is set to 2.

    As a result, expand_symbol(best_table[0]="\0\0", best_table_len[0]=2, buf)
    in write_src() will run in infinite recursion until stack overflows,
    causing segfault.

    This patch checks the find_best_token() return value. If all entries in
    token_profit[0x10000] become 0 according to return value, it breaks the loop
    in optimize_result().
    And expand_symbol() works well when best_table_len[i] is 0.

    Signed-off-by: Xiaochen Wang
    Acked-by: Paulo Marques
    Signed-off-by: Michal Marek

    Xiaochen Wang
     
  • Replace bashisms with POSIX-compatible shell scripting.

    Notably, de-duplicate '/' using a sed command from elsewhere in the same script
    rather than "${name//\/\///}".

    Commit by Jamey Sharp and Josh Triplett.

    Signed-off-by: Jamey Sharp
    Signed-off-by: Josh Triplett
    Cc: Andrew Morton
    Signed-off-by: Michal Marek

    Jamey Sharp
     

11 May, 2011

1 commit

  • According to Documentation/Changes, the kernel should be buildable with
    GNU make 3.80+. Commit 88d7be031f9f975bb3f50a0b5ef3796a671e7edf (kbuild:
    Use a single clean rule for kernel and external modules) introduced the
    "$(or" construct, which requires make 3.81. This causes "make clean" to
    malfunction when it is used with external modules.

    Replace "$(or" with an equivalent "$(if" expression, to restore backward
    compatibility.

    Signed-off-by: Kevin Cernekee
    Cc: stable@kernel.org
    Signed-off-by: Michal Marek

    Kevin Cernekee
     

03 May, 2011

3 commits


02 May, 2011

1 commit


29 Apr, 2011

3 commits

  • Disable the new -Wunused-but-set-variable that was added in gcc 4.6.0
    It produces more false positives than useful warnings.

    This can still be enabled using W=1

    Signed-off-by: Dave Jones
    Acked-by: Sam Ravnborg
    Tested-by: Sam Ravnborg
    Signed-off-by: Michal Marek

    Dave Jones
     
  • When using a domain login, `whoami` returns the login in
    user\domain format. This leads to either warnings on unrecognised
    escape sequences or escaped characters being generated for the user.
    This patch ensures that any backslash is escaped to a double-backslash
    to make sure the name is preserved correctly. This patch does not
    enforce escaping on the KBUILD_BUILD_USER variable, as this is something
    the user has control of and can escape if required.

    Signed-off-by: Marcin Nowakowski
    Signed-off-by: Michal Marek

    Marcin Nowakowski
     
  • There is an increasing amount of header files
    shared between individual architectures in asm-generic.
    To avoid a lot of dummy wrapper files that just
    include the corresponding file in asm-generic provide
    some basic support in kbuild for this.

    With the following patch an architecture can maintain
    a list of files in the file arch/$(ARCH)/include/asm/Kbuild

    To use a generic file just add:

    generic-y +=

    For each file listed kbuild will generate the necessary
    wrapper in arch/$(ARCH)/include/generated/asm.

    When installing userspace headers a wrapper is likewise created.

    The original inspiration for this came from the unicore32
    patchset - although a different method is used.

    The patch includes several improvements from Arnd Bergmann.
    Michael Marek contributed Makefile.asm-generic.

    Remis Baima did an intial implementation along to achive
    the same - see https://patchwork.kernel.org/patch/13352/

    Signed-off-by: Sam Ravnborg
    Acked-by: Guan Xuetao
    Tested-by: Guan Xuetao
    Acked-by: Arnd Bergmann
    Cc: Remis Lima Baima
    Signed-off-by: Michal Marek

    Sam Ravnborg
     

28 Apr, 2011

1 commit

  • Building a kernel with "make W=1" produces far too much noise to be
    useful.

    Divide the warning options in three groups:

    W=1 - warnings that may be relevant and does not occur too often
    W=2 - warnings that occur quite often but may still be relevant
    W=3 - the more obscure warnings, can most likely be ignored

    When building the whole kernel, those levels produce:

    W=1 - 4859 warnings
    W=2 - 1394 warnings
    W=3 - 86666 warnings

    respectively. Warnings have been counted with Geert's script at

    http://www.kernel.org/pub/linux/kernel/people/geert/linux-log/linux-log-summary.pl

    Many warnings occur from .h files so fixing one file may have a nice
    effect on the total number of warnings.

    With these changes I am actually tempted to try W=1 now and then.
    Previously there was just too much noise.

    Borislav:

    - make the W= levels exclusive
    - move very noisy and making little sense for the kernel warnings to W=3
    - drop -Woverlength-strings due to useless warning message
    - copy explanatory text for the different warning levels to 'make help'
    - recount warnings per level

    Signed-off-by: Sam Ravnborg
    Signed-off-by: Borislav Petkov
    Cc: Dave Jones
    Cc: Geert Uytterhoeven
    Signed-off-by: Michal Marek

    Sam Ravnborg
     

20 Apr, 2011

1 commit


18 Apr, 2011

5 commits


15 Apr, 2011

2 commits

  • At the moment we have the CONFIG_KALLSYMS_EXTRA_PASS Kconfig switch,
    which users can enable or disable while configuring the kernel. This
    option is then used by 'make' to determine whether an extra kallsyms
    pass is needed or not.

    However, this approach is not nice and confusing, and this patch moves
    CONFIG_KALLSYMS_EXTRA_PASS from Kconfig to Makefile instead. The
    rationale is below.

    1. CONFIG_KALLSYMS_EXTRA_PASS is really about the build time, not
    run-time. There is no real need for it to be in Kconfig. It is
    just an additional work-around which should be used only in rare
    cases, when someone breaks kallsyms, so Kbuild/Makefile is much
    better place for this option.
    2. Grepping CONFIG_KALLSYMS_EXTRA_PASS shows that many defconfigs have
    it enabled, probably not because they try to work-around a kallsyms
    bug, but just because the Kconfig help text is confusing and does
    not really make it clear that this option should not be used unless
    except when kallsyms is broken.
    3. And since many people have CONFIG_KALLSYMS_EXTRA_PASS enabled in
    their Kconfig, we do might fail to notice kallsyms bugs in time. E.g.,
    many testers use "make allyesconfig" to test builds, which will enable
    CONFIG_KALLSYMS_EXTRA_PASS and kallsyms breakage will not be noticed.

    To address that, this patch:

    1. Kills CONFIG_KALLSYMS_EXTRA_PASS
    2. Changes Makefile so that people can use "make KALLSYMS_EXTRA_PASS=1"
    to enable the extra pass if needed. Additionally, they may define
    KALLSYMS_EXTRA_PASS as an environment variable.
    3. By default KALLSYMS_EXTRA_PASS is disabled and if kallsyms has issues,
    "make" should print a warning and suggest using KALLSYMS_EXTRA_PASS

    Signed-off-by: Artem Bityutskiy
    [mmarek: Removed make help text, is not necessary]
    Signed-off-by: Michal Marek

    Artem Bityutskiy
     
  • Dumb users like myself are not able to grasp from the existing KALLSYMS_ALL
    documentation that this option is not what they need. Improve the help
    message and make it clearer that KALLSYMS is enough in the majority of
    use cases, and KALLSYMS_ALL should really be used very rarely.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: Michal Marek

    Artem Bityutskiy
     

30 Mar, 2011

9 commits

  • Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (26 commits)
    mmc: SDHI should depend on SUPERH || ARCH_SHMOBILE
    mmc: tmio_mmc: Move some defines into a shared header
    mmc: tmio: support aggressive clock gating
    mmc: tmio: fix power-mode interpretation
    mmc: tmio: remove work-around for unmasked SDIO interrupts
    sh: fix SDHI IO address-range
    ARM: mach-shmobile: fix SDHI IO address-range
    mmc: tmio: only access registers above 0xff, if available
    mfd: remove now redundant sh_mobile_sdhi.h header
    sh: convert boards to use linux/mmc/sh_mobile_sdhi.h
    ARM: mach-shmobile: convert boards to use linux/mmc/sh_mobile_sdhi.h
    mmc: tmio: convert the SDHI MMC driver from MFD to a platform driver
    sh: ecovec: use the CONFIG_MMC_TMIO symbols instead of MFD
    mmc: tmio: split core functionality, DMA and MFD glue
    mmc: tmio: use PIO for short transfers
    mmc: tmio-mmc: Improve DMA stability on sh-mobile
    mmc: fix mmc_app_send_scr() for dma transfer
    mmc: sdhci-esdhc: enable esdhc on imx53
    mmc: sdhci-esdhc: use writel/readl as general APIs
    mmc: sdhci: add the abort CMDTYPE bits definition
    ...

    Linus Torvalds
     
  • * 'frv' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-frv:
    FRV: Use generic show_interrupts()
    FRV: Convert genirq namespace
    frv: Select GENERIC_HARDIRQS_NO_DEPRECATED
    frv: Convert cpu irq_chip to new functions
    frv: Convert mb93493 irq_chip to new functions
    frv: Convert mb93093 irq_chip to new function
    frv: Convert mb93091 irq_chip to new functions
    frv: Fix typo from __do_IRQ overhaul
    frv: Remove stale irq_chip.end
    FRV: Do some cleanups
    FRV: Missing node arg in alloc_thread_info_node() macro
    NOMMU: implement access_remote_vm
    NOMMU: support SMP dynamic percpu_alloc
    NOMMU: percpu should use is_vmalloc_addr().

    Linus Torvalds
     
  • * 'stable/bug-fixes-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen: Use new irq_move functions
    xen: Convert genirq namespace
    xen: fix p2m section mismatches
    xen/p2m: Allocate p2m tracking pages on override
    xen-gntdev: unlock on error path in gntdev_mmap()
    xen-gntdev: return -EFAULT on copy_to_user failure

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
    watchdog: softdog.c: enhancement to optionally invoke panic instead of reboot on timer expiry
    watchdog: fix nv_tco section mismatch
    watchdog: sp5100_tco.c: Check if firmware has set correct value in tcobase.
    watchdog: Convert release_resource to release_region/release_mem_region
    watchdog: s3c2410_wdt.c: Convert release_resource to release_region/release_mem_region

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
    amd64_edac: Fix potential memleak

    Linus Torvalds
     
  • …el/git/tip/linux-2.6-tip

    * 'irq-final-for-linus-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (111 commits)
    gpio: ab8500: Mark broken
    genirq: Remove move_*irq leftovers
    genirq: Remove compat code
    drivers: Final irq namespace conversion
    mn10300: Use generic show_interrupts()
    mn10300: Cleanup irq_desc access
    mn10300: Convert genirq namespace
    frv: Use generic show_interrupts()
    frv: Convert genirq namespace
    frv: Select GENERIC_HARDIRQS_NO_DEPRECATED
    frv: Convert cpu irq_chip to new functions
    frv: Convert mb93493 irq_chip to new functions
    frv: Convert mb93093 irq_chip to new function
    frv: Convert mb93091 irq_chip to new functions
    frv: Fix typo from __do_IRQ overhaul
    frv: Remove stale irq_chip.end
    m68k: Convert irq function namespace
    xen: Use new irq_move functions
    xen: Cleanup genirq namespace
    unicore32: Use generic show_interrupts()
    ...

    Linus Torvalds
     
  • This patch fixes information leakage to the userspace by initializing
    the data buffer to zero.

    Reported-by: Peter Huewe
    Signed-off-by: Peter Huewe
    Signed-off-by: Marcel Selhorst
    [ Also removed the silly "* sizeof(u8)". If that isn't 1, we have way
    deeper problems than a simple multiplication can fix. - Linus ]
    Signed-off-by: Linus Torvalds

    Peter Huewe
     
  • We check the pointers together but at least one of them could be invalid
    due to failed allocation. Since we cannot continue if either of the two
    allocations has failed, exit early by freeing them both.

    Cc: # 38.x
    Reported-by: Mauro Carvalho Chehab
    Signed-off-by: Borislav Petkov

    Borislav Petkov
     

29 Mar, 2011

12 commits

  • Fix the incorrect use of igrab() inside the i_lock in NFS and Ceph‥

    If we are already holding the i_lock, we have a reference to the
    inode so we can safely use ihold() to gain an extra reference. This
    avoids hangs due to lock recursion on the i_lock now that the
    inode_lock is gone and igrab() uses the i_lock itself.

    Signed-off-by: Dave Chinner
    Cc: Al Viro
    Cc: linux-fsdevel@vger.kernel.org
    Cc: Ryan Mallon
    Signed-off-by: Linus Torvalds

    Dave Chinner
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (30 commits)
    xfrm: Restrict extended sequence numbers to esp
    xfrm: Check for esn buffer len in xfrm_new_ae
    xfrm: Assign esn pointers when cloning a state
    xfrm: Move the test on replay window size into the replay check functions
    netdev: bfin_mac: document TE setting in RMII modes
    drivers net: Fix declaration ordering in inline functions.
    cxgb3: Apply interrupt coalescing settings to all queues
    net: Always allocate at least 16 skb frags regardless of page size
    ipv4: Don't ip_rt_put() an error pointer in RAW sockets.
    net: fix ethtool->set_flags not intended -EINVAL return value
    mlx4_en: Fix loss of promiscuity
    tg3: Fix inline keyword usage
    tg3: use and instead and
    net: use CHECKSUM_NONE instead of magic number
    Net / jme: Do not use legacy PCI power management
    myri10ge: small rx_done refactoring
    bridge: notify applications if address of bridge device changes
    ipv4: Fix IP timestamp option (IPOPT_TS_PRESPEC) handling in ip_options_echo()
    can: c_can: Fix tx_bytes accounting
    can: c_can_platform: fix irq check in probe
    ...

    Linus Torvalds
     
  • These functions take irq_data as an argument and avoid a redundant
    lookup in the sparse irq case.

    Signed-off-by: Thomas Gleixner
    Cc: Ian Campbell
    Cc: Jeremy Fitzhardinge
    Cc: Konrad Rzeszutek Wilk
    Signed-off-by: Konrad Rzeszutek Wilk

    Thomas Gleixner
     
  • Converted with coccinelle.

    Signed-off-by: Thomas Gleixner
    Acked-by: Ian Campbell
    Signed-off-by: Konrad Rzeszutek Wilk

    Thomas Gleixner
     
  • Fix section mismatch warnings:
    set_phys_range_identity() is called by __init xen_set_identity(),
    so also mark set_phys_range_identity() as __init.
    then:
    __early_alloc_p2m() is called set_phys_range_identity(), so also mark
    __early_alloc_p2m() as __init.

    WARNING: arch/x86/built-in.o(.text+0x7856): Section mismatch in reference from the function __early_alloc_p2m() to the function .init.text:extend_brk()
    The function __early_alloc_p2m() references
    the function __init extend_brk().
    This is often because __early_alloc_p2m lacks a __init
    annotation or the annotation of extend_brk is wrong.

    WARNING: arch/x86/built-in.o(.text+0x7967): Section mismatch in reference from the function set_phys_range_identity() to the function .init.text:extend_brk()
    The function set_phys_range_identity() references
    the function __init extend_brk().
    This is often because set_phys_range_identity lacks a __init
    annotation or the annotation of extend_brk is wrong.

    [v2: Per Stephen Hemming recommonedation made __early_alloc_p2m static]
    Signed-off-by: Randy Dunlap
    Signed-off-by: Konrad Rzeszutek Wilk

    Randy Dunlap
     
  • Signed-off-by: Thomas Gleixner
    Signed-off-by: David Howells

    Thomas Gleixner
     
  • Convert to new function names. Converted with coccinelle.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: David Howells

    Thomas Gleixner
     
  • All chips converted

    Signed-off-by: Thomas Gleixner
    Signed-off-by: David Howells

    Thomas Gleixner
     
  • Signed-off-by: Thomas Gleixner
    Signed-off-by: David Howells

    Thomas Gleixner
     
  • Signed-off-by: Thomas Gleixner
    Signed-off-by: David Howells

    Thomas Gleixner
     
  • Signed-off-by: Thomas Gleixner
    Signed-off-by: David Howells

    Thomas Gleixner
     
  • Signed-off-by: Thomas Gleixner
    Signed-off-by: David Howells

    Thomas Gleixner