From 1c6081e0b4000e1c84b578840fe6d355956ef058 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 10 Dec 2014 16:05:47 +0300 Subject: [PATCH] fixup_kernel.sh: allow larger values in rw_verify_area() I chose these values so that pos + count wouldn't overflow, so I just randomly chose some largish values. It turns out those values weren't large enough. The netxen_sysfs_validate_crb() function insists that the offset be within a certain range that is outside the 0-1000000 range and Smatch gets confused that it's not possible to get a successful return. Anyway, 1000000000 + 1000000000 won't overflow the ints so it's ok to use that here. Signed-off-by: Dan Carpenter --- smatch_data/db/fixup_kernel.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/smatch_data/db/fixup_kernel.sh b/smatch_data/db/fixup_kernel.sh index 772d8480..d1346cbe 100755 --- a/smatch_data/db/fixup_kernel.sh +++ b/smatch_data/db/fixup_kernel.sh @@ -36,14 +36,14 @@ insert into caller_info values ('userspace', '', 'compat_sys_ioctl', 0, 0, 1003, delete from caller_info where function = '(struct timer_list)->function' and parameter = 0; /* - * rw_verify_area is a very central function for the kernel. The 1000000 isn't - * accurate but I've picked it so that we can add "pos + count" without wrapping - * on 32 bits. + * rw_verify_area is a very central function for the kernel. The 1000000000 + * isn't accurate but I've picked it so that we can add "pos + count" without + * wrapping on 32 bits. */ delete from return_states where function = 'rw_verify_area'; -insert into return_states values ('faked', 'rw_verify_area', 0, 1, '0-1000000[<=\$3]', 0, 0, -1, '', ''); -insert into return_states values ('faked', 'rw_verify_area', 0, 1, '0-1000000[<=\$3]', 0, 102, 2, '*\$', '0-1000000'); -insert into return_states values ('faked', 'rw_verify_area', 0, 1, '0-1000000[<=\$3]', 0, 1011, 3, '\$', '0-1000000'); +insert into return_states values ('faked', 'rw_verify_area', 0, 1, '0-1000000000[<=\$3]', 0, 0, -1, '', ''); +insert into return_states values ('faked', 'rw_verify_area', 0, 1, '0-1000000000[<=\$3]', 0, 102, 2, '*\$', '0-1000000000'); +insert into return_states values ('faked', 'rw_verify_area', 0, 1, '0-1000000000[<=\$3]', 0, 1011, 3, '\$', '0-1000000000'); insert into return_states values ('faked', 'rw_verify_area', 0, 2, '(-4095)-(-1)', 0, 0, -1, '', ''); /* @@ -103,7 +103,7 @@ EOF call_id=$(echo "select distinct call_id from caller_info where function = '__kernel_write';" | sqlite3 $db_file) for id in $call_id ; do - echo "insert into caller_info values ('fake', '', '__kernel_write', $id, 0, 1, 1003, '*\$', '0-1000000');" | sqlite3 $db_file + echo "insert into caller_info values ('fake', '', '__kernel_write', $id, 0, 1, 1003, '*\$', '0-1000000000');" | sqlite3 $db_file done for i in $(echo "select distinct return from return_states where function = 'clear_user';" | sqlite3 $db_file ) ; do -- 2.11.4.GIT