lkml.org 
[lkml]   [2006]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] PATCH 3/4 - Time virtualization : PTRACE_SYSCALL_MASK
    > Add PTRACE_SYSCALL_MASK, which allows system calls to be selectively
    > traced. It takes a bitmask and a length. A system call is traced
    > if its bit is one. Otherwise, it executes normally, and is
    > invisible to the ptracing parent.
    > [...]
    > +int set_syscall_mask(struct task_struct *child, char __user *mask,
    > + unsigned long len)
    > +{
    > + int i, n = (NR_syscalls + 7) / 8;
    > + char c;
    > +
    > + if(len > n){
    > + for(i = NR_syscalls; i < len * 8; i++){
    > + get_user(c, &mask[i / 8]);
    > + if(!(c & (1 << (i % 8)))){
    > + printk("Out of range syscall at %d\n", i);
    > + return -EINVAL;
    > + }
    > + }
    > +
    > + len = n;
    > + }

    Since it's quite likely that len > n will be true (e.g. after installing the
    latest version of your debug tool) it would be better to silently ignore all
    bits not within the range of NR_syscalls.
    There is no point in flooding the console. The tracing process won't see any
    of the non existant syscalls it requested to see anyway.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-04-20 11:07    [W:4.582 / U:0.388 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site