-
Notifications
You must be signed in to change notification settings - Fork 12
/
default-signatures.yml
3823 lines (3646 loc) · 107 KB
/
default-signatures.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# ------------------------------------------------------------------------------
# C Standard Library
# ------------------------------------------------------------------------------
# Comments describing function behavior adapted from
# https://linux.die.net/man and https://refspecs.linuxbase.org.
- name: '^_IO_getc$'
# int _IO_getc(_IO_FILE *__fp)
#
# _IO_getc reads the next character from __fp and returns it as an
# unsigned char cast to an int, or EOF on end of file or error.
signatures:
- pts_none: []
- dataflow:
from:
indirect:
- arg: [0]
to:
- return: []
- input:
tags: [filesystem,user_input]
to:
- return: []
- name: '^__assert_fail$'
# void __assert_fail(const char * assertion, const char * file,
# unsigned int line, const char * function)
#
# _assert_fail shall print the given file filename, line line
# number, function function name and a message on the standard error
# stream in an unspecified format, and abort program execution via
# the abort() function.
signatures:
- pts_none: []
- output:
from:
- arg_points_to: [0]
- arg_points_to: [1]
- arg: [2]
- arg_points_to: [3]
- name: '^__ctype_b_loc$'
# const unsigned short * * __ctype_b_loc (void)
#
# __ctype_b_loc shall return a pointer to the array of characters to
# be used for the ctype() family of functions (see <ctype.h>).
signatures:
- pts_return_alloc_once: []
# All calls should return a pointer to the same allocation.
- name: '^__errno_location$'
# int * __errno_location(void)
#
# __errno_location shall return the address of the errno variable
# for the current thread.
signatures:
- pts_return_points_to_global: [errno]
- name: '^__sysv_signal$'
# __sighandler_t __sysv_signal(int sig, __sighandler_t handler)
#
# Has the same behavior as signal().
# signal() returns the previous value of the signal handler, or
# SIG_ERR on error. In the event of an error, errno is set to
# indicate the cause.
signatures:
- pts_none: []
# TODO: dataflow? control-flow?
- name: '^__xpg_basename$'
# char * __xpg_basename(const char * path)
#
# __xpg_basename shall return a pointer to the final component of
# the pathname named by path.
signatures:
- pts_return_aliases_arg: [0]
- dataflow:
from:
direct:
- arg: [0]
indirect:
- arg_points_to: [0]
to:
- return: []
- name: '^abort$'
# void abort(void)
#
# The abort() function first unblocks the SIGABRT signal, and then
# raises that signal for the calling process (as though raise(3) was
# called). This results in the abnormal termination of the process
# unless the SIGABRT signal is caught and the signal handler does
# not return (see longjmp(3)).
signatures:
- pts_none: []
# TODO: figure out how to handle this...
- name: '^accept$'
# int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
#
# accept extracts the first connection request on the queue of
# pending connections for the listening socket, sockfd, creates a
# new connected socket, and returns a new file descriptor referring
# to that socket.
#
# The argument addr is a pointer to a sockaddr structure. This
# structure is filled in with the address of the peer socket, as
# known to the communications layer. The exact format of the
# address returned addr is determined by the socket's address
# family (see socket(2) and the respective protocol man pages).
# When addr is NULL, nothing is filled in; in this case, addrlen is
# not used, and should also be NULL.
# The addrlen argument is a value-result argument: the caller must
# initialize it to contain the size (in bytes) of the structure
# pointed to by addr; on return it will contain the actual size of
# the peer address.
signatures:
- pts_none: []
# While both the addr and addrlen arguments may be written to by
# this function, no pointers are modified and no memory is
# allocated.
- input:
tags: [network]
to:
- arg_points_to_aggregate: [1]
- arg_points_to_aggregate: [2]
- output:
tags: [network]
from:
- arg: [0]
- dataflow:
tags: [network]
from:
indirect:
- arg: [0]
to:
- return: []
- arg_points_to_aggregate: [1]
- arg_points_to_aggregate: [2]
- name: '^access$'
# int access(const char *pathname, int mode)
#
# checks whether the calling process can access the file pathname.
# If pathname is a symbolic link, it is dereferenced.
# The mode specifies the accessibility check(s) to be performed.
signatures:
- pts_none: []
- dataflow:
tags: [filesystem,access_control]
from:
control:
- arg: [0]
indirect:
- arg_points_to: [0]
- arg: [1]
to:
- return: []
- input:
tags: [filesystem,access_control]
to:
- return: []
- output:
tags: [filesystem,access_control,maybe_path_traversal]
from:
- arg_points_to: [0]
- output:
tags: [filesystem,access_control]
from:
- arg: [1]
- name: '^asprintf$'
# int asprintf(char **strp, const char *fmt, ...)
#
# The functions asprintf() and vasprintf() are analogs of sprintf(3)
# and vsprintf(3), except that they allocate a string large enough
# to hold the output including the terminating null byte, and return
# a pointer to it via the first argument.
signatures:
- pts_arg_alloc: [0]
- dataflow:
tags: [format_string]
from:
indirect:
- format_string_reads: [1]
to:
- return: []
- dataflow:
tags: [format_string]
from:
direct:
- format_string_reads: [1]
to:
- arg_reachable: [0]
- format_string_writes: [1]
- name: '^atoi$'
# int atoi(const char *nptr)
#
# The atoi() function converts the initial portion of the string
# pointed to by nptr to int.
signatures:
- pts_none: []
- dataflow:
from:
direct:
- arg_points_to: [0]
indirect:
- arg: [0]
to:
- return: []
- name: '^bind$'
# int bind(int socket, const struct sockaddr *address, socklen_t address_len)
#
# When a socket is created with socket(2), it exists in a name space
# (address family) but has no address assigned to it. bind assigns
# the address specified by addr to the socket referred to by the
# file descriptor sockfd. addrlen specifies the size, in bytes, of
# the address structure pointed to by addr.
signatures:
- pts_none: []
# the addr argument is read from but not otherwise changed
- output:
tags: [network]
from:
- arg: [0]
- arg_points_to_aggregate: [1]
- arg: [2]
- dataflow:
tags: [network]
from:
indirect:
- arg: [0]
- arg_points_to_aggregate: [1]
- arg: [2]
to:
- return: []
- name: '^calloc$'
# void *calloc(size_t nmemb, size_t size)
#
# The calloc() function allocates memory for an array of nmemb
# elements of size bytes each and returns a pointer to the allocated
# memory. The memory is set to zero. If nmemb or size is 0, then
# calloc() returns either NULL, or a unique pointer value that can
# later be successfully passed to free().
signatures:
- dataflow:
from:
indirect:
- arg: [0]
- arg: [1]
to:
- return: []
- name: '^chdir$'
# int chdir(const char *path)
#
# Changes the current working directory of the calling process to
# the directory specified in path.
signatures:
- pts_none: []
- dataflow:
from:
indirect:
- arg_points_to: [0]
to:
- return: []
- input:
tags: [filesystem]
to:
- return: []
- output:
tags: [filesystem,path_traversal]
from:
- arg_points_to: [0]
- name: '^clearerr$'
# void clearerr(FILE *stream)
#
# The function void clearerr(FILE *stream) clears the end-of-file
# and error indicators for the stream pointed to by stream.
signatures:
- pts_none: []
- output:
tags: [filesystem]
from:
- arg: [0]
- name: '^close$'
# int close(int fd)
#
# The close() function shall deallocate the file descriptor
# indicated by fd.
signatures:
- pts_none: []
- output:
tags: [filesystem]
from:
- arg: [0]
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
to:
- return: []
- name: '^closedir$'
# int closedir(DIR *dirp)
#
# Closes the directory stream associated with dirp. A successful
# call to closedir() also closes the underlying file descriptor
# associated with dirp. The directory stream descriptor dirp is not
# available after this call.
signatures:
- pts_none: []
- output:
tags: [filesystem]
from:
- arg: [0]
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
to:
- return: []
- name: '^connect$'
# int connect(int socket, const struct sockaddr *address,
# socklen_t address_len)
#
# The connect() function shall attempt to make a connection on a
# socket. The function takes the following arguments:
# socket:
# Specifies the file descriptor associated with the socket.
# address:
# Points to a sockaddr structure containing the peer
# address. The length and format of the address depend on the
# address family of the socket.
# address_len:
# Specifies the length of the sockaddr structure pointed to by
# the address argument.
#
# The connect() system call connects the socket referred to by the
# file descriptor sockfd to the address specified by addr. The
# addrlen argument specifies the size of addr. The format of the
# address in addr is determined by the address space of the socket
# sockfd; see socket(2) for further details.
#
# If the socket sockfd is of type SOCK_DGRAM, then addr is the
# address to which datagrams are sent by default, and the only
# address from which datagrams are received. If the socket is of
# type SOCK_STREAM or SOCK_SEQPACKET, this call attempts to make a
# connection to the socket that is bound to the address specified
# by addr.
signatures:
- pts_none: []
# all the pointer arguments are read-only
- input:
tags: [network]
to:
- return: []
- output:
tags: [network]
from:
- arg: [0]
- arg_points_to_aggregate: [1]
- arg: [2]
- dataflow:
tags: [network]
from:
indirect:
- arg: [0]
- arg_points_to_aggregate: [1]
- arg: [2]
to:
- arg: [1]
- arg_points_to_aggregate: [1]
- return: []
- name: '^ctime$'
# char *ctime(const time_t *timep)
#
# The ctime(), gmtime() and localtime() functions all take an
# argument of data type time_t which represents calendar time.
# The call ctime(t) is equivalent to asctime(localtime(t)). It
# converts the calendar time t into a null-terminated string of the
# form "Wed Jun 30 21:49:08 1993\n".
#
# The return value points to a statically allocated string which
# might be overwritten by subsequent calls to any of the date and
# time functions.
signatures:
- pts_return_alloc_once: []
# multiple calls may see the same allocation
- dataflow:
from:
direct:
- arg_points_to_aggregate: [0]
to:
- return_points_to: []
- name: '^dup$'
# int dup(int fildes)
#
# The dup() system call creates a copy of the file descriptor
# oldfd, using the lowest-numbered unused file descriptor for the
# new descriptor.
signatures:
- pts_none: []
- dataflow:
tags: [filesystem]
from:
direct:
- arg: [0]
to:
- return: []
- name: '^exit$'
# void exit(int status)
#
# The exit() function causes normal process termination and the
# value of status & 0377 is returned to the parent (see wait(2)).
signatures:
- pts_none: []
- output:
from:
- arg: [0]
- name: '^fclose$'
# int fclose(FILE *fp)
#
# The fclose() function flushes the stream pointed to by fp (writing
# any buffered output data using fflush(3)) and closes the
# underlying file descriptor.
signatures:
- pts_none: []
- output:
tags: [filesystem]
from:
- arg: [0]
- dataflow:
from:
indirect:
- arg: [0]
to:
- return: []
- name: '^fdopen$'
# FILE *fdopen(int fd, const char *mode)
#
# The fopen() function opens the file whose name is the string
# pointed to by path and associates a stream with it.
signatures:
- pts_return_alloc: []
- input:
tags: [filesystem]
to:
- return: []
- output:
tags: [filesystem]
from:
- arg: [0]
- output:
tags: [filesystem,maybe_path_traversal]
from:
- arg_points_to: [1]
- dataflow:
tags: [filesystem]
from:
direct:
- arg: [0]
control:
- arg_points_to: [1]
to:
- return: []
- name: '^feof$'
# int feof(FILE *stream)
#
# The function feof() tests the end-of-file indicator for the stream
# pointed to by stream, returning nonzero if it is set. The end-of-
# file indicator can be cleared only by the function clearerr().
signatures:
- pts_none: []
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
- arg_points_to: [0]
to:
- return: []
- name: '^ferror$'
# int ferror(FILE *stream)
#
# The function ferror() tests the error indicator for the stream
# pointed to by stream, returning nonzero if it is set. The error
# indicator can only be reset by the clearerr() function.
signatures:
- pts_none: []
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
to:
- return: []
- name: '^fflush$'
# int fflush(FILE *stream)
#
# For output streams, fflush() forces a write of all user-space
# buffered data for the given output or update stream via the
# stream's underlying write function. For input streams, fflush()
# discards any buffered data that has been fetched from the
# underlying file, but has not been consumed by the application. The
# open status of the stream is unaffected.
#
# If the stream argument is NULL, fflush() flushes all open output
# streams.
signatures:
- pts_none: []
- output:
tags: [filesystem]
from:
- arg: [0]
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
to:
- return: []
# TODO: handle NULL case
- name: '^gets$'
# char *gets(char *s)
# Never use this function.
# gets() reads a line from stdin into the buffer pointed to by s
# until either a terminating newline or EOF, which it replaces with
# a null byte ('\0').
signatures:
- pts_return_aliases_arg: [0]
- input:
tags: [dangerous, stdin, user_input]
to:
- arg_points_to: [0]
- return_points_to: []
- dataflow:
tags: [dangerous, stdin]
from:
direct:
- arg: [0]
to:
- return: []
- name: '^fgets$'
# char *fgets(char *s, int size, FILE *stream)
#
# fgets() reads in at most one less than size characters from stream
# and stores them into the buffer pointed to by s. Reading stops
# after an EOF or a newline. If a newline is read, it is stored into
# the buffer. A terminating null byte (aq\0aq) is stored after the
# last character in the buffer.
#
# gets() and fgets() return s on success, and NULL on error or when
# end of file occurs while no characters have been read.
signatures:
- pts_return_aliases_arg: [0]
# TODO: return can be NULL
- input:
tags: [filesystem, user_input]
to:
- arg_points_to: [0]
- dataflow:
tags: [filesystem]
from:
direct:
- arg_points_to: [0]
indirect:
- arg: [1]
- arg: [2]
to:
- arg_points_to: [0]
- dataflow:
tags: [filesystem]
from:
direct:
- arg: [0]
indirect:
- arg: [1]
- arg: [2]
to:
- return: []
# NOTE: This signature should be identical to that of '_IO_getc' above.
- name: '^fgetc$'
# int fgetc(_IO_FILE *__fp)
#
# fgetc() reads the next character from stream and returns it as an unsigned
# char cast to an int, or EOF on end of file or error.
signatures:
- pts_none: []
- dataflow:
from:
indirect:
- arg: [0]
to:
- return: []
- input:
tags: [filesystem,user_input]
to:
- return: []
- name: '^fileno$'
# int fileno(FILE *stream)
#
# The function fileno() examines the argument stream and returns its
# integer descriptor. In case fileno() detects that its argument is
# not a valid stream, it must return -1 and set errno to EBADF.
signatures:
- pts_none: []
- dataflow:
tags: [filesystem]
from:
direct:
- arg: [0]
to:
- return: []
- name: '^fopen$'
# FILE *fopen(const char *path, const char *mode)
#
# The fopen() function opens the file whose name is the string
# pointed to by path and associates a stream with it.
signatures:
- pts_return_alloc: []
- input:
tags: [filesystem]
to:
- return: []
- output:
tags: [filesystem,path_traversal]
from:
- arg_points_to: [0]
- output:
tags: [filesystem]
from:
- arg_points_to: [1]
- dataflow:
tags: [filesystem]
from:
indirect:
- arg_points_to: [0]
- arg_points_to: [1]
to:
- return: []
- name: '^fprintf$'
# int fprintf(FILE *stream, const char *format, ...)
signatures:
- pts_none: []
- output:
tags: [filesystem,format_string]
from:
- arg: [0]
- output:
tags: [filesystem,format_string,user_output]
from:
- format_string_reads: [1]
- dataflow:
tags: [filesystem,format_string]
from:
indirect:
- format_string_reads: [1]
to:
- return: []
- dataflow:
tags: [filesystem,format_string]
from:
direct:
- format_string_reads: [1]
to:
- format_string_writes: [1]
- name: '^fputc$'
# int fputc(int c, FILE *stream)
#
# fputc() writes the character c, cast to an unsigned char, to stream.
signatures:
- pts_none: []
- output:
tags: [filesystem,user_output]
from:
- arg: [0]
- output:
tags: [filesystem]
from:
- arg: [1]
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
- arg: [1]
to:
- return: []
- name: '^fputs$'
# int fputs(const char *s, FILE *stream)
#
# fputs() writes the string s to stream, without its terminating
# null byte.
signatures:
- pts_none: []
- output:
tags: [filesystem,user_output]
from:
- arg_points_to: [0]
- output:
tags: [filesystem]
from:
- arg: [1]
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
- arg_points_to: [0]
- arg: [1]
to:
- return: []
- name: '^fread$'
# size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
#
# The function fread() reads nmemb elements of data, each size bytes
# long, from the stream pointed to by stream, storing them at the
# location given by ptr. On success, fread() returns the number of
# items read or written.
signatures:
- pts_none: []
- input:
tags: [filesystem,user_input]
to:
- arg_points_to_aggregate: [0]
- input:
tags: [filesystem]
to:
- return: []
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [1]
- arg: [2]
- arg: [3]
to:
- arg_points_to_aggregate: [0]
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
- arg: [1]
- arg: [2]
- arg: [3]
to:
- return: []
- name: '^freeaddrinfo$'
# void freeaddrinfo(struct addrinfo *res)
#
# The freeaddrinfo() function frees the memory that was allocated
# for the dynamically allocated linked list res.
signatures:
- pts_none: []
# TODO: handle custom free routines?
- name: '^fseek$'
# int fseek(FILE *stream, long offset, int whence)
#
# The fseek() function sets the file position indicator for the
# stream pointed to by stream. The new position, measured in bytes,
# is obtained by adding offset bytes to the position specified by
# whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the
# offset is relative to the start of the file, the current position
# indicator, or end-of-file, respectively. A successful call to the
# fseek() function clears the end-of-file indicator for the stream
# and undoes any effects of the ungetc(3) function on the same
# stream.
signatures:
- pts_none: []
- output:
tags: [filesystem]
from:
- arg: [0]
- arg: [1]
- arg: [2]
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
- arg: [1]
- arg: [2]
to:
- return: []
# NOTE(lb): This signature should be identical to 'fseek' above.
- name: '^fseeko$'
# int fseeko(FILE *stream, off_t offset, int whence)
#
# The fseeko() and ftello() functions are identical to fseek(3) and
# ftell(3) (see fseek(3)), respectively, except that the offset
# argument of fseeko() and the return value of ftello() is of type
# off_t instead of long.
signatures:
- pts_none: []
- output:
tags: [filesystem]
from:
- arg: [0]
- arg: [1]
- arg: [2]
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
- arg: [1]
- arg: [2]
to:
- return: []
- name: '^ftell$'
# long ftell(FILE *stream)
#
# The ftell() function obtains the current value of the file
# position indicator for the stream pointed to by stream.
signatures:
- pts_none: []
- input:
tags: [filesystem]
to:
- return: []
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
to:
- return: []
# NOTE(lb): This signature should be identical to 'ftell' above.
- name: '^ftello$'
# off_t ftello(FILE *stream)
#
# The fseeko() and ftello() functions are identical to fseek(3) and
# ftell(3) (see fseek(3)), respectively, except that the offset
# argument of fseeko() and the return value of ftello() is of type
# off_t instead of long.
signatures:
- pts_none: []
- input:
tags: [filesystem]
to:
- return: []
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
to:
- return: []
- name: '^fwrite$'
# size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
#
# The function fwrite() writes nmemb elements of data, each size
# bytes long, to the stream pointed to by stream, obtaining them
# from the location given by ptr.
signatures:
- pts_none: []
- output:
tags: [filesystem,user_output]
from:
- arg_points_to_aggregate: [0]
- output:
tags: [filesystem]
from:
- arg: [1]
- arg: [2]
- arg: [3]
- dataflow:
tags: [filesystem]
from:
indirect:
- arg: [0]
- arg: [1]
- arg: [2]
- arg: [3]
- arg_points_to_aggregate: [0]
to:
- return: []
- name: '^gai_strerror$'
# const char *gai_strerror(int errcode)
#
# The gai_strerror() function translates error codes from
# getaddrinfo to a human readable string, suitable for error
# reporting.
signatures:
- pts_return_alloc_once: []
- dataflow:
from:
indirect:
- arg: [0]
to:
- return_points_to: []
- name: '^getaddrinfo$'
# int getaddrinfo(const char *node, const char *service,
# const struct addrinfo *hints,
# struct addrinfo **res)
#
# Given node and service, which identify an Internet host and a
# service, getaddrinfo() returns one or more addrinfo structures,
# each of which contains an Internet address that can be specified
# in a call to bind(2) or connect(2). The getaddrinfo() function
# combines the functionality provided by the gethostbyname(3) and
# getservbyname(3) functions into a single interface, but unlike the
# latter functions, getaddrinfo() is reentrant and allows programs
# to eliminate IPv4-versus-IPv6 dependencies.
signatures:
- pts_arg_alloc: [3]
- dataflow:
tags: [network]
from:
direct:
- arg_points_to: [0]
- arg_points_to: [1]
indirect:
- arg_points_to_aggregate: [2]
to:
- arg_reachable: [3]
- dataflow:
tags: [network]
from:
indirect:
- arg_points_to: [0]
- arg_points_to: [1]
- arg_points_to_aggregate: [2]
to:
- return: []
# NOTE: This signature should be identical to that of 'fgetc'
- name: '^getc$'
# int getc(_IO_FILE *__fp)
#
# getc() is equivalent to fgetc() except that it may be implemented as a macro
# which evaluates stream more than once.
signatures:
- pts_none: []
- dataflow:
from:
indirect:
- arg: [0]
to:
- return: []
- input:
tags: [filesystem,user_input]
to:
- return: []
- name: '^getegid$'
# gid_t getegid(void);
#
# The getegid() function shall return the effective group ID of the
# calling process.
signatures:
- pts_none: []
- input:
tags: [access_control]
to:
- return: []
- name: '^getenv$'
# char *getenv(const char *name)
#
# The getenv() function searches the environment list to find the
# environment variable name, and returns a pointer to the
# corresponding value string.