db: kernel: fake up ->read/write() limits
[smatch.git] / smatch_data / db / fixup_kernel.sh
blob3a8aaf6b105504707e1748fb2450ac793ded50b0
1 #!/bin/bash
3 # mark some paramaters as coming from user space
4 cat << EOF | sqlite3 smatch_db.sqlite
5 insert into caller_info values ('userspace', '', 'compat_sys_ioctl', 0, 0, 3, 0, '$$', '1');
6 insert into caller_info values ('userspace', '', 'compat_sys_ioctl', 0, 0, 3, 1, '$$', '1');
7 insert into caller_info values ('userspace', '', 'compat_sys_ioctl', 0, 0, 3, 2, '$$', '1');
9 delete from caller_info where function = '(struct file_operations)->read' and file != 'fs/read_write.c';
10 delete from caller_info where function = '(struct file_operations)->write' and file != 'fs/read_write.c';
12 delete from caller_info where function = '(struct notifier_block)->notifier_call' and type != 0;
13 delete from caller_info where function = '(struct mISDNchannel)->send' and type != 0;
15 delete from caller_info where caller = 'hid_input_report' and type = 3;
16 delete from caller_info where caller = 'nes_process_iwarp_aeqe' and type = 3;
17 delete from caller_info where caller = 'oz_process_ep0_urb' and type = 3;
18 delete from caller_info where function = 'dev_hard_start_xmit' and key = '\$\$' and type = 3;
19 delete from caller_info where function like '%->ndo_start_xmit' and key = '\$\$' and type = 3;
20 delete from caller_info where caller = 'packet_rcv_fanout' and function = '(struct packet_type)->func' and parameter = 1 and type = 3;
22 delete from caller_info where caller = 'hptiop_probe' and type = 3;
24 delete from caller_info where function = '(struct timer_list)->function' and parameter = 0;
26 delete from return_states where function = 'rw_verify_area';
27 insert into return_states values ('faked', 'rw_verify_area', 0, 1, '0-1000000', 0, 0, -1, '', '');
28 insert into return_states values ('faked', 'rw_verify_area', 0, 1, '0-1000000', 0, 11, 2, '*\$\$', '0-1000000');
29 insert into return_states values ('faked', 'rw_verify_area', 0, 1, '0-1000000', 0, 11, 3, '\$\$', '0-1000000');
30 insert into return_states values ('faked', 'rw_verify_area', 0, 2, '(-4095)-(-1)', 0, 0, -1, '', '');
32 EOF
34 call_id=$(echo "select distinct call_id from caller_info where function = '__kernel_write';" | sqlite3 smatch_db.sqlite)
35 for id in $call_id ; do
36 echo "insert into caller_info values ('fake', '', '__kernel_write', $id, 0, 1, 3, '*\$\$', '0-1000000');" | sqlite3 smatch_db.sqlite
37 done