30 Sep, 2006

10 commits

  • Allows commas to be embedded into context mount options (i.e. "-o
    context=some_selinux_context_t"), to better support multiple categories,
    which are separated by commas and confuse mount.

    For example, with the current code:

    mount -t iso9660 /dev/cdrom /media/cdrom -o \
    ro,context=system_u:object_r:iso9660_t:s0:c1,c3,c4,exec

    The context option that will be interpreted by SELinux is
    context=system_u:object_r:iso9660_t:s0:c1

    instead of
    context=system_u:object_r:iso9660_t:s0:c1,c3,c4

    The options that will be passed on to the file system will be
    ro,c3,c4,exec.

    The proposed solution is to allow/require the SELinux context option
    specified to mount to use quotes when the context contains a comma.

    This patch modifies the option parsing in parse_opts(), contained in
    mount.c, to take options after finding a comma only if it hasn't seen a
    quote or if the quotes are matched. It also introduces a new function that
    will strip the quotes from the context option prior to translation. The
    quotes are replaced after the translation is completed to insure that in
    the event the raw context contains commas the kernel will be able to
    interpret the correct context.

    Signed-off-by: Cory Olmo
    Signed-off-by: James Morris
    Acked-by: Stephen Smalley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cory Olmo
     
  • Don't open-code NOPAGE_SIGBUS.

    Signed-off-by: Adam Litke
    Acked-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adam Litke
     
  • Failing context is a multi threaded process context and the failing
    sequence is as follows.

    One thread T0 doing self modifying code on page X on processor P0 and
    another thread T1 doing COW (breaking the COW setup as part of just
    happened fork() in another thread T2) on the same page X on processor P1.
    T0 doing SMC can endup modifying the new page Y (allocated by the T1 doing
    COW on P1) but because of different I/D TLB's, P0 ITLB will not see the new
    mapping till the flush TLB IPI from P1 is received. During this interval,
    if T0 executes the code created by SMC it can result in an app error (as
    ITLB still points to old page X and endup executing the content in page X
    rather than using the content in page Y).

    Fix this issue by first clearing the PTE and flushing it, before updating
    it with new entry.

    Hugh sayeth:

    I was a bit sceptical, in the habit of thinking that Self Modifying Code
    must look such issues itself: but I guess there's nothing it can do to avoid
    this one.

    Fair enough, what you're changing it to is pretty much what powerpc and
    s390 were already doing, and is a more robust way of proceeding, consistent
    with how ptes are set everywhere else.

    The ptep_clear_flush is a bit heavy-handed (it's anxious to return the pte
    that was atomically cleared), but we'd have to wander through lots of arches
    to get the right minimal behaviour. It'd also be nice to eliminate
    ptep_establish completely, now only used to define other macros/inlines: it
    always seemed obfuscation to me, what you've got there now is clearer.
    Let's put those cleanups on a TODO list.

    Signed-off-by: Suresh Siddha
    Acked-by: "David S. Miller"
    Acked-by: Hugh Dickins
    Cc: Nick Piggin
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Siddha, Suresh B
     
  • Convert s390 page handling macros to functions. In particular this fixes a
    problem with s390's SetPageUptodate macro which uses its input parameter
    twice which again can cause subtle bugs.

    [akpm@osdl.org: build fix]
    Cc: Martin Schwidefsky
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     
  • We leak a bh ref in "journal_init_dev()" in case of failure.

    Signed-off-by: Zoltan Menyhart
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zoltan Menyhart
     
  • It's always good to make symbols static when we can, and this also eliminates
    the need to rename the function in jbd2

    Suggested by Eric Sandeen.

    Signed-off-by: Dave Kleikamp
    Cc: Eric Sandeen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Kleikamp
     
  • The uninitialised pmu_backlight_lock causes the current Fedora test kernel
    (which has spinlock debugging enabled) to panic on suspend.

    This is suboptimal, so I fixed it.

    Signed-off-by: David Woodhouse
    Acked-by: Benjamin Herrenschmidt
    Acked-by: Michael Hanselmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Woodhouse
     
  • If the cpu has the lock held for write, is interrupted, and the interrupt
    handler calls read_trylock(), it's an instant deadlock.

    Now, Dave Miller has subsequently pointed out that we don't have any
    situations where this can occur. Nevertheless, we should delete
    generic__raw_read_lock (and its associated EXPORT to make Arjan happy) so that
    nobody thinks they can use it.

    Acked-by: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     
  • Signed-off-by: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • ... or we'll end up with cpu_online_map being evaluated on UP. In
    modules. cpumask.h is very careful to avoid that, and for a very good
    reason. So should we...

    PS: yes, it really triggers (on alpha).

    Signed-off-by: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     

29 Sep, 2006

30 commits