~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/kernel/trace/trace_uprobe.c

Version: ~ [ linux-5.17-rc1 ] ~ [ linux-5.16.2 ] ~ [ linux-5.15.16 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.93 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.173 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.225 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.262 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.297 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.299 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * uprobes-based tracing events
  3  *
  4  * This program is free software; you can redistribute it and/or modify
  5  * it under the terms of the GNU General Public License version 2 as
  6  * published by the Free Software Foundation.
  7  *
  8  * This program is distributed in the hope that it will be useful,
  9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 11  * GNU General Public License for more details.
 12  *
 13  * You should have received a copy of the GNU General Public License
 14  * along with this program; if not, write to the Free Software
 15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 16  *
 17  * Copyright (C) IBM Corporation, 2010-2012
 18  * Author:      Srikar Dronamraju <srikar@linux.vnet.ibm.com>
 19  */
 20 
 21 #include <linux/module.h>
 22 #include <linux/uaccess.h>
 23 #include <linux/uprobes.h>
 24 #include <linux/namei.h>
 25 #include <linux/string.h>
 26 
 27 #include "trace_probe.h"
 28 
 29 #define UPROBE_EVENT_SYSTEM     "uprobes"
 30 
 31 struct uprobe_trace_entry_head {
 32         struct trace_entry      ent;
 33         unsigned long           vaddr[];
 34 };
 35 
 36 #define SIZEOF_TRACE_ENTRY(is_return)                   \
 37         (sizeof(struct uprobe_trace_entry_head) +       \
 38          sizeof(unsigned long) * (is_return ? 2 : 1))
 39 
 40 #define DATAOF_TRACE_ENTRY(entry, is_return)            \
 41         ((void*)(entry) + SIZEOF_TRACE_ENTRY(is_return))
 42 
 43 struct trace_uprobe_filter {
 44         rwlock_t                rwlock;
 45         int                     nr_systemwide;
 46         struct list_head        perf_events;
 47 };
 48 
 49 /*
 50  * uprobe event core functions
 51  */
 52 struct trace_uprobe {
 53         struct list_head                list;
 54         struct trace_uprobe_filter      filter;
 55         struct uprobe_consumer          consumer;
 56         struct inode                    *inode;
 57         char                            *filename;
 58         unsigned long                   offset;
 59         unsigned long                   nhit;
 60         struct trace_probe              tp;
 61 };
 62 
 63 #define SIZEOF_TRACE_UPROBE(n)                          \
 64         (offsetof(struct trace_uprobe, tp.args) +       \
 65         (sizeof(struct probe_arg) * (n)))
 66 
 67 static int register_uprobe_event(struct trace_uprobe *tu);
 68 static int unregister_uprobe_event(struct trace_uprobe *tu);
 69 
 70 static DEFINE_MUTEX(uprobe_lock);
 71 static LIST_HEAD(uprobe_list);
 72 
 73 struct uprobe_dispatch_data {
 74         struct trace_uprobe     *tu;
 75         unsigned long           bp_addr;
 76 };
 77 
 78 static int uprobe_dispatcher(struct uprobe_consumer *con, struct pt_regs *regs);
 79 static int uretprobe_dispatcher(struct uprobe_consumer *con,
 80                                 unsigned long func, struct pt_regs *regs);
 81 
 82 #ifdef CONFIG_STACK_GROWSUP
 83 static unsigned long adjust_stack_addr(unsigned long addr, unsigned int n)
 84 {
 85         return addr - (n * sizeof(long));
 86 }
 87 #else
 88 static unsigned long adjust_stack_addr(unsigned long addr, unsigned int n)
 89 {
 90         return addr + (n * sizeof(long));
 91 }
 92 #endif
 93 
 94 static unsigned long get_user_stack_nth(struct pt_regs *regs, unsigned int n)
 95 {
 96         unsigned long ret;
 97         unsigned long addr = user_stack_pointer(regs);
 98 
 99         addr = adjust_stack_addr(addr, n);
100 
101         if (copy_from_user(&ret, (void __force __user *) addr, sizeof(ret)))
102                 return 0;
103 
104         return ret;
105 }
106 
107 /*
108  * Uprobes-specific fetch functions
109  */
110 #define DEFINE_FETCH_stack(type)                                        \
111 static void FETCH_FUNC_NAME(stack, type)(struct pt_regs *regs,          \
112                                          void *offset, void *dest)      \
113 {                                                                       \
114         *(type *)dest = (type)get_user_stack_nth(regs,                  \
115                                               ((unsigned long)offset)); \
116 }
117 DEFINE_BASIC_FETCH_FUNCS(stack)
118 /* No string on the stack entry */
119 #define fetch_stack_string      NULL
120 #define fetch_stack_string_size NULL
121 
122 #define DEFINE_FETCH_memory(type)                                       \
123 static void FETCH_FUNC_NAME(memory, type)(struct pt_regs *regs,         \
124                                           void *addr, void *dest)       \
125 {                                                                       \
126         type retval;                                                    \
127         void __user *vaddr = (void __force __user *) addr;              \
128                                                                         \
129         if (copy_from_user(&retval, vaddr, sizeof(type)))               \
130                 *(type *)dest = 0;                                      \
131         else                                                            \
132                 *(type *) dest = retval;                                \
133 }
134 DEFINE_BASIC_FETCH_FUNCS(memory)
135 /*
136  * Fetch a null-terminated string. Caller MUST set *(u32 *)dest with max
137  * length and relative data location.
138  */
139 static void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs,
140                                             void *addr, void *dest)
141 {
142         long ret;
143         u32 rloc = *(u32 *)dest;
144         int maxlen  = get_rloc_len(rloc);
145         u8 *dst = get_rloc_data(dest);
146         void __user *src = (void __force __user *) addr;
147 
148         if (!maxlen)
149                 return;
150 
151         ret = strncpy_from_user(dst, src, maxlen);
152         if (ret == maxlen)
153                 dst[--ret] = '\0';
154 
155         if (ret < 0) {  /* Failed to fetch string */
156                 ((u8 *)get_rloc_data(dest))[0] = '\0';
157                 *(u32 *)dest = make_data_rloc(0, get_rloc_offs(rloc));
158         } else {
159                 *(u32 *)dest = make_data_rloc(ret, get_rloc_offs(rloc));
160         }
161 }
162 
163 static void FETCH_FUNC_NAME(memory, string_size)(struct pt_regs *regs,
164                                                  void *addr, void *dest)
165 {
166         int len;
167         void __user *vaddr = (void __force __user *) addr;
168 
169         len = strnlen_user(vaddr, MAX_STRING_SIZE);
170 
171         if (len == 0 || len > MAX_STRING_SIZE)  /* Failed to check length */
172                 *(u32 *)dest = 0;
173         else
174                 *(u32 *)dest = len;
175 }
176 
177 static unsigned long translate_user_vaddr(void *file_offset)
178 {
179         unsigned long base_addr;
180         struct uprobe_dispatch_data *udd;
181 
182         udd = (void *) current->utask->vaddr;
183 
184         base_addr = udd->bp_addr - udd->tu->offset;
185         return base_addr + (unsigned long)file_offset;
186 }
187 
188 #define DEFINE_FETCH_file_offset(type)                                  \
189 static void FETCH_FUNC_NAME(file_offset, type)(struct pt_regs *regs,    \
190                                                void *offset, void *dest)\
191 {                                                                       \
192         void *vaddr = (void *)translate_user_vaddr(offset);             \
193                                                                         \
194         FETCH_FUNC_NAME(memory, type)(regs, vaddr, dest);               \
195 }
196 DEFINE_BASIC_FETCH_FUNCS(file_offset)
197 DEFINE_FETCH_file_offset(string)
198 DEFINE_FETCH_file_offset(string_size)
199 
200 /* Fetch type information table */
201 static const struct fetch_type uprobes_fetch_type_table[] = {
202         /* Special types */
203         [FETCH_TYPE_STRING] = __ASSIGN_FETCH_TYPE("string", string, string,
204                                         sizeof(u32), 1, "__data_loc char[]"),
205         [FETCH_TYPE_STRSIZE] = __ASSIGN_FETCH_TYPE("string_size", u32,
206                                         string_size, sizeof(u32), 0, "u32"),
207         /* Basic types */
208         ASSIGN_FETCH_TYPE(u8,  u8,  0),
209         ASSIGN_FETCH_TYPE(u16, u16, 0),
210         ASSIGN_FETCH_TYPE(u32, u32, 0),
211         ASSIGN_FETCH_TYPE(u64, u64, 0),
212         ASSIGN_FETCH_TYPE(s8,  u8,  1),
213         ASSIGN_FETCH_TYPE(s16, u16, 1),
214         ASSIGN_FETCH_TYPE(s32, u32, 1),
215         ASSIGN_FETCH_TYPE(s64, u64, 1),
216 
217         ASSIGN_FETCH_TYPE_END
218 };
219 
220 static inline void init_trace_uprobe_filter(struct trace_uprobe_filter *filter)
221 {
222         rwlock_init(&filter->rwlock);
223         filter->nr_systemwide = 0;
224         INIT_LIST_HEAD(&filter->perf_events);
225 }
226 
227 static inline bool uprobe_filter_is_empty(struct trace_uprobe_filter *filter)
228 {
229         return !filter->nr_systemwide && list_empty(&filter->perf_events);
230 }
231 
232 static inline bool is_ret_probe(struct trace_uprobe *tu)
233 {
234         return tu->consumer.ret_handler != NULL;
235 }
236 
237 /*
238  * Allocate new trace_uprobe and initialize it (including uprobes).
239  */
240 static struct trace_uprobe *
241 alloc_trace_uprobe(const char *group, const char *event, int nargs, bool is_ret)
242 {
243         struct trace_uprobe *tu;
244 
245         if (!event || !is_good_name(event))
246                 return ERR_PTR(-EINVAL);
247 
248         if (!group || !is_good_name(group))
249                 return ERR_PTR(-EINVAL);
250 
251         tu = kzalloc(SIZEOF_TRACE_UPROBE(nargs), GFP_KERNEL);
252         if (!tu)
253                 return ERR_PTR(-ENOMEM);
254 
255         tu->tp.call.class = &tu->tp.class;
256         tu->tp.call.name = kstrdup(event, GFP_KERNEL);
257         if (!tu->tp.call.name)
258                 goto error;
259 
260         tu->tp.class.system = kstrdup(group, GFP_KERNEL);
261         if (!tu->tp.class.system)
262                 goto error;
263 
264         INIT_LIST_HEAD(&tu->list);
265         INIT_LIST_HEAD(&tu->tp.files);
266         tu->consumer.handler = uprobe_dispatcher;
267         if (is_ret)
268                 tu->consumer.ret_handler = uretprobe_dispatcher;
269         init_trace_uprobe_filter(&tu->filter);
270         return tu;
271 
272 error:
273         kfree(tu->tp.call.name);
274         kfree(tu);
275 
276         return ERR_PTR(-ENOMEM);
277 }
278 
279 static void free_trace_uprobe(struct trace_uprobe *tu)
280 {
281         int i;
282 
283         for (i = 0; i < tu->tp.nr_args; i++)
284                 traceprobe_free_probe_arg(&tu->tp.args[i]);
285 
286         iput(tu->inode);
287         kfree(tu->tp.call.class->system);
288         kfree(tu->tp.call.name);
289         kfree(tu->filename);
290         kfree(tu);
291 }
292 
293 static struct trace_uprobe *find_probe_event(const char *event, const char *group)
294 {
295         struct trace_uprobe *tu;
296 
297         list_for_each_entry(tu, &uprobe_list, list)
298                 if (strcmp(ftrace_event_name(&tu->tp.call), event) == 0 &&
299                     strcmp(tu->tp.call.class->system, group) == 0)
300                         return tu;
301 
302         return NULL;
303 }
304 
305 /* Unregister a trace_uprobe and probe_event: call with locking uprobe_lock */
306 static int unregister_trace_uprobe(struct trace_uprobe *tu)
307 {
308         int ret;
309 
310         ret = unregister_uprobe_event(tu);
311         if (ret)
312                 return ret;
313 
314         list_del(&tu->list);
315         free_trace_uprobe(tu);
316         return 0;
317 }
318 
319 /* Register a trace_uprobe and probe_event */
320 static int register_trace_uprobe(struct trace_uprobe *tu)
321 {
322         struct trace_uprobe *old_tu;
323         int ret;
324 
325         mutex_lock(&uprobe_lock);
326 
327         /* register as an event */
328         old_tu = find_probe_event(ftrace_event_name(&tu->tp.call),
329                         tu->tp.call.class->system);
330         if (old_tu) {
331                 /* delete old event */
332                 ret = unregister_trace_uprobe(old_tu);
333                 if (ret)
334                         goto end;
335         }
336 
337         ret = register_uprobe_event(tu);
338         if (ret) {
339                 pr_warning("Failed to register probe event(%d)\n", ret);
340                 goto end;
341         }
342 
343         list_add_tail(&tu->list, &uprobe_list);
344 
345 end:
346         mutex_unlock(&uprobe_lock);
347 
348         return ret;
349 }
350 
351 /*
352  * Argument syntax:
353  *  - Add uprobe: p|r[:[GRP/]EVENT] PATH:OFFSET [FETCHARGS]
354  *
355  *  - Remove uprobe: -:[GRP/]EVENT
356  */
357 static int create_trace_uprobe(int argc, char **argv)
358 {
359         struct trace_uprobe *tu;
360         struct inode *inode;
361         char *arg, *event, *group, *filename;
362         char buf[MAX_EVENT_NAME_LEN];
363         struct path path;
364         unsigned long offset;
365         bool is_delete, is_return;
366         int i, ret;
367 
368         inode = NULL;
369         ret = 0;
370         is_delete = false;
371         is_return = false;
372         event = NULL;
373         group = NULL;
374 
375         /* argc must be >= 1 */
376         if (argv[0][0] == '-')
377                 is_delete = true;
378         else if (argv[0][0] == 'r')
379                 is_return = true;
380         else if (argv[0][0] != 'p') {
381                 pr_info("Probe definition must be started with 'p', 'r' or '-'.\n");
382                 return -EINVAL;
383         }
384 
385         if (argv[0][1] == ':') {
386                 event = &argv[0][2];
387                 arg = strchr(event, '/');
388 
389                 if (arg) {
390                         group = event;
391                         event = arg + 1;
392                         event[-1] = '\0';
393 
394                         if (strlen(group) == 0) {
395                                 pr_info("Group name is not specified\n");
396                                 return -EINVAL;
397                         }
398                 }
399                 if (strlen(event) == 0) {
400                         pr_info("Event name is not specified\n");
401                         return -EINVAL;
402                 }
403         }
404         if (!group)
405                 group = UPROBE_EVENT_SYSTEM;
406 
407         if (is_delete) {
408                 int ret;
409 
410                 if (!event) {
411                         pr_info("Delete command needs an event name.\n");
412                         return -EINVAL;
413                 }
414                 mutex_lock(&uprobe_lock);
415                 tu = find_probe_event(event, group);
416 
417                 if (!tu) {
418                         mutex_unlock(&uprobe_lock);
419                         pr_info("Event %s/%s doesn't exist.\n", group, event);
420                         return -ENOENT;
421                 }
422                 /* delete an event */
423                 ret = unregister_trace_uprobe(tu);
424                 mutex_unlock(&uprobe_lock);
425                 return ret;
426         }
427 
428         if (argc < 2) {
429                 pr_info("Probe point is not specified.\n");
430                 return -EINVAL;
431         }
432         if (isdigit(argv[1][0])) {
433                 pr_info("probe point must be have a filename.\n");
434                 return -EINVAL;
435         }
436         arg = strchr(argv[1], ':');
437         if (!arg) {
438                 ret = -EINVAL;
439                 goto fail_address_parse;
440         }
441 
442         *arg++ = '\0';
443         filename = argv[1];
444         ret = kern_path(filename, LOOKUP_FOLLOW, &path);
445         if (ret)
446                 goto fail_address_parse;
447 
448         inode = igrab(d_inode(path.dentry));
449         path_put(&path);
450 
451         if (!inode || !S_ISREG(inode->i_mode)) {
452                 ret = -EINVAL;
453                 goto fail_address_parse;
454         }
455 
456         ret = kstrtoul(arg, 0, &offset);
457         if (ret)
458                 goto fail_address_parse;
459 
460         argc -= 2;
461         argv += 2;
462 
463         /* setup a probe */
464         if (!event) {
465                 char *tail;
466                 char *ptr;
467 
468                 tail = kstrdup(kbasename(filename), GFP_KERNEL);
469                 if (!tail) {
470                         ret = -ENOMEM;
471                         goto fail_address_parse;
472                 }
473 
474                 ptr = strpbrk(tail, ".-_");
475                 if (ptr)
476                         *ptr = '\0';
477 
478                 snprintf(buf, MAX_EVENT_NAME_LEN, "%c_%s_0x%lx", 'p', tail, offset);
479                 event = buf;
480                 kfree(tail);
481         }
482 
483         tu = alloc_trace_uprobe(group, event, argc, is_return);
484         if (IS_ERR(tu)) {
485                 pr_info("Failed to allocate trace_uprobe.(%d)\n", (int)PTR_ERR(tu));
486                 ret = PTR_ERR(tu);
487                 goto fail_address_parse;
488         }
489         tu->offset = offset;
490         tu->inode = inode;
491         tu->filename = kstrdup(filename, GFP_KERNEL);
492 
493         if (!tu->filename) {
494                 pr_info("Failed to allocate filename.\n");
495                 ret = -ENOMEM;
496                 goto error;
497         }
498 
499         /* parse arguments */
500         ret = 0;
501         for (i = 0; i < argc && i < MAX_TRACE_ARGS; i++) {
502                 struct probe_arg *parg = &tu->tp.args[i];
503 
504                 /* Increment count for freeing args in error case */
505                 tu->tp.nr_args++;
506 
507                 /* Parse argument name */
508                 arg = strchr(argv[i], '=');
509                 if (arg) {
510                         *arg++ = '\0';
511                         parg->name = kstrdup(argv[i], GFP_KERNEL);
512                 } else {
513                         arg = argv[i];
514                         /* If argument name is omitted, set "argN" */
515                         snprintf(buf, MAX_EVENT_NAME_LEN, "arg%d", i + 1);
516                         parg->name = kstrdup(buf, GFP_KERNEL);
517                 }
518 
519                 if (!parg->name) {
520                         pr_info("Failed to allocate argument[%d] name.\n", i);
521                         ret = -ENOMEM;
522                         goto error;
523                 }
524 
525                 if (!is_good_name(parg->name)) {
526                         pr_info("Invalid argument[%d] name: %s\n", i, parg->name);
527                         ret = -EINVAL;
528                         goto error;
529                 }
530 
531                 if (traceprobe_conflict_field_name(parg->name, tu->tp.args, i)) {
532                         pr_info("Argument[%d] name '%s' conflicts with "
533                                 "another field.\n", i, argv[i]);
534                         ret = -EINVAL;
535                         goto error;
536                 }
537 
538                 /* Parse fetch argument */
539                 ret = traceprobe_parse_probe_arg(arg, &tu->tp.size, parg,
540                                                  is_return, false,
541                                                  uprobes_fetch_type_table);
542                 if (ret) {
543                         pr_info("Parse error at argument[%d]. (%d)\n", i, ret);
544                         goto error;
545                 }
546         }
547 
548         ret = register_trace_uprobe(tu);
549         if (ret)
550                 goto error;
551         return 0;
552 
553 error:
554         free_trace_uprobe(tu);
555         return ret;
556 
557 fail_address_parse:
558         iput(inode);
559 
560         pr_info("Failed to parse address or file.\n");
561 
562         return ret;
563 }
564 
565 static int cleanup_all_probes(void)
566 {
567         struct trace_uprobe *tu;
568         int ret = 0;
569 
570         mutex_lock(&uprobe_lock);
571         while (!list_empty(&uprobe_list)) {
572                 tu = list_entry(uprobe_list.next, struct trace_uprobe, list);
573                 ret = unregister_trace_uprobe(tu);
574                 if (ret)
575                         break;
576         }
577         mutex_unlock(&uprobe_lock);
578         return ret;
579 }
580 
581 /* Probes listing interfaces */
582 static void *probes_seq_start(struct seq_file *m, loff_t *pos)
583 {
584         mutex_lock(&uprobe_lock);
585         return seq_list_start(&uprobe_list, *pos);
586 }
587 
588 static void *probes_seq_next(struct seq_file *m, void *v, loff_t *pos)
589 {
590         return seq_list_next(v, &uprobe_list, pos);
591 }
592 
593 static void probes_seq_stop(struct seq_file *m, void *v)
594 {
595         mutex_unlock(&uprobe_lock);
596 }
597 
598 static int probes_seq_show(struct seq_file *m, void *v)
599 {
600         struct trace_uprobe *tu = v;
601         char c = is_ret_probe(tu) ? 'r' : 'p';
602         int i;
603 
604         seq_printf(m, "%c:%s/%s", c, tu->tp.call.class->system,
605                         ftrace_event_name(&tu->tp.call));
606         seq_printf(m, " %s:0x%p", tu->filename, (void *)tu->offset);
607 
608         for (i = 0; i < tu->tp.nr_args; i++)
609                 seq_printf(m, " %s=%s", tu->tp.args[i].name, tu->tp.args[i].comm);
610 
611         seq_putc(m, '\n');
612         return 0;
613 }
614 
615 static const struct seq_operations probes_seq_op = {
616         .start  = probes_seq_start,
617         .next   = probes_seq_next,
618         .stop   = probes_seq_stop,
619         .show   = probes_seq_show
620 };
621 
622 static int probes_open(struct inode *inode, struct file *file)
623 {
624         int ret;
625 
626         if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC)) {
627                 ret = cleanup_all_probes();
628                 if (ret)
629                         return ret;
630         }
631 
632         return seq_open(file, &probes_seq_op);
633 }
634 
635 static ssize_t probes_write(struct file *file, const char __user *buffer,
636                             size_t count, loff_t *ppos)
637 {
638         return traceprobe_probes_write(file, buffer, count, ppos, create_trace_uprobe);
639 }
640 
641 static const struct file_operations uprobe_events_ops = {
642         .owner          = THIS_MODULE,
643         .open           = probes_open,
644         .read           = seq_read,
645         .llseek         = seq_lseek,
646         .release        = seq_release,
647         .write          = probes_write,
648 };
649 
650 /* Probes profiling interfaces */
651 static int probes_profile_seq_show(struct seq_file *m, void *v)
652 {
653         struct trace_uprobe *tu = v;
654 
655         seq_printf(m, "  %s %-44s %15lu\n", tu->filename,
656                         ftrace_event_name(&tu->tp.call), tu->nhit);
657         return 0;
658 }
659 
660 static const struct seq_operations profile_seq_op = {
661         .start  = probes_seq_start,
662         .next   = probes_seq_next,
663         .stop   = probes_seq_stop,
664         .show   = probes_profile_seq_show
665 };
666 
667 static int profile_open(struct inode *inode, struct file *file)
668 {
669         return seq_open(file, &profile_seq_op);
670 }
671 
672 static const struct file_operations uprobe_profile_ops = {
673         .owner          = THIS_MODULE,
674         .open           = profile_open,
675         .read           = seq_read,
676         .llseek         = seq_lseek,
677         .release        = seq_release,
678 };
679 
680 struct uprobe_cpu_buffer {
681         struct mutex mutex;
682         void *buf;
683 };
684 static struct uprobe_cpu_buffer __percpu *uprobe_cpu_buffer;
685 static int uprobe_buffer_refcnt;
686 
687 static int uprobe_buffer_init(void)
688 {
689         int cpu, err_cpu;
690 
691         uprobe_cpu_buffer = alloc_percpu(struct uprobe_cpu_buffer);
692         if (uprobe_cpu_buffer == NULL)
693                 return -ENOMEM;
694 
695         for_each_possible_cpu(cpu) {
696                 struct page *p = alloc_pages_node(cpu_to_node(cpu),
697                                                   GFP_KERNEL, 0);
698                 if (p == NULL) {
699                         err_cpu = cpu;
700                         goto err;
701                 }
702                 per_cpu_ptr(uprobe_cpu_buffer, cpu)->buf = page_address(p);
703                 mutex_init(&per_cpu_ptr(uprobe_cpu_buffer, cpu)->mutex);
704         }
705 
706         return 0;
707 
708 err:
709         for_each_possible_cpu(cpu) {
710                 if (cpu == err_cpu)
711                         break;
712                 free_page((unsigned long)per_cpu_ptr(uprobe_cpu_buffer, cpu)->buf);
713         }
714 
715         free_percpu(uprobe_cpu_buffer);
716         return -ENOMEM;
717 }
718 
719 static int uprobe_buffer_enable(void)
720 {
721         int ret = 0;
722 
723         BUG_ON(!mutex_is_locked(&event_mutex));
724 
725         if (uprobe_buffer_refcnt++ == 0) {
726                 ret = uprobe_buffer_init();
727                 if (ret < 0)
728                         uprobe_buffer_refcnt--;
729         }
730 
731         return ret;
732 }
733 
734 static void uprobe_buffer_disable(void)
735 {
736         int cpu;
737 
738         BUG_ON(!mutex_is_locked(&event_mutex));
739 
740         if (--uprobe_buffer_refcnt == 0) {
741                 for_each_possible_cpu(cpu)
742                         free_page((unsigned long)per_cpu_ptr(uprobe_cpu_buffer,
743                                                              cpu)->buf);
744 
745                 free_percpu(uprobe_cpu_buffer);
746                 uprobe_cpu_buffer = NULL;
747         }
748 }
749 
750 static struct uprobe_cpu_buffer *uprobe_buffer_get(void)
751 {
752         struct uprobe_cpu_buffer *ucb;
753         int cpu;
754 
755         cpu = raw_smp_processor_id();
756         ucb = per_cpu_ptr(uprobe_cpu_buffer, cpu);
757 
758         /*
759          * Use per-cpu buffers for fastest access, but we might migrate
760          * so the mutex makes sure we have sole access to it.
761          */
762         mutex_lock(&ucb->mutex);
763 
764         return ucb;
765 }
766 
767 static void uprobe_buffer_put(struct uprobe_cpu_buffer *ucb)
768 {
769         mutex_unlock(&ucb->mutex);
770 }
771 
772 static void __uprobe_trace_func(struct trace_uprobe *tu,
773                                 unsigned long func, struct pt_regs *regs,
774                                 struct uprobe_cpu_buffer *ucb, int dsize,
775                                 struct ftrace_event_file *ftrace_file)
776 {
777         struct uprobe_trace_entry_head *entry;
778         struct ring_buffer_event *event;
779         struct ring_buffer *buffer;
780         void *data;
781         int size, esize;
782         struct ftrace_event_call *call = &tu->tp.call;
783 
784         WARN_ON(call != ftrace_file->event_call);
785 
786         if (WARN_ON_ONCE(tu->tp.size + dsize > PAGE_SIZE))
787                 return;
788 
789         if (ftrace_trigger_soft_disabled(ftrace_file))
790                 return;
791 
792         esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));
793         size = esize + tu->tp.size + dsize;
794         event = trace_event_buffer_lock_reserve(&buffer, ftrace_file,
795                                                 call->event.type, size, 0, 0);
796         if (!event)
797                 return;
798 
799         entry = ring_buffer_event_data(event);
800         if (is_ret_probe(tu)) {
801                 entry->vaddr[0] = func;
802                 entry->vaddr[1] = instruction_pointer(regs);
803                 data = DATAOF_TRACE_ENTRY(entry, true);
804         } else {
805                 entry->vaddr[0] = instruction_pointer(regs);
806                 data = DATAOF_TRACE_ENTRY(entry, false);
807         }
808 
809         memcpy(data, ucb->buf, tu->tp.size + dsize);
810 
811         event_trigger_unlock_commit(ftrace_file, buffer, event, entry, 0, 0);
812 }
813 
814 /* uprobe handler */
815 static int uprobe_trace_func(struct trace_uprobe *tu, struct pt_regs *regs,
816                              struct uprobe_cpu_buffer *ucb, int dsize)
817 {
818         struct event_file_link *link;
819 
820         if (is_ret_probe(tu))
821                 return 0;
822 
823         rcu_read_lock();
824         list_for_each_entry_rcu(link, &tu->tp.files, list)
825                 __uprobe_trace_func(tu, 0, regs, ucb, dsize, link->file);
826         rcu_read_unlock();
827 
828         return 0;
829 }
830 
831 static void uretprobe_trace_func(struct trace_uprobe *tu, unsigned long func,
832                                  struct pt_regs *regs,
833                                  struct uprobe_cpu_buffer *ucb, int dsize)
834 {
835         struct event_file_link *link;
836 
837         rcu_read_lock();
838         list_for_each_entry_rcu(link, &tu->tp.files, list)
839                 __uprobe_trace_func(tu, func, regs, ucb, dsize, link->file);
840         rcu_read_unlock();
841 }
842 
843 /* Event entry printers */
844 static enum print_line_t
845 print_uprobe_event(struct trace_iterator *iter, int flags, struct trace_event *event)
846 {
847         struct uprobe_trace_entry_head *entry;
848         struct trace_seq *s = &iter->seq;
849         struct trace_uprobe *tu;
850         u8 *data;
851         int i;
852 
853         entry = (struct uprobe_trace_entry_head *)iter->ent;
854         tu = container_of(event, struct trace_uprobe, tp.call.event);
855 
856         if (is_ret_probe(tu)) {
857                 trace_seq_printf(s, "%s: (0x%lx <- 0x%lx)",
858                                  ftrace_event_name(&tu->tp.call),
859                                  entry->vaddr[1], entry->vaddr[0]);
860                 data = DATAOF_TRACE_ENTRY(entry, true);
861         } else {
862                 trace_seq_printf(s, "%s: (0x%lx)",
863                                  ftrace_event_name(&tu->tp.call),
864                                  entry->vaddr[0]);
865                 data = DATAOF_TRACE_ENTRY(entry, false);
866         }
867 
868         for (i = 0; i < tu->tp.nr_args; i++) {
869                 struct probe_arg *parg = &tu->tp.args[i];
870 
871                 if (!parg->type->print(s, parg->name, data + parg->offset, entry))
872                         goto out;
873         }
874 
875         trace_seq_putc(s, '\n');
876 
877  out:
878         return trace_handle_return(s);
879 }
880 
881 typedef bool (*filter_func_t)(struct uprobe_consumer *self,
882                                 enum uprobe_filter_ctx ctx,
883                                 struct mm_struct *mm);
884 
885 static int
886 probe_event_enable(struct trace_uprobe *tu, struct ftrace_event_file *file,
887                    filter_func_t filter)
888 {
889         bool enabled = trace_probe_is_enabled(&tu->tp);
890         struct event_file_link *link = NULL;
891         int ret;
892 
893         if (file) {
894                 if (tu->tp.flags & TP_FLAG_PROFILE)
895                         return -EINTR;
896 
897                 link = kmalloc(sizeof(*link), GFP_KERNEL);
898                 if (!link)
899                         return -ENOMEM;
900 
901                 link->file = file;
902                 list_add_tail_rcu(&link->list, &tu->tp.files);
903 
904                 tu->tp.flags |= TP_FLAG_TRACE;
905         } else {
906                 if (tu->tp.flags & TP_FLAG_TRACE)
907                         return -EINTR;
908 
909                 tu->tp.flags |= TP_FLAG_PROFILE;
910         }
911 
912         WARN_ON(!uprobe_filter_is_empty(&tu->filter));
913 
914         if (enabled)
915                 return 0;
916 
917         ret = uprobe_buffer_enable();
918         if (ret)
919                 goto err_flags;
920 
921         tu->consumer.filter = filter;
922         ret = uprobe_register(tu->inode, tu->offset, &tu->consumer);
923         if (ret)
924                 goto err_buffer;
925 
926         return 0;
927 
928  err_buffer:
929         uprobe_buffer_disable();
930 
931  err_flags:
932         if (file) {
933                 list_del(&link->list);
934                 kfree(link);
935                 tu->tp.flags &= ~TP_FLAG_TRACE;
936         } else {
937                 tu->tp.flags &= ~TP_FLAG_PROFILE;
938         }
939         return ret;
940 }
941 
942 static void
943 probe_event_disable(struct trace_uprobe *tu, struct ftrace_event_file *file)
944 {
945         if (!trace_probe_is_enabled(&tu->tp))
946                 return;
947 
948         if (file) {
949                 struct event_file_link *link;
950 
951                 link = find_event_file_link(&tu->tp, file);
952                 if (!link)
953                         return;
954 
955                 list_del_rcu(&link->list);
956                 /* synchronize with u{,ret}probe_trace_func */
957                 synchronize_sched();
958                 kfree(link);
959 
960                 if (!list_empty(&tu->tp.files))
961                         return;
962         }
963 
964         WARN_ON(!uprobe_filter_is_empty(&tu->filter));
965 
966         uprobe_unregister(tu->inode, tu->offset, &tu->consumer);
967         tu->tp.flags &= file ? ~TP_FLAG_TRACE : ~TP_FLAG_PROFILE;
968 
969         uprobe_buffer_disable();
970 }
971 
972 static int uprobe_event_define_fields(struct ftrace_event_call *event_call)
973 {
974         int ret, i, size;
975         struct uprobe_trace_entry_head field;
976         struct trace_uprobe *tu = event_call->data;
977 
978         if (is_ret_probe(tu)) {
979                 DEFINE_FIELD(unsigned long, vaddr[0], FIELD_STRING_FUNC, 0);
980                 DEFINE_FIELD(unsigned long, vaddr[1], FIELD_STRING_RETIP, 0);
981                 size = SIZEOF_TRACE_ENTRY(true);
982         } else {
983                 DEFINE_FIELD(unsigned long, vaddr[0], FIELD_STRING_IP, 0);
984                 size = SIZEOF_TRACE_ENTRY(false);
985         }
986         /* Set argument names as fields */
987         for (i = 0; i < tu->tp.nr_args; i++) {
988                 struct probe_arg *parg = &tu->tp.args[i];
989 
990                 ret = trace_define_field(event_call, parg->type->fmttype,
991                                          parg->name, size + parg->offset,
992                                          parg->type->size, parg->type->is_signed,
993                                          FILTER_OTHER);
994 
995                 if (ret)
996                         return ret;
997         }
998         return 0;
999 }
1000 
1001 #ifdef CONFIG_PERF_EVENTS
1002 static bool
1003 __uprobe_perf_filter(struct trace_uprobe_filter *filter, struct mm_struct *mm)
1004 {
1005         struct perf_event *event;
1006 
1007         if (filter->nr_systemwide)
1008                 return true;
1009 
1010         list_for_each_entry(event, &filter->perf_events, hw.tp_list) {
1011                 if (event->hw.target->mm == mm)
1012                         return true;
1013         }
1014 
1015         return false;
1016 }
1017 
1018 static inline bool
1019 uprobe_filter_event(struct trace_uprobe *tu, struct perf_event *event)
1020 {
1021         return __uprobe_perf_filter(&tu->filter, event->hw.target->mm);
1022 }
1023 
1024 static int uprobe_perf_close(struct trace_uprobe *tu, struct perf_event *event)
1025 {
1026         bool done;
1027 
1028         write_lock(&tu->filter.rwlock);
1029         if (event->hw.target) {
1030                 list_del(&event->hw.tp_list);
1031                 done = tu->filter.nr_systemwide ||
1032                         (event->hw.target->flags & PF_EXITING) ||
1033                         uprobe_filter_event(tu, event);
1034         } else {
1035                 tu->filter.nr_systemwide--;
1036                 done = tu->filter.nr_systemwide;
1037         }
1038         write_unlock(&tu->filter.rwlock);
1039 
1040         if (!done)
1041                 return uprobe_apply(tu->inode, tu->offset, &tu->consumer, false);
1042 
1043         return 0;
1044 }
1045 
1046 static int uprobe_perf_open(struct trace_uprobe *tu, struct perf_event *event)
1047 {
1048         bool done;
1049         int err;
1050 
1051         write_lock(&tu->filter.rwlock);
1052         if (event->hw.target) {
1053                 /*
1054                  * event->parent != NULL means copy_process(), we can avoid
1055                  * uprobe_apply(). current->mm must be probed and we can rely
1056                  * on dup_mmap() which preserves the already installed bp's.
1057                  *
1058                  * attr.enable_on_exec means that exec/mmap will install the
1059                  * breakpoints we need.
1060                  */
1061                 done = tu->filter.nr_systemwide ||
1062                         event->parent || event->attr.enable_on_exec ||
1063                         uprobe_filter_event(tu, event);
1064                 list_add(&event->hw.tp_list, &tu->filter.perf_events);
1065         } else {
1066                 done = tu->filter.nr_systemwide;
1067                 tu->filter.nr_systemwide++;
1068         }
1069         write_unlock(&tu->filter.rwlock);
1070 
1071         err = 0;
1072         if (!done) {
1073                 err = uprobe_apply(tu->inode, tu->offset, &tu->consumer, true);
1074                 if (err)
1075                         uprobe_perf_close(tu, event);
1076         }
1077         return err;
1078 }
1079 
1080 static bool uprobe_perf_filter(struct uprobe_consumer *uc,
1081                                 enum uprobe_filter_ctx ctx, struct mm_struct *mm)
1082 {
1083         struct trace_uprobe *tu;
1084         int ret;
1085 
1086         tu = container_of(uc, struct trace_uprobe, consumer);
1087         read_lock(&tu->filter.rwlock);
1088         ret = __uprobe_perf_filter(&tu->filter, mm);
1089         read_unlock(&tu->filter.rwlock);
1090 
1091         return ret;
1092 }
1093 
1094 static void __uprobe_perf_func(struct trace_uprobe *tu,
1095                                unsigned long func, struct pt_regs *regs,
1096                                struct uprobe_cpu_buffer *ucb, int dsize)
1097 {
1098         struct ftrace_event_call *call = &tu->tp.call;
1099         struct uprobe_trace_entry_head *entry;
1100         struct hlist_head *head;
1101         void *data;
1102         int size, esize;
1103         int rctx;
1104 
1105         esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));
1106 
1107         size = esize + tu->tp.size + dsize;
1108         size = ALIGN(size + sizeof(u32), sizeof(u64)) - sizeof(u32);
1109         if (WARN_ONCE(size > PERF_MAX_TRACE_SIZE, "profile buffer not large enough"))
1110                 return;
1111 
1112         preempt_disable();
1113         head = this_cpu_ptr(call->perf_events);
1114         if (hlist_empty(head))
1115                 goto out;
1116 
1117         entry = perf_trace_buf_prepare(size, call->event.type, NULL, &rctx);
1118         if (!entry)
1119                 goto out;
1120 
1121         if (is_ret_probe(tu)) {
1122                 entry->vaddr[0] = func;
1123                 entry->vaddr[1] = instruction_pointer(regs);
1124                 data = DATAOF_TRACE_ENTRY(entry, true);
1125         } else {
1126                 entry->vaddr[0] = instruction_pointer(regs);
1127                 data = DATAOF_TRACE_ENTRY(entry, false);
1128         }
1129 
1130         memcpy(data, ucb->buf, tu->tp.size + dsize);
1131 
1132         if (size - esize > tu->tp.size + dsize) {
1133                 int len = tu->tp.size + dsize;
1134 
1135                 memset(data + len, 0, size - esize - len);
1136         }
1137 
1138         perf_trace_buf_submit(entry, size, rctx, 0, 1, regs, head, NULL);
1139  out:
1140         preempt_enable();
1141 }
1142 
1143 /* uprobe profile handler */
1144 static int uprobe_perf_func(struct trace_uprobe *tu, struct pt_regs *regs,
1145                             struct uprobe_cpu_buffer *ucb, int dsize)
1146 {
1147         if (!uprobe_perf_filter(&tu->consumer, 0, current->mm))
1148                 return UPROBE_HANDLER_REMOVE;
1149 
1150         if (!is_ret_probe(tu))
1151                 __uprobe_perf_func(tu, 0, regs, ucb, dsize);
1152         return 0;
1153 }
1154 
1155 static void uretprobe_perf_func(struct trace_uprobe *tu, unsigned long func,
1156                                 struct pt_regs *regs,
1157                                 struct uprobe_cpu_buffer *ucb, int dsize)
1158 {
1159         __uprobe_perf_func(tu, func, regs, ucb, dsize);
1160 }
1161 #endif  /* CONFIG_PERF_EVENTS */
1162 
1163 static int
1164 trace_uprobe_register(struct ftrace_event_call *event, enum trace_reg type,
1165                       void *data)
1166 {
1167         struct trace_uprobe *tu = event->data;
1168         struct ftrace_event_file *file = data;
1169 
1170         switch (type) {
1171         case TRACE_REG_REGISTER:
1172                 return probe_event_enable(tu, file, NULL);
1173 
1174         case TRACE_REG_UNREGISTER:
1175                 probe_event_disable(tu, file);
1176                 return 0;
1177 
1178 #ifdef CONFIG_PERF_EVENTS
1179         case TRACE_REG_PERF_REGISTER:
1180                 return probe_event_enable(tu, NULL, uprobe_perf_filter);
1181 
1182         case TRACE_REG_PERF_UNREGISTER:
1183                 probe_event_disable(tu, NULL);
1184                 return 0;
1185 
1186         case TRACE_REG_PERF_OPEN:
1187                 return uprobe_perf_open(tu, data);
1188 
1189         case TRACE_REG_PERF_CLOSE:
1190                 return uprobe_perf_close(tu, data);
1191 
1192 #endif
1193         default:
1194                 return 0;
1195         }
1196         return 0;
1197 }
1198 
1199 static int uprobe_dispatcher(struct uprobe_consumer *con, struct pt_regs *regs)
1200 {
1201         struct trace_uprobe *tu;
1202         struct uprobe_dispatch_data udd;
1203         struct uprobe_cpu_buffer *ucb;
1204         int dsize, esize;
1205         int ret = 0;
1206 
1207 
1208         tu = container_of(con, struct trace_uprobe, consumer);
1209         tu->nhit++;
1210 
1211         udd.tu = tu;
1212         udd.bp_addr = instruction_pointer(regs);
1213 
1214         current->utask->vaddr = (unsigned long) &udd;
1215 
1216         if (WARN_ON_ONCE(!uprobe_cpu_buffer))
1217                 return 0;
1218 
1219         dsize = __get_data_size(&tu->tp, regs);
1220         esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));
1221 
1222         ucb = uprobe_buffer_get();
1223         store_trace_args(esize, &tu->tp, regs, ucb->buf, dsize);
1224 
1225         if (tu->tp.flags & TP_FLAG_TRACE)
1226                 ret |= uprobe_trace_func(tu, regs, ucb, dsize);
1227 
1228 #ifdef CONFIG_PERF_EVENTS
1229         if (tu->tp.flags & TP_FLAG_PROFILE)
1230                 ret |= uprobe_perf_func(tu, regs, ucb, dsize);
1231 #endif
1232         uprobe_buffer_put(ucb);
1233         return ret;
1234 }
1235 
1236 static int uretprobe_dispatcher(struct uprobe_consumer *con,
1237                                 unsigned long func, struct pt_regs *regs)
1238 {
1239         struct trace_uprobe *tu;
1240         struct uprobe_dispatch_data udd;
1241         struct uprobe_cpu_buffer *ucb;
1242         int dsize, esize;
1243 
1244         tu = container_of(con, struct trace_uprobe, consumer);
1245 
1246         udd.tu = tu;
1247         udd.bp_addr = func;
1248 
1249         current->utask->vaddr = (unsigned long) &udd;
1250 
1251         if (WARN_ON_ONCE(!uprobe_cpu_buffer))
1252                 return 0;
1253 
1254         dsize = __get_data_size(&tu->tp, regs);
1255         esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));
1256 
1257         ucb = uprobe_buffer_get();
1258         store_trace_args(esize, &tu->tp, regs, ucb->buf, dsize);
1259 
1260         if (tu->tp.flags & TP_FLAG_TRACE)
1261                 uretprobe_trace_func(tu, func, regs, ucb, dsize);
1262 
1263 #ifdef CONFIG_PERF_EVENTS
1264         if (tu->tp.flags & TP_FLAG_PROFILE)
1265                 uretprobe_perf_func(tu, func, regs, ucb, dsize);
1266 #endif
1267         uprobe_buffer_put(ucb);
1268         return 0;
1269 }
1270 
1271 static struct trace_event_functions uprobe_funcs = {
1272         .trace          = print_uprobe_event
1273 };
1274 
1275 static int register_uprobe_event(struct trace_uprobe *tu)
1276 {
1277         struct ftrace_event_call *call = &tu->tp.call;
1278         int ret;
1279 
1280         /* Initialize ftrace_event_call */
1281         INIT_LIST_HEAD(&call->class->fields);
1282         call->event.funcs = &uprobe_funcs;
1283         call->class->define_fields = uprobe_event_define_fields;
1284 
1285         if (set_print_fmt(&tu->tp, is_ret_probe(tu)) < 0)
1286                 return -ENOMEM;
1287 
1288         ret = register_ftrace_event(&call->event);
1289         if (!ret) {
1290                 kfree(call->print_fmt);
1291                 return -ENODEV;
1292         }
1293 
1294         call->class->reg = trace_uprobe_register;
1295         call->data = tu;
1296         ret = trace_add_event_call(call);
1297 
1298         if (ret) {
1299                 pr_info("Failed to register uprobe event: %s\n",
1300                         ftrace_event_name(call));
1301                 kfree(call->print_fmt);
1302                 unregister_ftrace_event(&call->event);
1303         }
1304 
1305         return ret;
1306 }
1307 
1308 static int unregister_uprobe_event(struct trace_uprobe *tu)
1309 {
1310         int ret;
1311 
1312         /* tu->event is unregistered in trace_remove_event_call() */
1313         ret = trace_remove_event_call(&tu->tp.call);
1314         if (ret)
1315                 return ret;
1316         kfree(tu->tp.call.print_fmt);
1317         tu->tp.call.print_fmt = NULL;
1318         return 0;
1319 }
1320 
1321 /* Make a trace interface for controling probe points */
1322 static __init int init_uprobe_trace(void)
1323 {
1324         struct dentry *d_tracer;
1325 
1326         d_tracer = tracing_init_dentry();
1327         if (IS_ERR(d_tracer))
1328                 return 0;
1329 
1330         trace_create_file("uprobe_events", 0644, d_tracer,
1331                                     NULL, &uprobe_events_ops);
1332         /* Profile interface */
1333         trace_create_file("uprobe_profile", 0444, d_tracer,
1334                                     NULL, &uprobe_profile_ops);
1335         return 0;
1336 }
1337 
1338 fs_initcall(init_uprobe_trace);
1339 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp