senozhatsky
Joined 11 years ago
Karma
165
Submissions
76
Member since
Apr 10
Linux kernel developer. Japan.
View on Hacker NewsJoined 11 years ago
DECLARE_EVENT_CLASS(sched_wakeup_template,
TP_PROTO(struct task_struct *p),
TP_ARGS(__perf_task(p)),
TP_STRUCT__entry(
__array( char, comm, TASK_COMM_LEN )
__field( pid_t, pid )
__field( int, prio )
__field( int, target_cpu )
),
TP_fast_assign(
memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
__entry->pid = p->pid;
__entry->prio = p->prio; /* XXX SCHED_DEADLINE */
__entry->target_cpu = task_cpu(p);
),
TP_printk("comm=%s pid=%d prio=%d target_cpu=%03d",
__entry->comm, __entry->pid, __entry->prio,
__entry->target_cpu)
);
[1] https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds...Isn't it (push/pop) how locals basically work?
puts()'s attack surface is smaller than printf()'s.
This is not how your message appeared to me - "printf() is vulnerable to injections, use puts() instead". Both are vulnerable to "unintended read()-s".This is not the case for RO strings, is it?
printf("%p\n", v);
the Generic call must look like this displayln((const void *)v);
is it really better? > printf("%s\n", "Hello, World!");
>
> That's an awful lot of symbolic syntax.
Well... Because it should have been printf("Hello, World!\n");
in the first place?One can do something like
printf("%s,%s%c\n", "Hello", "World", '!');
and claim that C is awful and that displayln("Hello, World!");
is so much better.