Print this page
12826 update to smatch 0.6.1-rc1-il-6
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/smatch/src/check_kernel_printf.c
+++ new/usr/src/tools/smatch/src/check_kernel_printf.c
1 1 /*
2 2 * Copyright (C) 2015 Rasmus Villemoes.
3 3 *
4 4 * This program is free software; you can redistribute it and/or
5 5 * modify it under the terms of the GNU General Public License
6 6 * as published by the Free Software Foundation; either version 2
7 7 * of the License, or (at your option) any later version.
↓ open down ↓ |
7 lines elided |
↑ open up ↑ |
8 8 *
9 9 * This program is distributed in the hope that it will be useful,
10 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 * GNU General Public License for more details.
13 13 *
14 14 * You should have received a copy of the GNU General Public License
15 15 * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt
16 16 */
17 17
18 +#define _GNU_SOURCE
19 +
18 20 #include <assert.h>
19 21 #include <ctype.h>
20 22 #include <string.h>
21 23 #include "smatch.h"
22 24 #include "smatch_slist.h"
23 25
24 26 #define spam(args...) do { \
25 27 if (option_spammy) \
26 28 sm_msg(args); \
27 29 } while (0)
28 30
29 31 static int my_id;
30 32
31 33 /*
32 34 * Much of this is taken directly from the kernel (mostly vsprintf.c),
33 35 * with a few modifications here and there.
34 36 */
35 37
36 38 #define KERN_SOH_ASCII '\001'
37 39
38 40 typedef unsigned char u8;
39 41 typedef signed short s16;
40 42
41 43 #define SIGN 1 /* unsigned/signed, must be 1 */
42 44 #define LEFT 2 /* left justified */
43 45 #define PLUS 4 /* show plus */
44 46 #define SPACE 8 /* space if plus */
45 47 #define ZEROPAD 16 /* pad with zero, must be 16 == '0' - ' ' */
46 48 #define SMALL 32 /* use lowercase in hex (must be 32 == 0x20) */
47 49 #define SPECIAL 64 /* prefix hex with "0x", octal with "0" */
48 50
49 51 enum format_type {
50 52 FORMAT_TYPE_NONE, /* Just a string part */
51 53 FORMAT_TYPE_WIDTH,
52 54 FORMAT_TYPE_PRECISION,
53 55 FORMAT_TYPE_CHAR,
54 56 FORMAT_TYPE_STR,
55 57 FORMAT_TYPE_PTR,
56 58 FORMAT_TYPE_PERCENT_CHAR,
57 59 FORMAT_TYPE_INVALID,
58 60 FORMAT_TYPE_LONG_LONG,
59 61 FORMAT_TYPE_ULONG,
60 62 FORMAT_TYPE_LONG,
61 63 FORMAT_TYPE_UBYTE,
62 64 FORMAT_TYPE_BYTE,
63 65 FORMAT_TYPE_USHORT,
64 66 FORMAT_TYPE_SHORT,
65 67 FORMAT_TYPE_UINT,
66 68 FORMAT_TYPE_INT,
67 69 FORMAT_TYPE_SIZE_T,
68 70 FORMAT_TYPE_PTRDIFF,
69 71 FORMAT_TYPE_NRCHARS, /* Reintroduced for this checker */
70 72 FORMAT_TYPE_FLOAT, /* for various floating point formatters */
71 73 };
72 74
73 75 struct printf_spec {
74 76 unsigned int type:8; /* format_type enum */
75 77 signed int field_width:24; /* width of output field */
76 78 unsigned int flags:8; /* flags to number() */
77 79 unsigned int base:8; /* number base, 8, 10 or 16 only */
78 80 signed int precision:16; /* # of digits/chars */
79 81 } __packed;
80 82 #define FIELD_WIDTH_MAX ((1 << 23) - 1)
81 83 #define PRECISION_MAX ((1 << 15) - 1)
82 84 extern char __check_printf_spec[1-2*(sizeof(struct printf_spec) != 8)];
83 85
84 86 static int
85 87 skip_atoi(const char **s)
86 88 {
87 89 int i = 0;
88 90
89 91 while (isdigit(**s))
90 92 i = i*10 + *((*s)++) - '0';
91 93
92 94 return i;
93 95 }
94 96
95 97 static int
96 98 format_decode(const char *fmt, struct printf_spec *spec)
97 99 {
98 100 const char *start = fmt;
99 101 char qualifier;
100 102
101 103 /* we finished early by reading the field width */
102 104 if (spec->type == FORMAT_TYPE_WIDTH) {
103 105 if (spec->field_width < 0) {
104 106 spec->field_width = -spec->field_width;
105 107 spec->flags |= LEFT;
106 108 }
107 109 spec->type = FORMAT_TYPE_NONE;
108 110 goto precision;
109 111 }
110 112
111 113 /* we finished early by reading the precision */
112 114 if (spec->type == FORMAT_TYPE_PRECISION) {
113 115 if (spec->precision < 0)
114 116 spec->precision = 0;
115 117
116 118 spec->type = FORMAT_TYPE_NONE;
117 119 goto qualifier;
118 120 }
119 121
120 122 /* By default */
121 123 spec->type = FORMAT_TYPE_NONE;
122 124
123 125 for (; *fmt ; ++fmt) {
124 126 if (*fmt == '%')
125 127 break;
126 128 }
127 129
128 130 /* Return the current non-format string */
129 131 if (fmt != start || !*fmt)
130 132 return fmt - start;
131 133
132 134 /* Process flags */
133 135 spec->flags = 0;
134 136
135 137 while (1) { /* this also skips first '%' */
136 138 bool found = true;
137 139
138 140 ++fmt;
139 141
140 142 switch (*fmt) {
141 143 case '-': spec->flags |= LEFT; break;
142 144 case '+': spec->flags |= PLUS; break;
143 145 case ' ': spec->flags |= SPACE; break;
144 146 case '#': spec->flags |= SPECIAL; break;
145 147 case '0': spec->flags |= ZEROPAD; break;
146 148 default: found = false;
147 149 }
148 150
149 151 if (!found)
150 152 break;
151 153 }
152 154
153 155 /* get field width */
154 156 spec->field_width = -1;
155 157
156 158 if (isdigit(*fmt))
157 159 spec->field_width = skip_atoi(&fmt);
158 160 else if (*fmt == '*') {
159 161 /* it's the next argument */
160 162 spec->type = FORMAT_TYPE_WIDTH;
161 163 return ++fmt - start;
162 164 }
163 165
164 166 precision:
165 167 /* get the precision */
166 168 spec->precision = -1;
167 169 if (*fmt == '.') {
168 170 ++fmt;
169 171 if (isdigit(*fmt)) {
170 172 spec->precision = skip_atoi(&fmt);
171 173 if (spec->precision < 0)
172 174 spec->precision = 0;
173 175 } else if (*fmt == '*') {
174 176 /* it's the next argument */
175 177 spec->type = FORMAT_TYPE_PRECISION;
176 178 return ++fmt - start;
177 179 }
178 180 }
179 181
180 182 qualifier:
181 183 /* get the conversion qualifier */
182 184 qualifier = 0;
183 185 if (*fmt == 'h' || _tolower(*fmt) == 'l' ||
184 186 _tolower(*fmt) == 'z' || *fmt == 't') {
185 187 qualifier = *fmt++;
186 188 if (qualifier == *fmt) {
187 189 if (qualifier == 'l') {
188 190 qualifier = 'L';
189 191 ++fmt;
190 192 } else if (qualifier == 'h') {
191 193 qualifier = 'H';
192 194 ++fmt;
193 195 } else {
194 196 sm_warning("invalid repeated qualifier '%c'", *fmt);
195 197 }
196 198 }
197 199 }
198 200
199 201 /* default base */
↓ open down ↓ |
172 lines elided |
↑ open up ↑ |
200 202 spec->base = 10;
201 203 switch (*fmt) {
202 204 case 'c':
203 205 if (qualifier)
204 206 sm_warning("qualifier '%c' ignored for %%c specifier", qualifier);
205 207
206 208 spec->type = FORMAT_TYPE_CHAR;
207 209 return ++fmt - start;
208 210
209 211 case 's':
210 - if (qualifier)
212 + if (qualifier && qualifier != 'l')
211 213 sm_warning("qualifier '%c' ignored for %%s specifier", qualifier);
212 214
213 215 spec->type = FORMAT_TYPE_STR;
214 216 return ++fmt - start;
215 217
216 218 case 'p':
217 219 spec->type = FORMAT_TYPE_PTR;
218 220 return ++fmt - start;
219 221
220 222 case '%':
221 223 spec->type = FORMAT_TYPE_PERCENT_CHAR;
222 224 return ++fmt - start;
223 225
224 226 /* integer number formats - set up the flags and "break" */
225 227 case 'o':
226 228 spec->base = 8;
227 229 break;
228 230
229 231 case 'x':
230 232 spec->flags |= SMALL;
231 233
232 234 case 'X':
233 235 spec->base = 16;
234 236 break;
235 237
236 238 case 'd':
237 239 case 'i':
238 240 spec->flags |= SIGN;
239 241 case 'u':
240 242 break;
241 243
242 244 case 'n':
243 245 spec->type = FORMAT_TYPE_NRCHARS;
244 246 return ++fmt - start;
245 247
246 248 case 'a': case 'A':
247 249 case 'e': case 'E':
248 250 case 'f': case 'F':
249 251 case 'g': case 'G':
250 252 spec->type = FORMAT_TYPE_FLOAT;
251 253 return ++fmt - start;
252 254
253 255 default:
254 256 spec->type = FORMAT_TYPE_INVALID;
255 257 /* Unlike the kernel code, we 'consume' the invalid
256 258 * character so that it can get included in the
257 259 * report. After that, we bail out. */
258 260 return ++fmt - start;
259 261 }
260 262
261 263 if (qualifier == 'L')
262 264 spec->type = FORMAT_TYPE_LONG_LONG;
263 265 else if (qualifier == 'l') {
264 266 if (spec->flags & SIGN)
265 267 spec->type = FORMAT_TYPE_LONG;
266 268 else
267 269 spec->type = FORMAT_TYPE_ULONG;
268 270 } else if (_tolower(qualifier) == 'z') {
269 271 spec->type = FORMAT_TYPE_SIZE_T;
270 272 } else if (qualifier == 't') {
271 273 spec->type = FORMAT_TYPE_PTRDIFF;
272 274 } else if (qualifier == 'H') {
273 275 if (spec->flags & SIGN)
274 276 spec->type = FORMAT_TYPE_BYTE;
275 277 else
276 278 spec->type = FORMAT_TYPE_UBYTE;
277 279 } else if (qualifier == 'h') {
278 280 if (spec->flags & SIGN)
279 281 spec->type = FORMAT_TYPE_SHORT;
280 282 else
281 283 spec->type = FORMAT_TYPE_USHORT;
282 284 } else {
283 285 if (spec->flags & SIGN)
284 286 spec->type = FORMAT_TYPE_INT;
285 287 else
286 288 spec->type = FORMAT_TYPE_UINT;
287 289 }
288 290
289 291 return ++fmt - start;
290 292 }
291 293
292 294 static int is_struct_tag(struct symbol *type, const char *tag)
293 295 {
294 296 return type->type == SYM_STRUCT && type->ident && !strcmp(type->ident->name, tag);
295 297 }
296 298
297 299 static int has_struct_tag(struct symbol *type, const char *tag)
298 300 {
299 301 struct symbol *tmp;
300 302
301 303 if (type->type == SYM_STRUCT)
302 304 return is_struct_tag(type, tag);
303 305 if (type->type == SYM_UNION) {
304 306 FOR_EACH_PTR(type->symbol_list, tmp) {
305 307 tmp = get_real_base_type(tmp);
306 308 if (tmp && is_struct_tag(tmp, tag))
307 309 return 1;
308 310 } END_FOR_EACH_PTR(tmp);
309 311 }
310 312 return 0;
311 313 }
312 314
313 315 static int is_char_type(struct symbol *type)
314 316 {
315 317 return type == &uchar_ctype || type == &char_ctype || type == &schar_ctype;
316 318 }
317 319
318 320 /*
319 321 * I have absolutely no idea if this is how one is supposed to get the
320 322 * symbol representing a typedef, but it seems to work.
321 323 */
322 324 struct typedef_lookup {
323 325 const char *name;
324 326 struct symbol *sym;
325 327 int failed;
326 328 };
327 329
328 330 static struct symbol *_typedef_lookup(const char *name)
329 331 {
330 332 struct ident *id;
331 333 struct symbol *node;
332 334
333 335 id = built_in_ident(name);
334 336 if (!id)
335 337 return NULL;
336 338 node = lookup_symbol(id, NS_TYPEDEF);
337 339 if (!node || node->type != SYM_NODE)
338 340 return NULL;
339 341 return get_real_base_type(node);
340 342 }
341 343
342 344 static void typedef_lookup(struct typedef_lookup *tl)
343 345 {
344 346 if (tl->sym || tl->failed)
345 347 return;
346 348 tl->sym = _typedef_lookup(tl->name);
347 349 if (!tl->sym) {
348 350 sm_perror(" could not find typedef '%s'", tl->name);
349 351 tl->failed = 1;
350 352 }
351 353 }
352 354
353 355
354 356 static void ip4(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
355 357 {
356 358 enum { ENDIAN_BIG, ENDIAN_LITTLE, ENDIAN_HOST } endian = ENDIAN_BIG;
357 359
358 360 assert(fmt[0] == 'i' || fmt[0] == 'I');
359 361 assert(fmt[1] == '4');
360 362
361 363 if (isalnum(fmt[2])) {
362 364 switch (fmt[2]) {
363 365 case 'h':
364 366 endian = ENDIAN_HOST;
365 367 break;
366 368 case 'l':
367 369 endian = ENDIAN_LITTLE;
368 370 break;
369 371 case 'n':
370 372 case 'b':
371 373 endian = ENDIAN_BIG;
372 374 break;
373 375 default:
374 376 sm_warning("'%%p%c4' can only be followed by one of [hnbl], not '%c'", fmt[0], fmt[2]);
375 377 }
376 378 if (isalnum(fmt[3]))
377 379 sm_warning("'%%p%c4' can only be followed by precisely one of [hnbl]", fmt[0]);
378 380 }
379 381
380 382
381 383 if (type->ctype.modifiers & MOD_NODEREF)
382 384 sm_error("passing __user pointer to '%%p%c4'", fmt[0]);
383 385
384 386 /*
385 387 * If we have a pointer to char/u8/s8, we expect the caller to
386 388 * handle endianness; I don't think there's anything we can
387 389 * do. I'd like to check that if we're passed a pointer to a
388 390 * __bitwise u32 (most likely a __be32), we should have endian
389 391 * == ENDIAN_BIG. But I can't figure out how to get that
390 392 * information (it also seems to require ensuring certain
391 393 * macros are defined). But struct in_addr certainly consists
392 394 * of only a single __be32, so in that case we can do a check.
393 395 */
394 396 if (is_char_type(basetype))
395 397 return;
396 398
397 399 if (is_struct_tag(basetype, "in_addr") && endian != ENDIAN_BIG)
398 400 sm_warning("passing struct in_addr* to '%%p%c4%c', is the endianness ok?", fmt[0], fmt[2]);
399 401
400 402 /* ... */
401 403 }
402 404
403 405 static void ip6(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
404 406 {
405 407 assert(fmt[0] == 'i' || fmt[0] == 'I');
406 408 assert(fmt[1] == '6');
407 409
408 410 if (isalnum(fmt[2])) {
409 411 if (fmt[2] != 'c')
410 412 sm_warning("'%%p%c6' can only be followed by c", fmt[0]);
411 413 else if (fmt[0] == 'i')
412 414 sm_warning("'%%pi6' does not allow flag c");
413 415 if (isalnum(fmt[3]))
414 416 sm_warning("'%%p%c6%c' cannot be followed by other alphanumerics", fmt[0], fmt[2]);
415 417 }
416 418
417 419 if (type->ctype.modifiers & MOD_NODEREF)
418 420 sm_error("passing __user pointer to '%%p%c6'", fmt[0]);
419 421 }
420 422
421 423 static void ipS(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
422 424 {
423 425 const char *f;
424 426
425 427 assert(tolower(fmt[0]) == 'i');
426 428 assert(fmt[1] == 'S');
427 429
428 430 for (f = fmt+2; isalnum(*f); ++f) {
429 431 /* It's probably too anal checking for duplicate flags. */
430 432 if (!strchr("pfschnbl", *f))
431 433 sm_warning("'%%p%cS' cannot be followed by '%c'", fmt[0], *f);
432 434 }
433 435
434 436 /*
435 437 * XXX: Should we also allow passing a pointer to a union, one
436 438 * member of which is a struct sockaddr? It may be slightly
437 439 * cleaner actually passing &u.raw instead of just &u, though
438 440 * the generated code is of course exactly the same. For now,
439 441 * we do accept struct sockaddr_in and struct sockaddr_in6,
440 442 * since those are easy to handle and rather harmless.
441 443 */
442 444 if (!has_struct_tag(basetype, "sockaddr") &&
443 445 !has_struct_tag(basetype, "sockaddr_in") &&
444 446 !has_struct_tag(basetype, "sockaddr_in6") &&
445 447 !has_struct_tag(basetype, "__kernel_sockaddr_storage"))
446 448 sm_error("'%%p%cS' expects argument of type struct sockaddr *, "
447 449 "argument %d has type '%s'", fmt[0], vaidx, type_to_str(type));
448 450 }
449 451
450 452 static void hex_string(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
451 453 {
452 454 assert(fmt[0] == 'h');
453 455 if (isalnum(fmt[1])) {
454 456 if (!strchr("CDN", fmt[1]))
455 457 sm_warning("'%%ph' cannot be followed by '%c'", fmt[1]);
456 458 if (isalnum(fmt[2]))
457 459 sm_warning("'%%ph' can be followed by at most one of [CDN], and no other alphanumerics");
458 460 }
459 461 if (type->ctype.modifiers & MOD_NODEREF)
460 462 sm_error("passing __user pointer to %%ph");
461 463 }
462 464
463 465 static void escaped_string(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
464 466 {
465 467 assert(fmt[0] == 'E');
466 468 while (isalnum(*++fmt)) {
467 469 if (!strchr("achnops", *fmt))
468 470 sm_warning("%%pE can only be followed by a combination of [achnops]");
469 471 }
470 472 if (type->ctype.modifiers & MOD_NODEREF)
471 473 sm_error("passing __user pointer to %%pE");
472 474 }
473 475
474 476 static void resource_string(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
475 477 {
476 478 assert(tolower(fmt[0]) == 'r');
477 479 if (!is_struct_tag(basetype, "resource")) {
478 480 sm_error("'%%p%c' expects argument of type struct resource *, "
479 481 "but argument %d has type '%s'", fmt[0], vaidx, type_to_str(type));
480 482 }
481 483 if (isalnum(fmt[1]))
482 484 sm_warning("'%%p%c' cannot be followed by '%c'", fmt[0], fmt[1]);
483 485 }
484 486
485 487 static void mac_address_string(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
486 488 {
487 489 assert(tolower(fmt[0]) == 'm');
488 490 if (isalnum(fmt[1])) {
489 491 if (!(fmt[1] == 'F' || fmt[1] == 'R'))
490 492 sm_warning("'%%p%c' cannot be followed by '%c'", fmt[0], fmt[1]);
491 493 if (fmt[0] == 'm' && fmt[1] == 'F')
492 494 sm_warning("it is pointless to pass flag F to %%pm");
493 495 if (isalnum(fmt[2]))
494 496 sm_warning("'%%p%c%c' cannot be followed by other alphanumeric", fmt[0], fmt[1]);
495 497 }
496 498 /* Technically, bdaddr_t is a typedef for an anonymous struct, but this still seems to work. */
497 499 if (!is_char_type(basetype) && !is_struct_tag(basetype, "bdaddr_t") && basetype != &void_ctype) {
498 500 sm_warning("'%%p%c' expects argument of type u8 * or bdaddr_t *, argument %d has type '%s'",
499 501 fmt[0], vaidx, type_to_str(type));
500 502 }
501 503 if (type->ctype.modifiers & MOD_NODEREF)
502 504 sm_error("passing __user pointer to '%%p%c'", fmt[0]);
503 505 }
504 506
505 507 static void dentry_file(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
506 508 {
507 509 const char *tag;
508 510
509 511 assert(tolower(fmt[0]) == 'd');
510 512 tag = fmt[0] == 'd' ? "dentry" : "file";
511 513
512 514 if (isalnum(fmt[1])) {
513 515 if (!strchr("234", fmt[1]))
514 516 sm_warning("'%%p%c' can only be followed by one of [234]", fmt[0]);
515 517 if (isalnum(fmt[2]))
516 518 sm_warning("'%%p%c%c' cannot be followed by '%c'", fmt[0], fmt[1], fmt[2]);
517 519 }
518 520
519 521 if (!is_struct_tag(basetype, tag))
520 522 sm_error("'%%p%c' expects argument of type struct '%s*', argument %d has type '%s'",
521 523 fmt[0], tag, vaidx, type_to_str(type));
522 524 }
523 525
524 526 static void time_and_date(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
525 527 {
526 528 assert(tolower(fmt[0]) == 't');
527 529
528 530 if (fmt[1] == 'R' && !is_struct_tag(basetype, "rtc_time"))
529 531 sm_error("'%%ptR' expects argument of type struct 'rtc_time', argument %d has type '%s'",
530 532 vaidx, type_to_str(type));
531 533 }
532 534
533 535 static void check_clock(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
534 536 {
535 537 assert(fmt[0] == 'C');
536 538 if (isalnum(fmt[1])) {
537 539 if (!strchr("nr", fmt[1]))
538 540 sm_warning("'%%pC' can only be followed by one of [nr]");
539 541 if (isalnum(fmt[2]))
540 542 sm_warning("'%%pC%c' cannot be followed by '%c'", fmt[1], fmt[2]);
541 543 }
542 544 if (!is_struct_tag(basetype, "clk"))
543 545 sm_error("'%%pC' expects argument of type 'struct clk*', argument %d has type '%s'",
544 546 vaidx, type_to_str(type));
545 547 }
546 548
547 549 static void va_format(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
548 550 {
549 551 assert(fmt[0] == 'V');
550 552 if (isalnum(fmt[1]))
551 553 sm_warning("%%pV cannot be followed by any alphanumerics");
552 554 if (!is_struct_tag(basetype, "va_format"))
553 555 sm_error("%%pV expects argument of type struct va_format*, argument %d has type '%s'", vaidx, type_to_str(type));
554 556 }
555 557
556 558 static void netdev_feature(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
557 559 {
558 560 static struct typedef_lookup netdev = { .name = "netdev_features_t" };
559 561
560 562 assert(fmt[0] == 'N');
561 563 if (fmt[1] != 'F') {
562 564 sm_error("%%pN must be followed by 'F'");
563 565 return;
564 566 }
565 567 if (isalnum(fmt[2]))
566 568 sm_warning("%%pNF cannot be followed by '%c'", fmt[2]);
567 569
568 570 typedef_lookup(&netdev);
569 571 if (!netdev.sym)
570 572 return;
571 573 if (basetype != netdev.sym)
572 574 sm_error("%%pNF expects argument of type netdev_features_t*, argument %d has type '%s'",
573 575 vaidx, type_to_str(type));
574 576
575 577 }
576 578 static void address_val(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
577 579 {
578 580 static struct typedef_lookup dma = { .name = "dma_addr_t" };
579 581 static struct typedef_lookup phys = { .name = "phys_addr_t" };
580 582 struct typedef_lookup *which = &phys;
581 583 const char *suf = "";
582 584 assert(fmt[0] == 'a');
583 585
584 586 if (isalnum(fmt[1])) {
585 587 switch (fmt[1]) {
586 588 case 'd':
587 589 which = &dma;
588 590 suf = "d";
589 591 break;
590 592 case 'p':
591 593 suf = "p";
592 594 break;
593 595 default:
594 596 sm_error("'%%pa' can only be followed by one of [dp]");
595 597 }
596 598 if (isalnum(fmt[2]))
597 599 sm_error("'%%pa%c' cannot be followed by '%c'", fmt[1], fmt[2]);
598 600 }
599 601
600 602 typedef_lookup(which);
601 603 if (!which->sym)
602 604 return;
603 605 if (basetype != which->sym) {
604 606 sm_error("'%%pa%s' expects argument of type '%s*', argument %d has type '%s'",
605 607 suf, which->name, vaidx, type_to_str(type));
606 608 }
607 609 }
608 610
609 611 static void block_device(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
610 612 {
611 613 const char *tag = "block_device";
612 614
613 615 assert(fmt[0] == 'g');
614 616 if (isalnum(fmt[1])) {
615 617 sm_warning("%%pg cannot be followed by '%c'", fmt[1]);
616 618 }
617 619 if (!is_struct_tag(basetype, tag))
618 620 sm_error("'%%p%c' expects argument of type struct '%s*', argument %d has type '%s'",
619 621 fmt[0], tag, vaidx, type_to_str(type));
620 622 }
621 623
622 624 static void flag_string(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
623 625 {
624 626 static struct typedef_lookup gfp = { .name = "gfp_t" };
625 627
626 628 assert(fmt[0] == 'G');
627 629 if (!isalnum(fmt[1])) {
628 630 sm_error("%%pG must be followed by one of [gpv]");
629 631 return;
630 632 }
631 633 switch (fmt[1]) {
632 634 case 'p':
633 635 case 'v':
634 636 if (basetype != &ulong_ctype)
635 637 sm_error("'%%pG%c' expects argument of type 'unsigned long *', argument %d has type '%s'",
636 638 fmt[1], vaidx, type_to_str(type));
637 639 break;
638 640 case 'g':
639 641 typedef_lookup(&gfp);
640 642 if (basetype != gfp.sym)
641 643 sm_error("'%%pGg' expects argument of type 'gfp_t *', argument %d has type '%s'",
642 644 vaidx, type_to_str(type));
643 645 break;
644 646 default:
645 647 sm_error("'%%pG' must be followed by one of [gpv]");
646 648 }
647 649 }
648 650
649 651 static void device_node_string(const char *fmt, struct symbol *type, struct symbol *basetype, int vaidx)
650 652 {
651 653 if (fmt[1] != 'F') {
652 654 sm_error("%%pO can only be followed by 'F'");
653 655 return;
654 656 }
655 657 if (!is_struct_tag(basetype, "device_node"))
656 658 sm_error("'%%pOF' expects argument of type 'struct device_node*', argument %d has type '%s'",
657 659 vaidx, type_to_str(type));
658 660 }
659 661
660 662 static void
661 663 pointer(const char *fmt, struct expression *arg, int vaidx)
662 664 {
663 665 struct symbol *type, *basetype;
664 666
↓ open down ↓ |
444 lines elided |
↑ open up ↑ |
665 667 type = get_type(arg);
666 668 if (!type) {
667 669 sm_warning("could not determine type of argument %d", vaidx);
668 670 return;
669 671 }
670 672 if (!is_ptr_type(type)) {
671 673 sm_error("%%p expects pointer argument, but argument %d has type '%s'",
672 674 vaidx, type_to_str(type));
673 675 return;
674 676 }
677 +
678 + /* error pointers */
679 + if (*fmt == 'e')
680 + fmt++;
681 +
682 +
675 683 /* Just plain %p, nothing to check. */
676 684 if (!isalnum(*fmt))
677 685 return;
678 686
679 687 basetype = get_real_base_type(type);
680 688 if (is_void_type(basetype))
681 689 return;
682 690 /*
683 691 * Passing a pointer-to-array is harmless, but most likely one
684 692 * meant to pass pointer-to-first-element. If basetype is
685 693 * array type, we issue a notice and "dereference" the types
686 694 * once more.
687 695 */
688 696 if (basetype->type == SYM_ARRAY) {
689 697 spam("note: passing pointer-to-array; is the address-of redundant?");
690 698 type = basetype;
691 699 basetype = get_real_base_type(type);
692 700 }
693 701
694 702 /*
695 703 * We pass both the type and the basetype to the helpers. If,
696 704 * for example, the pointer is really a decayed array which is
697 705 * passed to %pI4, we might want to check that it is in fact
698 706 * an array of four bytes. But most are probably only
699 707 * interested in whether the basetype makes sense. Also, the
700 708 * pointer may carry some annotation such as __user which
701 709 * might be worth checking in the handlers which actually
702 710 * dereference the pointer.
703 711 */
704 712
705 713 switch (*fmt) {
706 714 case 'b':
707 715 case 'F':
708 716 case 'f':
709 717 case 'S':
710 718 case 's':
711 719 case 'B':
712 720 /* Can we do anything sensible? Check that the arg is a function pointer, for example? */
713 721 break;
714 722
715 723 case 'R':
716 724 case 'r':
717 725 resource_string(fmt, type, basetype, vaidx);
718 726 break;
719 727 case 'M':
720 728 case 'm':
721 729 mac_address_string(fmt, type, basetype, vaidx);
722 730 break;
723 731 case 'I':
724 732 case 'i':
725 733 switch (fmt[1]) {
726 734 case '4':
727 735 ip4(fmt, type, basetype, vaidx);
728 736 break;
729 737 case '6':
730 738 ip6(fmt, type, basetype, vaidx);
731 739 break;
732 740 case 'S':
733 741 ipS(fmt, type, basetype, vaidx);
734 742 break;
735 743 default:
736 744 sm_warning("'%%p%c' must be followed by one of [46S]", fmt[0]);
737 745 break;
738 746 }
739 747 break;
740 748 /*
741 749 * %pE and %ph can handle any valid pointer. We still check
742 750 * whether all the subsequent alphanumerics are valid for the
743 751 * particular %pX conversion.
744 752 */
745 753 case 'E':
746 754 escaped_string(fmt, type, basetype, vaidx);
747 755 break;
748 756 case 'h':
749 757 hex_string(fmt, type, basetype, vaidx);
750 758 break;
751 759 case 'U': /* TODO */
752 760 break;
753 761 case 'V':
754 762 va_format(fmt, type, basetype, vaidx);
755 763 break;
756 764 case 'K': /* TODO */
757 765 break;
758 766 case 'N':
759 767 netdev_feature(fmt, type, basetype, vaidx);
760 768 break;
761 769 case 'a':
762 770 address_val(fmt, type, basetype, vaidx);
763 771 break;
764 772 case 'D':
765 773 case 'd':
766 774 dentry_file(fmt, type, basetype, vaidx);
767 775 break;
768 776 case 't':
769 777 time_and_date(fmt, type, basetype, vaidx);
770 778 break;
771 779 case 'C':
772 780 check_clock(fmt, type, basetype, vaidx);
773 781 break;
774 782 case 'g':
775 783 block_device(fmt, type, basetype, vaidx);
776 784 break;
777 785 case 'G':
778 786 flag_string(fmt, type, basetype, vaidx);
779 787 break;
780 788 case 'O':
781 789 device_node_string(fmt, type, basetype, vaidx);
782 790 break;
783 791 case 'x':
784 792 /* 'x' is for an unhashed pointer */
785 793 break;
786 794 default:
787 795 sm_error("unrecognized %%p extension '%c', treated as normal %%p", *fmt);
788 796 }
789 797 }
790 798
791 799 /*
792 800 * A common error is to pass a "char" or "signed char" to %02x (or
793 801 * %.2X or some other variant). This can actually be a security
794 802 * problem, because a lot of code expects this to produce exactly two
795 803 * characters of output. Unfortunately this also produces false
796 804 * positives, since we're sometimes in arch-specific code on an arch
797 805 * where char is always unsigned.
798 806 */
799 807 static void
800 808 hexbyte(const char *fmt, int fmt_len, struct expression *arg, int vaidx, struct printf_spec spec)
801 809 {
802 810 struct symbol *type;
803 811
804 812 /*
805 813 * For now, just check the most common and obvious, which is
806 814 * roughly %[.0]2[xX].
807 815 */
808 816 if (spec.field_width != 2 && spec.precision != 2)
809 817 return;
810 818 if (spec.base != 16)
811 819 return;
812 820
813 821 type = get_type(arg);
814 822 if (!type) {
815 823 sm_warning("could not determine type of argument %d", vaidx);
816 824 return;
817 825 }
818 826 if (type == &char_ctype || type == &schar_ctype)
819 827 sm_warning("argument %d to %.*s specifier has type '%s'",
820 828 vaidx, fmt_len, fmt, type_to_str(type));
821 829 }
822 830
823 831 static int
824 832 check_format_string(const char *fmt, const char *caller)
825 833 {
826 834 const char *f;
827 835
828 836 for (f = fmt; *f; ++f) {
829 837 unsigned char c = *f;
830 838 switch (c) {
831 839 case KERN_SOH_ASCII:
832 840 /*
833 841 * This typically arises from bad conversion
834 842 * to pr_*, e.g. pr_warn(KERN_WARNING "something").
835 843 */
836 844 if (f != fmt)
837 845 sm_warning("KERN_* level not at start of string");
838 846 /*
839 847 * In a very few cases, the level is actually
840 848 * computed and passed via %c, as in KERN_SOH
841 849 * "%c...". printk explicitly supports
842 850 * this.
843 851 */
844 852 if (!(('0' <= f[1] && f[1] <= '7') ||
845 853 f[1] == 'd' || /* KERN_DEFAULT */
846 854 f[1] == 'c' || /* KERN_CONT */
847 855 (f[1] == '%' && f[2] == 'c')))
848 856 sm_warning("invalid KERN_* level: KERN_SOH_ASCII followed by '\\x%02x'", (unsigned char)f[1]);
849 857 break;
850 858 case '\t':
851 859 case '\n':
852 860 case '\r':
853 861 case 0x20 ... 0x7e:
854 862 break;
855 863 case 0x80 ... 0xff:
856 864 sm_warning("format string contains non-ascii character '\\x%02x'", c);
857 865 break;
858 866 case 0x08:
859 867 if (f == fmt)
860 868 break;
861 869 /* fall through */
862 870 default:
863 871 sm_warning("format string contains unusual character '\\x%02x'", c);
864 872 break;
865 873 }
866 874 }
867 875
868 876 f = strstr(fmt, caller);
869 877 if (f && strstr(f+1, caller))
870 878 sm_warning("format string contains name of enclosing function '%s' twice", caller);
871 879
872 880 return f != NULL;
873 881 }
874 882
875 883 static int arg_is___func__(struct expression *arg)
876 884 {
877 885 if (arg->type != EXPR_SYMBOL)
878 886 return 0;
879 887 return !strcmp(arg->symbol_name->name, "__func__") ||
880 888 !strcmp(arg->symbol_name->name, "__FUNCTION__") ||
881 889 !strcmp(arg->symbol_name->name, "__PRETTY_FUNCTION__");
882 890 }
883 891 static int arg_contains_caller(struct expression *arg, const char *caller)
884 892 {
885 893 if (arg->type != EXPR_STRING)
886 894 return 0;
887 895 return strstr(arg->string->data, caller) != NULL;
888 896 }
889 897
890 898 static int is_array_of_const_char(struct symbol *sym)
891 899 {
892 900 struct symbol *base = sym->ctype.base_type;
893 901 if (base->type != SYM_ARRAY)
894 902 return 0;
895 903 if (!(base->ctype.modifiers & MOD_CONST))
896 904 return 0;
897 905 if (!is_char_type(base->ctype.base_type)) {
898 906 spam("weird: format argument is array of const '%s'", type_to_str(base->ctype.base_type));
899 907 return 0;
900 908 }
901 909 return 1;
902 910 }
903 911
904 912 static int is_const_pointer_to_const_char(struct symbol *sym)
905 913 {
906 914 struct symbol *base = sym->ctype.base_type;
907 915 if (!(sym->ctype.modifiers & MOD_CONST))
908 916 return 0;
909 917 if (base->type != SYM_PTR)
910 918 return 0;
911 919 if (!(base->ctype.modifiers & MOD_CONST))
912 920 return 0;
913 921 if (!is_char_type(base->ctype.base_type)) {
914 922 spam("weird: format argument is pointer to const '%s'", type_to_str(base->ctype.base_type));
915 923 return 0;
916 924 }
917 925 return 1;
918 926 }
919 927
920 928 static int unknown_format(struct expression *expr)
921 929 {
922 930 struct state_list *slist;
923 931
924 932 slist = get_strings(expr);
925 933 if (!slist)
926 934 return 1;
927 935 if (slist_has_state(slist, &undefined))
928 936 return 1;
929 937 free_slist(&slist);
930 938 return 0;
931 939 }
932 940
933 941 static bool has_hex_prefix(const char *orig_fmt, const char *old_fmt)
934 942 {
935 943 return old_fmt >= orig_fmt + 2 &&
936 944 old_fmt[-2] == '0' && _tolower(old_fmt[-1]) == 'x';
937 945 }
938 946
939 947 static bool is_integer_specifier(int type)
940 948 {
941 949 switch (type) {
942 950 case FORMAT_TYPE_LONG_LONG:
943 951 case FORMAT_TYPE_ULONG:
944 952 case FORMAT_TYPE_LONG:
945 953 case FORMAT_TYPE_UBYTE:
946 954 case FORMAT_TYPE_BYTE:
947 955 case FORMAT_TYPE_USHORT:
948 956 case FORMAT_TYPE_SHORT:
949 957 case FORMAT_TYPE_UINT:
950 958 case FORMAT_TYPE_INT:
951 959 case FORMAT_TYPE_SIZE_T:
952 960 case FORMAT_TYPE_PTRDIFF:
953 961 return true;
954 962 default:
955 963 return false;
956 964 }
957 965 }
958 966
959 967 static int
960 968 is_cast_expr(struct expression *expr)
961 969 {
962 970 if (!expr)
963 971 return 0;
964 972
965 973 switch (expr->type) {
966 974 case EXPR_CAST:
967 975 case EXPR_FORCE_CAST:
968 976 /* not EXPR_IMPLIED_CAST for our purposes */
969 977 return 1;
970 978 default:
971 979 return 0;
972 980 }
973 981 }
974 982
975 983 static void
976 984 check_cast_from_pointer(const char *fmt, int len, struct expression *arg, int va_idx)
977 985 {
978 986 /*
979 987 * This can easily be fooled by passing 0+(long)ptr or doing
980 988 * "long local_var = (long)ptr" and passing local_var to
981 989 * %lx. Tough.
982 990 */
983 991 if (!is_cast_expr(arg))
984 992 return;
985 993 while (is_cast_expr(arg))
986 994 arg = arg->cast_expression;
987 995 if (is_ptr_type(get_final_type(arg)))
988 996 sm_warning("argument %d to %.*s specifier is cast from pointer",
989 997 va_idx, len, fmt);
990 998 }
991 999
992 1000 static void
993 1001 do_check_printf_call(const char *caller, const char *name, struct expression *callexpr, struct expression *fmtexpr, int vaidx)
994 1002 {
995 1003 struct printf_spec spec = {0};
996 1004 const char *fmt, *orig_fmt;
997 1005 int caller_in_fmt;
998 1006
999 1007 fmtexpr = strip_parens(fmtexpr);
1000 1008 if (fmtexpr->type == EXPR_CONDITIONAL) {
1001 1009 do_check_printf_call(caller, name, callexpr, fmtexpr->cond_true ? : fmtexpr->conditional, vaidx);
1002 1010 do_check_printf_call(caller, name, callexpr, fmtexpr->cond_false, vaidx);
1003 1011 return;
1004 1012 }
1005 1013 if (fmtexpr->type == EXPR_SYMBOL) {
1006 1014 /*
1007 1015 * If the symbol has an initializer, we can handle
1008 1016 *
1009 1017 * const char foo[] = "abc"; and
1010 1018 * const char * const foo = "abc";
1011 1019 *
1012 1020 * We simply replace fmtexpr with the initializer
1013 1021 * expression. If foo is not one of the above, or if
1014 1022 * the initializer expression is somehow not a string
1015 1023 * literal, fmtexpr->type != EXPR_STRING will trigger
1016 1024 * below and we'll spam+return.
1017 1025 */
1018 1026 struct symbol *sym = fmtexpr->symbol;
1019 1027 if (sym && sym->initializer &&
1020 1028 (is_array_of_const_char(sym) ||
1021 1029 is_const_pointer_to_const_char(sym))) {
1022 1030 fmtexpr = strip_parens(sym->initializer);
1023 1031 }
1024 1032 }
1025 1033
1026 1034 if (fmtexpr->type != EXPR_STRING) {
1027 1035 if (!unknown_format(fmtexpr))
1028 1036 return;
1029 1037 /*
1030 1038 * Since we're now handling both ?: and static const
1031 1039 * char[] arguments, we don't get as much noise. It's
1032 1040 * still spammy, though.
1033 1041 */
1034 1042 spam("warn: call of '%s' with non-constant format argument", name);
1035 1043 return;
1036 1044 }
1037 1045
1038 1046 orig_fmt = fmt = fmtexpr->string->data;
1039 1047 caller_in_fmt = check_format_string(fmt, caller);
1040 1048
1041 1049 while (*fmt) {
1042 1050 const char *old_fmt = fmt;
1043 1051 int read = format_decode(fmt, &spec);
1044 1052 struct expression *arg;
1045 1053
1046 1054 fmt += read;
1047 1055 if (spec.type == FORMAT_TYPE_NONE ||
1048 1056 spec.type == FORMAT_TYPE_PERCENT_CHAR)
1049 1057 continue;
1050 1058
1051 1059 /*
1052 1060 * vaidx is currently the correct 0-based index for
1053 1061 * get_argument_from_call_expr. We post-increment it
1054 1062 * here so that it is the correct 1-based index for
1055 1063 * all the handlers below. This of course requires
1056 1064 * that we handle all FORMAT_TYPE_* things not taking
1057 1065 * an argument above.
1058 1066 */
1059 1067 arg = get_argument_from_call_expr(callexpr->args, vaidx++);
1060 1068
1061 1069 if (spec.flags & SPECIAL && has_hex_prefix(orig_fmt, old_fmt))
1062 1070 sm_warning("'%.2s' prefix is redundant when # flag is used", old_fmt-2);
1063 1071 if (is_integer_specifier(spec.type)) {
1064 1072 if (spec.base != 16 && has_hex_prefix(orig_fmt, old_fmt))
1065 1073 sm_warning("'%.2s' prefix is confusing together with '%.*s' specifier",
1066 1074 old_fmt-2, (int)(fmt-old_fmt), old_fmt);
1067 1075
1068 1076 check_cast_from_pointer(old_fmt, read, arg, vaidx);
1069 1077 }
1070 1078
1071 1079 switch (spec.type) {
1072 1080 /* case FORMAT_TYPE_NONE: */
1073 1081 /* case FORMAT_TYPE_PERCENT_CHAR: */
1074 1082 /* break; */
1075 1083
1076 1084 case FORMAT_TYPE_INVALID:
1077 1085 sm_error("format specifier '%.*s' invalid", read, old_fmt);
1078 1086 return;
1079 1087
1080 1088 case FORMAT_TYPE_FLOAT:
1081 1089 sm_error("no floats in the kernel; invalid format specifier '%.*s'", read, old_fmt);
1082 1090 return;
1083 1091
1084 1092 case FORMAT_TYPE_NRCHARS:
1085 1093 sm_error("%%n not supported in kernel");
1086 1094 return;
1087 1095
1088 1096 case FORMAT_TYPE_WIDTH:
1089 1097 case FORMAT_TYPE_PRECISION:
1090 1098 /* check int argument */
1091 1099 break;
1092 1100
1093 1101 case FORMAT_TYPE_STR:
1094 1102 /*
1095 1103 * If the format string already contains the
1096 1104 * function name, it probably doesn't make
1097 1105 * sense to pass __func__ as well (or rather
1098 1106 * vice versa: If pr_fmt(fmt) has been defined
1099 1107 * to '"%s: " fmt, __func__', it doesn't make
1100 1108 * sense to use a format string containing the
1101 1109 * function name).
1102 1110 *
1103 1111 * This produces a lot of hits. They are not
1104 1112 * false positives, but it is easier to handle
1105 1113 * the things which don't occur that often
1106 1114 * first, so we use spam().
1107 1115 */
1108 1116 if (caller_in_fmt) {
1109 1117 if (arg_is___func__(arg))
1110 1118 spam("warn: passing __func__ while the format string already contains the name of the function '%s'",
1111 1119 caller);
1112 1120 else if (arg_contains_caller(arg, caller))
1113 1121 sm_warning("passing string constant '%s' containing '%s' which is already part of the format string",
1114 1122 arg->string->data, caller);
1115 1123 }
1116 1124 break;
1117 1125
1118 1126 case FORMAT_TYPE_PTR:
1119 1127 /* This is the most important part: Checking %p extensions. */
1120 1128 pointer(fmt, arg, vaidx);
1121 1129 while (isalnum(*fmt))
1122 1130 fmt++;
1123 1131 break;
1124 1132
1125 1133 case FORMAT_TYPE_CHAR:
1126 1134
1127 1135 case FORMAT_TYPE_UBYTE:
1128 1136 case FORMAT_TYPE_BYTE:
1129 1137 case FORMAT_TYPE_USHORT:
1130 1138 case FORMAT_TYPE_SHORT:
1131 1139 case FORMAT_TYPE_INT:
1132 1140 /* argument should have integer type of width <= sizeof(int) */
1133 1141 break;
1134 1142
1135 1143 case FORMAT_TYPE_UINT:
1136 1144 hexbyte(old_fmt, fmt-old_fmt, arg, vaidx, spec);
1137 1145 case FORMAT_TYPE_LONG:
1138 1146 case FORMAT_TYPE_ULONG:
1139 1147 case FORMAT_TYPE_LONG_LONG:
1140 1148 case FORMAT_TYPE_PTRDIFF:
1141 1149 case FORMAT_TYPE_SIZE_T:
1142 1150 break;
1143 1151 }
1144 1152
1145 1153
1146 1154 }
1147 1155
1148 1156 if (get_argument_from_call_expr(callexpr->args, vaidx))
1149 1157 sm_warning("excess argument passed to '%s'", name);
1150 1158
1151 1159
1152 1160 }
1153 1161
1154 1162 static void
1155 1163 check_printf_call(const char *name, struct expression *callexpr, void *_info)
1156 1164 {
1157 1165 /*
1158 1166 * Note: attribute(printf) uses 1-based indexing, but
1159 1167 * get_argument_from_call_expr() uses 0-based indexing.
1160 1168 */
1161 1169 int info = PTR_INT(_info);
1162 1170 int fmtidx = (info & 0xff) - 1;
1163 1171 int vaidx = ((info >> 8) & 0xff) - 1;
1164 1172 struct expression *fmtexpr;
1165 1173 const char *caller = get_function();
1166 1174
1167 1175 if (!caller)
1168 1176 return;
1169 1177
1170 1178 /*
1171 1179 * Calling a v*printf function with a literal format arg is
1172 1180 * extremely rare, so we don't bother doing the only checking
1173 1181 * we could do, namely checking that the format string is
1174 1182 * valid.
1175 1183 */
1176 1184 if (vaidx < 0)
1177 1185 return;
1178 1186
1179 1187 /*
1180 1188 * For the things we use the name of the calling function for,
1181 1189 * it is more appropriate to skip a potential SyS_ prefix; the
1182 1190 * same goes for leading underscores.
1183 1191 */
1184 1192 if (!strncmp(caller, "SyS_", 4))
1185 1193 caller += 4;
1186 1194 while (*caller == '_')
1187 1195 ++caller;
1188 1196
1189 1197 /* Lack of format argument is a bug. */
1190 1198 fmtexpr = get_argument_from_call_expr(callexpr->args, fmtidx);
1191 1199 if (!fmtexpr) {
1192 1200 sm_error("call of '%s' with no format argument", name);
1193 1201 return;
1194 1202 }
1195 1203
1196 1204 do_check_printf_call(caller, name, callexpr, fmtexpr, vaidx);
1197 1205 }
1198 1206
1199 1207
1200 1208 void check_kernel_printf(int id)
1201 1209 {
1202 1210 if (option_project != PROJ_KERNEL)
1203 1211 return;
1204 1212
1205 1213 my_id = id;
1206 1214
1207 1215 #define printf_hook(func, fmt, first_to_check) \
1208 1216 add_function_hook(#func, check_printf_call, INT_PTR(fmt + (first_to_check << 8)))
1209 1217
1210 1218 /* Extracted using stupid perl script. */
1211 1219
1212 1220 #if 0
1213 1221 printf_hook(srm_printk, 1, 2); /* arch/alpha/include/asm/console.h */
1214 1222 printf_hook(die_if_kernel, 1, 2); /* arch/frv/include/asm/bug.h */
1215 1223 printf_hook(ia64_mca_printk, 1, 2); /* arch/ia64/include/asm/mca.h */
1216 1224 printf_hook(nfprint, 1, 2); /* arch/m68k/include/asm/natfeat.h */
1217 1225 printf_hook(gdbstub_printk, 1, 2); /* arch/mn10300/include/asm/gdb-stub.h */
1218 1226 printf_hook(DBG, 1, 2); /* arch/powerpc/boot/ps3.c */
1219 1227 printf_hook(printf, 1, 2); /* arch/powerpc/boot/stdio.h */
1220 1228 printf_hook(udbg_printf, 1, 2); /* arch/powerpc/include/asm/udbg.h */
1221 1229 printf_hook(__debug_sprintf_event, 3, 4); /* arch/s390/include/asm/debug.h */
1222 1230 printf_hook(__debug_sprintf_exception, 3, 4); /* arch/s390/include/asm/debug.h */
1223 1231 printf_hook(prom_printf, 1, 2); /* arch/sparc/include/asm/oplib_32.h */
1224 1232
1225 1233 printf_hook(fail, 1, 2); /* arch/x86/vdso/vdso2c.c */
1226 1234 #endif
1227 1235
1228 1236 printf_hook(_ldm_printk, 3, 4); /* block/partitions/ldm.c */
1229 1237 printf_hook(rbd_warn, 2, 3); /* drivers/block/rbd.c */
1230 1238 printf_hook(fw_err, 2, 3); /* drivers/firewire/core.h */
1231 1239 printf_hook(fw_notice, 2, 3); /* drivers/firewire/core.h */
1232 1240 printf_hook(i915_error_printf, 2, 3); /* drivers/gpu/drm/i915/i915_drv.h */
1233 1241 printf_hook(i915_handle_error, 3, 4); /* drivers/gpu/drm/i915/i915_drv.h */
1234 1242 printf_hook(nv_printk_, 3, 4); /* drivers/gpu/drm/nouveau/core/include/core/printk.h */
1235 1243 printf_hook(host1x_debug_output, 2, 3); /* drivers/gpu/host1x/debug.h */
1236 1244 printf_hook(callc_debug, 2, 3); /* drivers/isdn/hisax/callc.c */
1237 1245 printf_hook(link_debug, 3, 4); /* drivers/isdn/hisax/callc.c */
1238 1246 printf_hook(HiSax_putstatus, 3, 4); /* drivers/isdn/hisax/hisax.h */
1239 1247 printf_hook(VHiSax_putstatus, 3, 0); /* drivers/isdn/hisax/hisax.h */
1240 1248 printf_hook(debugl1, 2, 3); /* drivers/isdn/hisax/isdnl1.h */
1241 1249 printf_hook(l3m_debug, 2, 3); /* drivers/isdn/hisax/isdnl3.c */
1242 1250 printf_hook(dout_debug, 2, 3); /* drivers/isdn/hisax/st5481_d.c */
1243 1251 printf_hook(l1m_debug, 2, 3); /* drivers/isdn/hisax/st5481_d.c */
1244 1252 printf_hook(bch_cache_set_error, 2, 3); /* drivers/md/bcache/bcache.h */
1245 1253 printf_hook(_tda_printk, 4, 5); /* drivers/media/tuners/tda18271-priv.h */
1246 1254 printf_hook(i40evf_debug_d, 3, 4); /* drivers/net/ethernet/intel/i40evf/i40e_osdep.h */
1247 1255 printf_hook(en_print, 3, 4); /* drivers/net/ethernet/mellanox/mlx4/mlx4_en.h */
1248 1256 printf_hook(_ath_dbg, 3, 4); /* drivers/net/wireless/ath/ath.h */
1249 1257 printf_hook(ath_printk, 3, 4); /* drivers/net/wireless/ath/ath.h */
1250 1258 printf_hook(ath10k_dbg, 3, 4); /* drivers/net/wireless/ath/ath10k/debug.h */
1251 1259 printf_hook(ath10k_err, 2, 3); /* drivers/net/wireless/ath/ath10k/debug.h */
1252 1260 printf_hook(ath10k_info, 2, 3); /* drivers/net/wireless/ath/ath10k/debug.h */
1253 1261 printf_hook(ath10k_warn, 2, 3); /* drivers/net/wireless/ath/ath10k/debug.h */
1254 1262 printf_hook(_ath5k_printk, 3, 4); /* drivers/net/wireless/ath/ath5k/ath5k.h */
1255 1263 printf_hook(ATH5K_DBG, 3, 4); /* drivers/net/wireless/ath/ath5k/debug.h */
1256 1264 printf_hook(ATH5K_DBG_UNLIMIT, 3, 4); /* drivers/net/wireless/ath/ath5k/debug.h */
1257 1265 printf_hook(ath6kl_printk, 2, 3); /* drivers/net/wireless/ath/ath6kl/common.h */
1258 1266 printf_hook(ath6kl_err, 1, 2); /* drivers/net/wireless/ath/ath6kl/debug.h */
1259 1267 printf_hook(ath6kl_info, 1, 2); /* drivers/net/wireless/ath/ath6kl/debug.h */
1260 1268 printf_hook(ath6kl_warn, 1, 2); /* drivers/net/wireless/ath/ath6kl/debug.h */
1261 1269 printf_hook(wil_dbg_trace, 2, 3); /* drivers/net/wireless/ath/wil6210/wil6210.h */
1262 1270 printf_hook(wil_err, 2, 3); /* drivers/net/wireless/ath/wil6210/wil6210.h */
1263 1271 printf_hook(wil_err_ratelimited, 2, 3); /* drivers/net/wireless/ath/wil6210/wil6210.h */
1264 1272 printf_hook(wil_info, 2, 3); /* drivers/net/wireless/ath/wil6210/wil6210.h */
1265 1273 printf_hook(b43dbg, 2, 3); /* drivers/net/wireless/b43/b43.h */
1266 1274 printf_hook(b43err, 2, 3); /* drivers/net/wireless/b43/b43.h */
1267 1275 printf_hook(b43info, 2, 3); /* drivers/net/wireless/b43/b43.h */
1268 1276 printf_hook(b43warn, 2, 3); /* drivers/net/wireless/b43/b43.h */
1269 1277 printf_hook(b43legacydbg, 2, 3); /* drivers/net/wireless/b43legacy/b43legacy.h */
1270 1278 printf_hook(b43legacyerr, 2, 3); /* drivers/net/wireless/b43legacy/b43legacy.h */
1271 1279 printf_hook(b43legacyinfo, 2, 3); /* drivers/net/wireless/b43legacy/b43legacy.h */
1272 1280 printf_hook(b43legacywarn, 2, 3); /* drivers/net/wireless/b43legacy/b43legacy.h */
1273 1281 printf_hook(__brcmf_dbg, 3, 4); /* drivers/net/wireless/brcm80211/brcmfmac/debug.h */
1274 1282 printf_hook(__brcmf_err, 2, 3); /* drivers/net/wireless/brcm80211/brcmfmac/debug.h */
1275 1283 printf_hook(__brcms_crit, 2, 3); /* drivers/net/wireless/brcm80211/brcmsmac/debug.h */
1276 1284 printf_hook(__brcms_dbg, 4, 5); /* drivers/net/wireless/brcm80211/brcmsmac/debug.h */
1277 1285 printf_hook(__brcms_err, 2, 3); /* drivers/net/wireless/brcm80211/brcmsmac/debug.h */
1278 1286 printf_hook(__brcms_info, 2, 3); /* drivers/net/wireless/brcm80211/brcmsmac/debug.h */
1279 1287 printf_hook(__brcms_warn, 2, 3); /* drivers/net/wireless/brcm80211/brcmsmac/debug.h */
1280 1288 printf_hook(brcmu_dbg_hex_dump, 3, 4); /* drivers/net/wireless/brcm80211/include/brcmu_utils.h */
1281 1289 printf_hook(__iwl_crit, 2, 3); /* drivers/net/wireless/iwlwifi/iwl-debug.h */
1282 1290 printf_hook(__iwl_dbg, 5, 6); /* drivers/net/wireless/iwlwifi/iwl-debug.h */
1283 1291 printf_hook(__iwl_err, 4, 5); /* drivers/net/wireless/iwlwifi/iwl-debug.h */
1284 1292 printf_hook(__iwl_info, 2, 3); /* drivers/net/wireless/iwlwifi/iwl-debug.h */
1285 1293 printf_hook(__iwl_warn, 2, 3); /* drivers/net/wireless/iwlwifi/iwl-debug.h */
1286 1294 printf_hook(rsi_dbg, 2, 3); /* drivers/net/wireless/rsi/rsi_main.h */
1287 1295 printf_hook(RTPRINT, 4, 5); /* drivers/net/wireless/rtlwifi/debug.h */
1288 1296 printf_hook(RT_ASSERT, 2, 3); /* drivers/net/wireless/rtlwifi/debug.h */
1289 1297 printf_hook(RT_TRACE, 4, 5); /* drivers/net/wireless/rtlwifi/debug.h */
1290 1298 printf_hook(__of_node_dup, 2, 3); /* drivers/of/of_private.h */
1291 1299 printf_hook(BNX2FC_HBA_DBG, 2, 3); /* drivers/scsi/bnx2fc/bnx2fc_debug.h */
1292 1300 printf_hook(BNX2FC_IO_DBG, 2, 3); /* drivers/scsi/bnx2fc/bnx2fc_debug.h */
1293 1301 printf_hook(BNX2FC_TGT_DBG, 2, 3); /* drivers/scsi/bnx2fc/bnx2fc_debug.h */
1294 1302 printf_hook(ql_dbg, 4, 5); /* drivers/scsi/qla2xxx/qla_dbg.h */
1295 1303 printf_hook(ql_dbg_pci, 4, 5); /* drivers/scsi/qla2xxx/qla_dbg.h */
1296 1304 printf_hook(ql_log, 4, 5); /* drivers/scsi/qla2xxx/qla_dbg.h */
1297 1305 printf_hook(ql_log_pci, 4, 5); /* drivers/scsi/qla2xxx/qla_dbg.h */
1298 1306 printf_hook(libcfs_debug_msg, 2, 3); /* drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h */
1299 1307 printf_hook(libcfs_debug_vmsg2, 4, 5); /* drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h */
1300 1308 printf_hook(_ldlm_lock_debug, 3, 4); /* drivers/staging/lustre/lustre/include/lustre_dlm.h */
1301 1309 printf_hook(_debug_req, 3, 4); /* drivers/staging/lustre/lustre/include/lustre_net.h */
1302 1310 printf_hook(iscsi_change_param_sprintf, 2, 3); /* drivers/target/iscsi/iscsi_target_login.c */
1303 1311 printf_hook(dbg, 1, 2); /* drivers/tty/serial/samsung.c */
1304 1312 printf_hook(_usb_stor_dbg, 2, 3); /* drivers/usb/storage/debug.h */
1305 1313 printf_hook(usb_stor_dbg, 2, 3); /* drivers/usb/storage/debug.h */
1306 1314 printf_hook(vringh_bad, 1, 2); /* drivers/vhost/vringh.c */
1307 1315 printf_hook(__adfs_error, 3, 4); /* fs/adfs/adfs.h */
1308 1316 printf_hook(affs_error, 3, 4); /* fs/affs/affs.h */
1309 1317 printf_hook(affs_warning, 3, 4); /* fs/affs/affs.h */
1310 1318 printf_hook(befs_debug, 2, 3); /* fs/befs/befs.h */
1311 1319 printf_hook(befs_error, 2, 3); /* fs/befs/befs.h */
1312 1320 printf_hook(befs_warning, 2, 3); /* fs/befs/befs.h */
1313 1321 printf_hook(__btrfs_panic, 5, 6); /* fs/btrfs/ctree.h */
1314 1322 printf_hook(__btrfs_std_error, 5, 6); /* fs/btrfs/ctree.h */
1315 1323 printf_hook(btrfs_printk, 2, 3); /* fs/btrfs/ctree.h */
1316 1324 printf_hook(cifs_vfs_err, 1, 2); /* fs/cifs/cifs_debug.h */
1317 1325 printf_hook(__ecryptfs_printk, 1, 2); /* fs/ecryptfs/ecryptfs_kernel.h */
1318 1326 printf_hook(ext2_error, 3, 4); /* fs/ext2/ext2.h */
1319 1327 printf_hook(ext2_msg, 3, 4); /* fs/ext2/ext2.h */
1320 1328 printf_hook(ext3_abort, 3, 4); /* fs/ext3/ext3.h */
1321 1329 printf_hook(ext3_error, 3, 4); /* fs/ext3/ext3.h */
1322 1330 printf_hook(ext3_msg, 3, 4); /* fs/ext3/ext3.h */
1323 1331 printf_hook(ext3_warning, 3, 4); /* fs/ext3/ext3.h */
1324 1332 printf_hook(__ext4_abort, 4, 5); /* fs/ext4/ext4.h */
1325 1333 printf_hook(__ext4_error, 4, 5); /* fs/ext4/ext4.h */
1326 1334 printf_hook(__ext4_error_file, 5, 6); /* fs/ext4/ext4.h */
1327 1335 printf_hook(__ext4_error_inode, 5, 6); /* fs/ext4/ext4.h */
1328 1336 printf_hook(__ext4_grp_locked_error, 7, 8); /* fs/ext4/ext4.h */
1329 1337 printf_hook(__ext4_msg, 3, 4); /* fs/ext4/ext4.h */
1330 1338 printf_hook(__ext4_warning, 4, 5); /* fs/ext4/ext4.h */
1331 1339 printf_hook(f2fs_msg, 3, 4); /* fs/f2fs/f2fs.h */
1332 1340 printf_hook(__fat_fs_error, 3, 4); /* fs/fat/fat.h */
1333 1341 printf_hook(fat_msg, 3, 4); /* fs/fat/fat.h */
1334 1342 printf_hook(gfs2_print_dbg, 2, 3); /* fs/gfs2/glock.h */
1335 1343 printf_hook(gfs2_lm_withdraw, 2, 3); /* fs/gfs2/util.h */
1336 1344 printf_hook(hpfs_error, 2, 3); /* fs/hpfs/hpfs_fn.h */
1337 1345 printf_hook(jfs_error, 2, 3); /* fs/jfs/jfs_superblock.h */
1338 1346 printf_hook(nilfs_error, 3, 4); /* fs/nilfs2/nilfs.h */
1339 1347 printf_hook(nilfs_warning, 3, 4); /* fs/nilfs2/nilfs.h */
1340 1348 printf_hook(__ntfs_debug, 4, 5); /* fs/ntfs/debug.h */
1341 1349 printf_hook(__ntfs_error, 3, 4); /* fs/ntfs/debug.h */
1342 1350 printf_hook(__ntfs_warning, 3, 4); /* fs/ntfs/debug.h */
1343 1351 printf_hook(__ocfs2_abort, 3, 4); /* fs/ocfs2/super.h */
1344 1352 printf_hook(__ocfs2_error, 3, 4); /* fs/ocfs2/super.h */
1345 1353 printf_hook(_udf_err, 3, 4); /* fs/udf/udfdecl.h */
1346 1354 printf_hook(_udf_warn, 3, 4); /* fs/udf/udfdecl.h */
1347 1355 printf_hook(ufs_error, 3, 4); /* fs/ufs/ufs.h */
1348 1356 printf_hook(ufs_panic, 3, 4); /* fs/ufs/ufs.h */
1349 1357 printf_hook(ufs_warning, 3, 4); /* fs/ufs/ufs.h */
1350 1358 printf_hook(xfs_alert, 2, 3); /* fs/xfs/xfs_message.h */
1351 1359 printf_hook(xfs_alert_tag, 3, 4); /* fs/xfs/xfs_message.h */
1352 1360 printf_hook(xfs_crit, 2, 3); /* fs/xfs/xfs_message.h */
1353 1361 printf_hook(xfs_debug, 2, 3); /* fs/xfs/xfs_message.h */
1354 1362 printf_hook(xfs_emerg, 2, 3); /* fs/xfs/xfs_message.h */
1355 1363 printf_hook(xfs_err, 2, 3); /* fs/xfs/xfs_message.h */
1356 1364 printf_hook(xfs_info, 2, 3); /* fs/xfs/xfs_message.h */
1357 1365 printf_hook(xfs_notice, 2, 3); /* fs/xfs/xfs_message.h */
1358 1366 printf_hook(xfs_warn, 2, 3); /* fs/xfs/xfs_message.h */
1359 1367 printf_hook(warn_slowpath_fmt, 3, 4); /* include/asm-generic/bug.h */
1360 1368 printf_hook(warn_slowpath_fmt_taint, 4, 5); /* include/asm-generic/bug.h */
1361 1369 printf_hook(drm_err, 1, 2); /* include/drm/drmP.h */
1362 1370 printf_hook(drm_ut_debug_printk, 2, 3); /* include/drm/drmP.h */
1363 1371 printf_hook(__acpi_handle_debug, 3, 4); /* include/linux/acpi.h */
1364 1372 printf_hook(acpi_handle_printk, 3, 4); /* include/linux/acpi.h */
1365 1373 printf_hook(audit_log, 4, 5); /* include/linux/audit.h */
1366 1374 printf_hook(audit_log_format, 2, 3); /* include/linux/audit.h */
1367 1375 printf_hook(bdi_register, 3, 4); /* include/linux/backing-dev.h */
1368 1376 printf_hook(__trace_note_message, 2, 3); /* include/linux/blktrace_api.h */
1369 1377 printf_hook(_dev_info, 2, 3); /* include/linux/device.h */
1370 1378 printf_hook(dev_alert, 2, 3); /* include/linux/device.h */
1371 1379 printf_hook(dev_crit, 2, 3); /* include/linux/device.h */
1372 1380 printf_hook(dev_emerg, 2, 3); /* include/linux/device.h */
1373 1381 printf_hook(dev_err, 2, 3); /* include/linux/device.h */
1374 1382 printf_hook(dev_notice, 2, 3); /* include/linux/device.h */
1375 1383 printf_hook(dev_printk, 3, 4); /* include/linux/device.h */
1376 1384 printf_hook(dev_printk_emit, 3, 4); /* include/linux/device.h */
1377 1385 printf_hook(dev_set_name, 2, 3); /* include/linux/device.h */
1378 1386 printf_hook(dev_vprintk_emit, 3, 0); /* include/linux/device.h */
1379 1387 printf_hook(dev_warn, 2, 3); /* include/linux/device.h */
1380 1388 printf_hook(device_create, 5, 6); /* include/linux/device.h */
1381 1389 printf_hook(device_create_with_groups, 6, 7); /* include/linux/device.h */
1382 1390 printf_hook(devm_kasprintf, 3, 4); /* include/linux/device.h */
1383 1391 printf_hook(__dynamic_dev_dbg, 3, 4); /* include/linux/dynamic_debug.h */
1384 1392 printf_hook(__dynamic_netdev_dbg, 3, 4); /* include/linux/dynamic_debug.h */
1385 1393 printf_hook(__dynamic_pr_debug, 2, 3); /* include/linux/dynamic_debug.h */
1386 1394 printf_hook(__simple_attr_check_format, 1, 2); /* include/linux/fs.h */
1387 1395 printf_hook(fscache_init_cache, 3, 4); /* include/linux/fscache-cache.h */
1388 1396 printf_hook(gameport_set_phys, 2, 3); /* include/linux/gameport.h */
1389 1397 printf_hook(iio_trigger_alloc, 1, 2); /* include/linux/iio/trigger.h */
1390 1398 printf_hook(__check_printsym_format, 1, 2); /* include/linux/kallsyms.h */
1391 1399 printf_hook(kdb_printf, 1, 2); /* include/linux/kdb.h */
1392 1400 printf_hook(vkdb_printf, 1, 0); /* include/linux/kdb.h */
1393 1401 printf_hook(____trace_printk_check_format, 1, 2); /* include/linux/kernel.h */
1394 1402 printf_hook(__trace_bprintk, 2, 3); /* include/linux/kernel.h */
1395 1403 printf_hook(__trace_printk, 2, 3); /* include/linux/kernel.h */
1396 1404 printf_hook(kasprintf, 2, 3); /* include/linux/kernel.h */
1397 1405 printf_hook(panic, 1, 2); /* include/linux/kernel.h */
1398 1406 printf_hook(scnprintf, 3, 4); /* include/linux/kernel.h */
1399 1407 printf_hook(snprintf, 3, 4); /* include/linux/kernel.h */
1400 1408 printf_hook(sprintf, 2, 3); /* include/linux/kernel.h */
1401 1409 printf_hook(trace_printk, 1, 2); /* include/linux/kernel.h */
1402 1410 printf_hook(vscnprintf, 3, 0); /* include/linux/kernel.h */
1403 1411 printf_hook(vsnprintf, 3, 0); /* include/linux/kernel.h */
1404 1412 printf_hook(vsprintf, 2, 0); /* include/linux/kernel.h */
1405 1413 printf_hook(vmcoreinfo_append_str, 1, 2); /* include/linux/kexec.h */
1406 1414 printf_hook(__request_module, 2, 3); /* include/linux/kmod.h */
1407 1415 printf_hook(add_uevent_var, 2, 3); /* include/linux/kobject.h */
1408 1416 printf_hook(kobject_add, 3, 4); /* include/linux/kobject.h */
1409 1417 printf_hook(kobject_init_and_add, 4, 5); /* include/linux/kobject.h */
1410 1418 printf_hook(kobject_set_name, 2, 3); /* include/linux/kobject.h */
1411 1419 printf_hook(kthread_create_on_node, 4, 5); /* include/linux/kthread.h */
1412 1420 printf_hook(__ata_ehi_push_desc, 2, 3); /* include/linux/libata.h */
1413 1421 printf_hook(ata_dev_printk, 3, 4); /* include/linux/libata.h */
1414 1422 printf_hook(ata_ehi_push_desc, 2, 3); /* include/linux/libata.h */
1415 1423 printf_hook(ata_link_printk, 3, 4); /* include/linux/libata.h */
1416 1424 printf_hook(ata_port_desc, 2, 3); /* include/linux/libata.h */
1417 1425 printf_hook(ata_port_printk, 3, 4); /* include/linux/libata.h */
1418 1426 printf_hook(warn_alloc_failed, 3, 4); /* include/linux/mm.h */
1419 1427 printf_hook(mmiotrace_printk, 1, 2); /* include/linux/mmiotrace.h */
1420 1428 printf_hook(netdev_alert, 2, 3); /* include/linux/netdevice.h */
1421 1429 printf_hook(netdev_crit, 2, 3); /* include/linux/netdevice.h */
1422 1430 printf_hook(netdev_emerg, 2, 3); /* include/linux/netdevice.h */
1423 1431 printf_hook(netdev_err, 2, 3); /* include/linux/netdevice.h */
1424 1432 printf_hook(netdev_info, 2, 3); /* include/linux/netdevice.h */
1425 1433 printf_hook(netdev_notice, 2, 3); /* include/linux/netdevice.h */
1426 1434 printf_hook(netdev_printk, 3, 4); /* include/linux/netdevice.h */
1427 1435 printf_hook(netdev_warn, 2, 3); /* include/linux/netdevice.h */
1428 1436 printf_hook(early_printk, 1, 2); /* include/linux/printk.h */
1429 1437 printf_hook(no_printk, 1, 2); /* include/linux/printk.h */
1430 1438 printf_hook(printk, 1, 2); /* include/linux/printk.h */
1431 1439 printf_hook(printk_deferred, 1, 2); /* include/linux/printk.h */
1432 1440 printf_hook(printk_emit, 5, 6); /* include/linux/printk.h */
1433 1441 printf_hook(vprintk, 1, 0); /* include/linux/printk.h */
1434 1442 printf_hook(vprintk_emit, 5, 0); /* include/linux/printk.h */
1435 1443 printf_hook(__quota_error, 3, 4); /* include/linux/quotaops.h */
1436 1444 printf_hook(seq_buf_printf, 2, 3); /* include/linux/seq_buf.h */
1437 1445 printf_hook(seq_buf_vprintf, 2, 0); /* include/linux/seq_buf.h */
1438 1446 printf_hook(seq_printf, 2, 3); /* include/linux/seq_file.h */
1439 1447 printf_hook(seq_vprintf, 2, 0); /* include/linux/seq_file.h */
1440 1448 printf_hook(bprintf, 3, 4); /* include/linux/string.h */
1441 1449 printf_hook(trace_seq_printf, 2, 3); /* include/linux/trace_seq.h */
1442 1450 printf_hook(trace_seq_vprintf, 2, 0); /* include/linux/trace_seq.h */
1443 1451 printf_hook(__alloc_workqueue_key, 1, 6); /* include/linux/workqueue.h */
1444 1452 printf_hook(set_worker_desc, 1, 2); /* include/linux/workqueue.h */
1445 1453 printf_hook(_p9_debug, 3, 4); /* include/net/9p/9p.h */
1446 1454 printf_hook(bt_err, 1, 2); /* include/net/bluetooth/bluetooth.h */
1447 1455 printf_hook(bt_info, 1, 2); /* include/net/bluetooth/bluetooth.h */
1448 1456 printf_hook(nf_ct_helper_log, 3, 4); /* include/net/netfilter/nf_conntrack_helper.h */
1449 1457 printf_hook(nf_log_buf_add, 2, 3); /* include/net/netfilter/nf_log.h */
1450 1458 printf_hook(nf_log_packet, 8, 9); /* include/net/netfilter/nf_log.h */
1451 1459 printf_hook(SOCK_DEBUG, 2, 3); /* include/net/sock.h */
1452 1460 printf_hook(__snd_printk, 4, 5); /* include/sound/core.h */
1453 1461 printf_hook(_snd_printd, 2, 3); /* include/sound/core.h */
1454 1462 printf_hook(snd_printd, 1, 2); /* include/sound/core.h */
1455 1463 printf_hook(snd_printdd, 1, 2); /* include/sound/core.h */
1456 1464 printf_hook(snd_iprintf, 2, 3); /* include/sound/info.h */
1457 1465 printf_hook(snd_seq_create_kernel_client, 3, 4); /* include/sound/seq_kernel.h */
1458 1466 printf_hook(xen_raw_printk, 1, 2); /* include/xen/hvc-console.h */
1459 1467 printf_hook(xenbus_dev_error, 3, 4); /* include/xen/xenbus.h */
1460 1468 printf_hook(xenbus_dev_fatal, 3, 4); /* include/xen/xenbus.h */
1461 1469 printf_hook(xenbus_printf, 4, 5); /* include/xen/xenbus.h */
1462 1470 printf_hook(xenbus_watch_pathfmt, 4, 5); /* include/xen/xenbus.h */
1463 1471 printf_hook(batadv_fdebug_log, 2, 3); /* net/batman-adv/debugfs.c */
1464 1472 printf_hook(_batadv_dbg, 4, 5); /* net/batman-adv/main.h */
1465 1473 printf_hook(batadv_debug_log, 2, 3); /* net/batman-adv/main.h */
1466 1474 printf_hook(__sdata_dbg, 2, 3); /* net/mac80211/debug.h */
1467 1475 printf_hook(__sdata_err, 1, 2); /* net/mac80211/debug.h */
1468 1476 printf_hook(__sdata_info, 1, 2); /* net/mac80211/debug.h */
1469 1477 printf_hook(__wiphy_dbg, 3, 4); /* net/mac80211/debug.h */
1470 1478 printf_hook(mac80211_format_buffer, 4, 5); /* net/mac80211/debugfs.h */
1471 1479 printf_hook(__rds_conn_error, 2, 3); /* net/rds/rds.h */
1472 1480 printf_hook(rdsdebug, 1, 2); /* net/rds/rds.h */
1473 1481 printf_hook(printl, 1, 2); /* net/sctp/probe.c */
1474 1482 printf_hook(svc_printk, 2, 3); /* net/sunrpc/svc.c */
1475 1483 printf_hook(tomoyo_io_printf, 2, 3); /* security/tomoyo/common.c */
1476 1484 printf_hook(tomoyo_supervisor, 2, 3); /* security/tomoyo/common.h */
1477 1485 printf_hook(tomoyo_write_log, 2, 3); /* security/tomoyo/common.h */
1478 1486 printf_hook(cmp_error, 2, 3); /* sound/firewire/cmp.c */
1479 1487 }
↓ open down ↓ |
795 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX