Print this page
new smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/smatch_data/db/fixup_kernel.sh
          +++ new/usr/src/tools/smatch/src/smatch_data/db/fixup_kernel.sh
↓ open down ↓ 33 lines elided ↑ open up ↑
  34   34  delete from return_states where function='scnprintf' and type = 8017;
  35   35  delete from return_states where function='vsnprintf' and type = 8017;
  36   36  delete from return_states where function='snprintf' and type = 8017;
  37   37  delete from return_states where function='sprintf' and type = 8017;
  38   38  /* There is something setting skb->sk->sk_mark and friends to user_data and */
  39   39  /* because of recursion it gets passed to everything and is impossible to debug */
  40   40  delete from caller_info where function = '__dev_queue_xmit' and type = 8017;
  41   41  delete from caller_info where function = '__netdev_start_xmit' and type = 8017;
  42   42  delete from caller_info where function = '(struct packet_type)->func' and type = 8017;
  43   43  delete from caller_info where function = '(struct bio)->bi_end_io' and type = 8017;
       44 +delete from caller_info where type = 8017 and key = '*\$->bi_private';
       45 +delete from caller_info where type = 8017 and key = '\$->bi_private';
  44   46  delete from caller_info where caller = 'NF_HOOK_COND' and type = 8017;
  45   47  delete from caller_info where caller = 'NF_HOOK' and type = 8017;
  46   48  /* comparison doesn't deal with chunks, I guess.  */
  47   49  delete from return_states where function='get_tty_driver' and type = 8017;
  48   50  delete from caller_info where caller = 'snd_ctl_elem_write' and function = '(struct snd_kcontrol)->put' and type = 8017;
  49   51  delete from caller_info where caller = 'snd_ctl_elem_read' and function = '(struct snd_kcontrol)->get' and type = 8017;
  50   52  delete from caller_info where function = 'nf_tables_newexpr' and type = 8017 and key = '\$->family';
  51   53  delete from caller_info where caller = 'fb_set_var' and function = '(struct fb_ops)->fb_set_par' and type = 8017 and parameter = 0;
  52   54  delete from return_states where function = 'tty_lookup_driver' and parameter = 2 and type = 8017;
       55 +delete from caller_info where function = 'iomap_apply' and type = 8017 and key = '*\$';
  53   56  
  54   57  insert into caller_info values ('userspace', '', 'compat_sys_ioctl', 0, 0, 8017, 0, '\$', '1');
  55   58  insert into caller_info values ('userspace', '', 'compat_sys_ioctl', 0, 0, 8017, 1, '\$', '1');
  56   59  insert into caller_info values ('userspace', '', 'compat_sys_ioctl', 0, 0, 8017, 2, '\$', '1');
  57   60  
  58   61  delete from caller_info where function = '(struct timer_list)->function' and parameter = 0;
  59   62  
  60   63  /*
  61   64   * rw_verify_area is a very central function for the kernel.  The 1000000000
  62   65   * isn't accurate but I've picked it so that we can add "pos + count" without
↓ open down ↓ 104 lines elided ↑ open up ↑
 167  170  
 168  171  /* this if from READ_ONCE().  We can't know anything about the data.  */
 169  172  delete from type_info where key = '(union anonymous)->__val';
 170  173  
 171  174  /* This is RIO_BAD_SIZE */
 172  175  delete from return_states where file = 'drivers/rapidio/rio-access.c' and return = '129';
 173  176  
 174  177  /* Smatch sucks at loops */
 175  178  delete from return_states where function = 'ata_dev_next' and type = 103;
 176  179  
      180 +/* The problem is that parsing big function pointers is hard. */
      181 +delete from return_states where function = 'vfs_get_tree' and type = 1024;
      182 +
 177  183  EOF
 178  184  
 179  185  # fixme: this is totally broken
 180  186  call_id=$(echo "select distinct call_id from caller_info where function = '__kernel_write';" | sqlite3 $db_file)
 181  187  for id in $call_id ; do
 182  188      echo "insert into caller_info values ('fake', '', '__kernel_write', $id, 0, 8017, 1, '*\$', '');" | sqlite3 $db_file
 183  189  done
 184  190  
 185  191  for i in $(echo "select distinct return from return_states where function = 'clear_user';" | sqlite3 $db_file ) ; do
 186  192      echo "update return_states set return = \"$i[<=\$1]\" where return = \"$i\" and function = 'clear_user';" | sqlite3 $db_file
↓ open down ↓ 33 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX