1. 11 Nov, 2008 2 commits
    • Eric Paris's avatar
      Any time fcaps or a setuid app under SECURE_NOROOT is used to result in a · 3fc689e9
      Eric Paris authored
      
      non-zero pE we will crate a new audit record which contains the entire set
      of known information about the executable in question, fP, fI, fE, fversion
      and includes the process's pE, pI, pP.  Before and after the bprm capability
      are applied.  This record type will only be emitted from execve syscalls.
      
      an example of making ping use fcaps instead of setuid:
      
      setcap "cat_net_raw+pe" /bin/ping
      
      type=SYSCALL msg=audit(1225742021.015:236): arch=c000003e syscall=59 success=yes exit=0 a0=1457f30 a1=14606b0 a2=1463940 a3=321b770a70 items=2 ppid=2929 pid=2963 auid=0 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=pts0 ses=3 comm="ping" exe="/bin/ping" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
      type=UNKNOWN[1321] msg=audit(1225742021.015:236): fver=2 fp=0000000000002000 fi=0000000000000000 fe=1 old_pp=0000000000000000 old_pi=0000000000000000 old_pe=0000000000000000 new_pp=0000000000002000 new_pi=0000000000000000 new_pe=0000000000002000
      type=EXECVE msg=audit(1225742021.015:236): argc=2 a0="ping" a1="127.0.0.1"
      type=CWD msg=audit(1225742021.015:236):  cwd="/home/test"
      type=PATH msg=audit(1225742021.015:236): item=0 name="/bin/ping" inode=49256 dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:ping_exec_t:s0 cap_fp=0000000000002000 cap_fe=1 cap_fver=2
      type=PATH msg=audit(1225742021.015:236): item=1 name=(null) inode=507915 dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:ld_so_t:s0
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      3fc689e9
    • Eric Paris's avatar
      This patch will print cap_permitted and cap_inheritable data in the PATH · 851f7ff5
      Eric Paris authored
      
      records of any file that has file capabilities set.  Files which do not
      have fcaps set will not have different PATH records.
      
      An example audit record if you run:
      setcap "cap_net_admin+pie" /bin/bash
      /bin/bash
      
      type=SYSCALL msg=audit(1225741937.363:230): arch=c000003e syscall=59 success=yes exit=0 a0=2119230 a1=210da30 a2=20ee290 a3=8 items=2 ppid=2149 pid=2923 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=3 comm="ping" exe="/bin/ping" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
      type=EXECVE msg=audit(1225741937.363:230): argc=2 a0="ping" a1="www.google.com"
      type=CWD msg=audit(1225741937.363:230):  cwd="/root"
      type=PATH msg=audit(1225741937.363:230): item=0 name="/bin/ping" inode=49256 dev=fd:00 mode=0104755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:ping_exec_t:s0 cap_fp=0000000000002000 cap_fi=0000000000002000 cap_fe=1 cap_fver=2
      type=PATH msg=audit(1225741937.363:230): item=1 name=(null) inode=507915 dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:ld_so_t:s0
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      851f7ff5
  2. 05 Nov, 2008 1 commit
    • Serge E. Hallyn's avatar
      file capabilities: add no_file_caps switch (v4) · 1f29fae2
      Serge E. Hallyn authored
      
      
      Add a no_file_caps boot option when file capabilities are
      compiled into the kernel (CONFIG_SECURITY_FILE_CAPABILITIES=y).
      
      This allows distributions to ship a kernel with file capabilities
      compiled in, without forcing users to use (and understand and
      trust) them.
      
      When no_file_caps is specified at boot, then when a process executes
      a file, any file capabilities stored with that file will not be
      used in the calculation of the process' new capability sets.
      
      This means that booting with the no_file_caps boot option will
      not be the same as booting a kernel with file capabilities
      compiled out - in particular a task with  CAP_SETPCAP will not
      have any chance of passing capabilities to another task (which
      isn't "really" possible anyway, and which may soon by killed
      altogether by David Howells in any case), and it will instead
      be able to put new capabilities in its pI.  However since fI
      will always be empty and pI is masked with fI, it gains the
      task nothing.
      
      We also support the extra prctl options, setting securebits and
      dropping capabilities from the per-process bounding set.
      
      The other remaining difference is that killpriv, task_setscheduler,
      setioprio, and setnice will continue to be hooked.  That will
      be noticable in the case where a root task changed its uid
      while keeping some caps, and another task owned by the new uid
      tries to change settings for the more privileged task.
      
      Changelog:
      	Nov 05 2008: (v4) trivial port on top of always-start-\
      		with-clear-caps patch
      	Sep 23 2008: nixed file_caps_enabled when file caps are
      		not compiled in as it isn't used.
      		Document no_file_caps in kernel-parameters.txt.
      Signed-off-by: default avatarSerge Hallyn <serue@us.ibm.com>
      Acked-by: default avatarAndrew G. Morgan <morgan@kernel.org>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      1f29fae2
  3. 03 Nov, 2008 3 commits
  4. 01 Nov, 2008 2 commits
  5. 30 Oct, 2008 8 commits
  6. 29 Oct, 2008 1 commit
    • Steven Rostedt's avatar
      ftrace: fix trace_nop config select · f3384b28
      Steven Rostedt authored
      
      
      Impact: build fix on non-function-tracing architectures
      
      The trace_nop is the tracer that is defined when no tracer is set in
      the ftrace infrastructure.
      
      The trace_nop was mistakenly selected by HAVE_FTRACE due to the confusion
      between ftrace infrastructure and the ftrace function tracer (which has
      been solved by renaming the function tracer).
      
      This patch changes the select to the approriate TRACING.
      
      This patch should fix compile errors on architectures that do not define
      the FUNCTION_TRACER.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f3384b28
  7. 28 Oct, 2008 6 commits
    • Suresh Siddha's avatar
      resources: fix x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs · d68612b2
      Suresh Siddha authored
      
      
      Impact: avoid false-positive WARN_ON()
      
      Andi Kleen reported:
      > When running x86info on a 2.6.27-git8 system I get
      >
      > resource map sanity check conflict: 0x9e000 0x9efff 0x10000 0x9e7ff System RAM
      > ------------[ cut here ]------------
      > WARNING: at /home/lsrc/linux/arch/x86/mm/ioremap.c:226 __ioremap_caller+0xf2/0x2d6()
      > ...
      
      Some of the pages below the 1MB ISA addresses will be shared typically by both
      BIOS and system usable RAM. For example:
      	BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
      	BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
      
      x86info reads the low physical address using /dev/mem, which internally
      uses ioremap() for accessing non RAM pages. ioremap() of such low
      pages conflicts with multiple resource entities leading to the
      above warning.
      
      Change the iomem_map_sanity_check() to allow mapping a page spanning multiple
      resource entities (minimum granularity that one can map is a page anyhow).
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d68612b2
    • Frederic Weisbecker's avatar
      ftrace: perform an initialization for ftrace to enable it · 0b6e4d56
      Frederic Weisbecker authored
      
      
      Impact: corrects a bug which made the non-dyn function tracer not functional
      
      With latest git, the non-dynamic function tracer didn't get any trace.
      
      The problem was the fact that ftrace_enabled wasn't initialized to 1
      because ftrace hasn't any init function when DYNAMIC_FTRACE is disabled.
      
      So when a tracer tries to register an ftrace_ops struct,
      __register_ftrace_function failed to set the hook.
      
      This patch corrects it by setting an init function to initialize
      ftrace during the boot.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0b6e4d56
    • Steven Rostedt's avatar
      ftrace: fix current_tracer error return · 60063a66
      Steven Rostedt authored
      The commit (in linux-tip) c2931e05
      
      
       ( ftrace: return an error when setting a nonexistent tracer )
      added useful code that would error when a bad tracer was written into
      the current_tracer file.
      
      But this had a bug if the amount written was more than the amount read by
      that code. The first iteration would set the tracer correctly, but since
      it did not consume the rest of what was written (usually whitespace), the
      userspace utility would continue to write what was not consumed. This
      second iteration would fail to find a tracer and return -EINVAL. Funny
      thing is that the tracer would have already been set.
      
      This patch just consumes all the data that is written to the file.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      60063a66
    • Heiko Carstens's avatar
      lockdep: fix irqs on/off ip tracing · 6afe40b4
      Heiko Carstens authored
      Impact: fix lockdep lock-api-caller output when irqsoff tracing is enabled
      
      81d68a96
      
       "ftrace: trace irq disabled critical timings" added wrappers around
      trace_hardirqs_on/off_caller. However these functions use
      __builtin_return_address(0) to figure out which function actually disabled
      or enabled irqs. The result is that we save the ips of trace_hardirqs_on/off
      instead of the real caller. Not very helpful.
      
      However since the patch from Steven the ip already gets passed. So use that
      and get rid of __builtin_return_address(0) in these two functions.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      6afe40b4
    • qinghuang feng's avatar
      lockdep: minor fix for debug_show_all_locks() · 46fec7ac
      qinghuang feng authored
      
      
      When we failed to get tasklist_lock eventually (count equals 0),
      we should only print " ignoring it.\n", and not print
      " locked it.\n" needlessly.
      Signed-off-by: default avatarQinghuang Feng <qhfeng.kernel@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      46fec7ac
    • Frederic Weisbecker's avatar
      tracing: fix a build error on alpha · 21798a84
      Frederic Weisbecker authored
      
      
      Impact: build fix on Alpha
      
      When tracing is enabled, some arch have included <linux/irqflags.h>
      on their <asm/system.h> but others like alpha or m68k don't.
      
      Build error on alpha:
      
      kernel/trace/trace.c: In function 'tracing_cpumask_write':
      kernel/trace/trace.c:2145: error: implicit declaration of function 'raw_local_irq_disable'
      kernel/trace/trace.c:2162: error: implicit declaration of function 'raw_local_irq_enable'
      
      Tested on Alpha through a cross-compiler (should correct a similar issue on m68k).
      Reported-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      21798a84
  8. 27 Oct, 2008 3 commits
  9. 26 Oct, 2008 2 commits
  10. 24 Oct, 2008 6 commits
    • Ingo Molnar's avatar
      ftrace: warning in kernel/trace/ftrace.c · f17845e5
      Ingo Molnar authored
      
      
      this warning:
      
        kernel/trace/ftrace.c:189: warning: ‘frozen_record_count’ defined but not used
      
      triggers because frozen_record_count is only used in the KCONFIG_MARKERS
      case. Move the variable it there.
      
      Alas, this frozen-record facility seems to have little use. The
      frozen_record_count variable is not used by anything, nor the flags.
      
      So this section might need a bit of dead-code-removal care as well.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f17845e5
    • Peter Zijlstra's avatar
      sched: virtual time buddy preemption · 3f3a4904
      Peter Zijlstra authored
      
      
      Since we moved wakeup preemption back to virtual time, it makes sense to move
      the buddy stuff back as well. The purpose of the buddy scheduling is to allow
      a quickly scheduling pair of tasks to run away from the group as far as a
      regular busy task would be allowed under wakeup preemption.
      
      This has the advantage that the pair can ping-pong for a while, enjoying
      cache-hotness. Without buddy scheduling other tasks would interleave destroying
      the cache.
      
      Also, it saves a word in cfs_rq.
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarMike Galbraith <efault@gmx.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      3f3a4904
    • Peter Zijlstra's avatar
      sched: re-instate vruntime based wakeup preemption · 464b7527
      Peter Zijlstra authored
      
      
      The advantage is that vruntime based wakeup preemption has a better
      conceptual model. Here wakeup_gran = 0 means: preempt when 'fair'.
      Therefore wakeup_gran is the granularity of unfairness we allow in order
      to make progress.
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarMike Galbraith <efault@gmx.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      464b7527
    • Mike Galbraith's avatar
      sched: weaken sync hint · 0d13033b
      Mike Galbraith authored
      
      
      Mysql+oltp and pgsql+oltp peaks are still shifted right. The below puts
      the peaks back to 1 client/server pair per core.
      
      Use the avg_overlap information to weaken the sync hint.
      Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0d13033b
    • Peter Zijlstra's avatar
      sched: more accurate min_vruntime accounting · 1af5f730
      Peter Zijlstra authored
      
      
      Mike noticed the current min_vruntime tracking can go wrong and skip the
      current task. If the only remaining task in the tree is a nice 19 task
      with huge vruntime, new tasks will be inserted too far to the right too,
      causing some interactibity issues.
      
      min_vruntime can only change due to the leftmost entry disappearing
      (dequeue_entity()), or by the leftmost entry being incremented past the
      next entry, which elects a new leftmost (__update_curr())
      
      Due to the current entry not being part of the actual tree, we have to
      compare the leftmost tree entry with the current entry, and take the
      leftmost of these two.
      
      So create a update_min_vruntime() function that takes computes the
      leftmost vruntime in the system (either tree of current) and increases
      the cfs_rq->min_vruntime if the computed value is larger than the
      previously found min_vruntime. And call this from the two sites we've
      identified that can change min_vruntime.
      Reported-by: default avatarMike Galbraith <efault@gmx.de>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarMike Galbraith <efault@gmx.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      1af5f730
    • Peter Zijlstra's avatar
      sched: fix a find_busiest_group buglet · 01c8c57d
      Peter Zijlstra authored
      In one of the group load balancer patches:
      
      	commit 408ed066
      
      
      	Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
      	Date:   Fri Jun 27 13:41:28 2008 +0200
      	Subject: sched: hierarchical load vs find_busiest_group
      
      The following change:
      
      -               if (max_load - this_load + SCHED_LOAD_SCALE_FUZZ >=
      +               if (max_load - this_load + 2*busiest_load_per_task >=
                                              busiest_load_per_task * imbn) {
      
      made the condition always true, because imbn is [1,2].
      Therefore, remove the 2*, and give the it a fair chance.
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarMike Galbraith <efault@gmx.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      01c8c57d
  11. 23 Oct, 2008 6 commits