@@ -241,7 +241,7 @@ static int load_cgcos_binary(struct linux_binprm *bprm)
241
241
struct cgc_params pars ;
242
242
243
243
if (s2e_decree_monitor_enabled ) {
244
- s2e_decree_process_load (current -> pid , bprm -> interp );
244
+ s2e_decree_process_load (current , bprm -> interp );
245
245
}
246
246
247
247
memset (& pars , 0 , sizeof (pars ));
@@ -561,9 +561,9 @@ static int load_cgcos_binary(struct linux_binprm *bprm)
561
561
ret = 0 ;
562
562
out :
563
563
if (ret == 0 && s2e_decree_monitor_enabled ) {
564
- s2e_decree_module_load (bprm -> interp , current -> pid , hdr .c_entry ,
564
+ s2e_decree_module_load (current , bprm -> interp , hdr .c_entry ,
565
565
elf_phdr , elf_phdr_size );
566
- s2e_decree_update_memory_map (current -> pid , current -> comm ,
566
+ s2e_decree_update_memory_map (current , current -> comm ,
567
567
current -> mm );
568
568
}
569
569
if (phdrs )
@@ -594,7 +594,7 @@ static void s2e_decree_set_args(int *skip_rng)
594
594
params .cgc_seed_ptr = (uintptr_t )current -> cgc_seed ;
595
595
params .cgc_seed_len = current -> cgc_seed_len ;
596
596
597
- s2e_decree_do_set_args (current -> pid , current -> comm , & params );
597
+ s2e_decree_do_set_args (current , current -> comm , & params );
598
598
599
599
/* Write back new param values */
600
600
current -> cgc_max_transmit = params .cgc_max_transmit ;
@@ -1705,13 +1705,13 @@ long s2e_copy_to_user(void __user *to, const void *from, long n)
1705
1705
{
1706
1706
long ret ;
1707
1707
if (s2e_decree_monitor_enabled ) {
1708
- s2e_decree_copy_to_user (current -> pid , current -> comm , to , from ,
1709
- n , 0 , 0 );
1708
+ s2e_decree_copy_to_user (current , current -> comm , to , from , n , 0 ,
1709
+ 0 );
1710
1710
}
1711
1711
ret = copy_to_user (to , from , n );
1712
1712
if (s2e_decree_monitor_enabled ) {
1713
- s2e_decree_copy_to_user (current -> pid , current -> comm , to , from ,
1714
- n , 1 , ret );
1713
+ s2e_decree_copy_to_user (current , current -> comm , to , from , n , 1 ,
1714
+ ret );
1715
1715
}
1716
1716
return ret ;
1717
1717
}
@@ -1746,13 +1746,13 @@ static int asmlinkage cgcos_fdwait(int nfds, fd_set __user *readfds,
1746
1746
if (s2e_decree_monitor_enabled ) {
1747
1747
invoke_orig = 1 ;
1748
1748
if (timeout != NULL ) {
1749
- res = s2e_decree_waitfds (current -> pid , current -> comm ,
1750
- nfds , true, to -> tv_sec ,
1751
- to -> tv_nsec , & invoke_orig );
1749
+ res = s2e_decree_waitfds (current , current -> comm , nfds ,
1750
+ true, to -> tv_sec , to -> tv_nsec ,
1751
+ & invoke_orig );
1752
1752
} else {
1753
- res = s2e_decree_waitfds (current -> pid , current -> comm ,
1754
- nfds , false, to -> tv_sec ,
1755
- to -> tv_nsec , & invoke_orig );
1753
+ res = s2e_decree_waitfds (current , current -> comm , nfds ,
1754
+ false, to -> tv_sec , to -> tv_nsec ,
1755
+ & invoke_orig );
1756
1756
}
1757
1757
if (invoke_orig ) {
1758
1758
res = core_sys_select (nfds , readfds , writefds , NULL ,
@@ -1786,8 +1786,8 @@ static int asmlinkage cgcos_allocate(unsigned long len, unsigned long exec,
1786
1786
return (- EFAULT );
1787
1787
1788
1788
if (s2e_decree_monitor_enabled ) {
1789
- s2e_decree_handle_symbolic_allocate_size (current -> pid ,
1790
- current -> comm , & len );
1789
+ s2e_decree_handle_symbolic_allocate_size (current , current -> comm ,
1790
+ & len );
1791
1791
}
1792
1792
1793
1793
res = vm_mmap (NULL , 0 , len , prot , MAP_ANON | MAP_PRIVATE , 0 );
@@ -1798,7 +1798,7 @@ static int asmlinkage cgcos_allocate(unsigned long len, unsigned long exec,
1798
1798
return (- EFAULT );
1799
1799
}
1800
1800
if (s2e_decree_monitor_enabled ) {
1801
- s2e_decree_update_memory_map (current -> pid , current -> comm ,
1801
+ s2e_decree_update_memory_map (current , current -> comm ,
1802
1802
current -> mm );
1803
1803
}
1804
1804
return (0 );
@@ -1817,8 +1817,8 @@ int asmlinkage cgcos_random(char __user *buf, size_t count,
1817
1817
return (- EFAULT );
1818
1818
1819
1819
if (s2e_decree_monitor_enabled ) {
1820
- s2e_decree_handle_symbolic_random_buffer (
1821
- current -> pid , current -> comm , (void * * )& buf , & count );
1820
+ s2e_decree_handle_symbolic_random_buffer (current , current -> comm ,
1821
+ (void * * )& buf , & count );
1822
1822
}
1823
1823
1824
1824
for (i = 0 ; i < count ; i += sizeof (randval )) {
@@ -1839,7 +1839,7 @@ int asmlinkage cgcos_random(char __user *buf, size_t count,
1839
1839
if (s2e_decree_monitor_enabled ) {
1840
1840
// either replace everything with symbolic data, or make values
1841
1841
// concolic
1842
- s2e_decree_random (current -> pid , current -> comm , buf , count );
1842
+ s2e_decree_random (current , current -> comm , buf , count );
1843
1843
}
1844
1844
1845
1845
if (rnd_out != NULL &&
@@ -1855,8 +1855,8 @@ static int asmlinkage cgcos_deallocate(unsigned long ptr, size_t len)
1855
1855
ptr >= (CGC_MAGIC_PAGE + PAGE_SIZE )) {
1856
1856
int res = vm_munmap (ptr , len );
1857
1857
if (res == 0 && s2e_decree_monitor_enabled ) {
1858
- s2e_decree_update_memory_map (
1859
- current -> pid , current -> comm , current -> mm );
1858
+ s2e_decree_update_memory_map (current , current -> comm ,
1859
+ current -> mm );
1860
1860
}
1861
1861
return res ;
1862
1862
}
@@ -1880,7 +1880,7 @@ int asmlinkage cgcos_transmit(int fd, char __user *buf, size_t count,
1880
1880
1881
1881
if (s2e_decree_monitor_enabled ) {
1882
1882
s2e_decree_handle_symbolic_transmit_buffer (
1883
- current -> pid , current -> comm , (void * * )& buf , & count );
1883
+ current , current -> comm , (void * * )& buf , & count );
1884
1884
}
1885
1885
1886
1886
if (count != 0 ) {
@@ -1891,8 +1891,8 @@ int asmlinkage cgcos_transmit(int fd, char __user *buf, size_t count,
1891
1891
1892
1892
if (s2e_decree_monitor_enabled ) {
1893
1893
// res becomes symbolic if count_orig was symbolic
1894
- s2e_decree_write_data (current -> pid , current -> comm , fd ,
1895
- buf , & res , & count_orig );
1894
+ s2e_decree_write_data (current , current -> comm , fd , buf ,
1895
+ & res , & count_orig );
1896
1896
}
1897
1897
}
1898
1898
@@ -1917,7 +1917,7 @@ int asmlinkage cgcos_receive(int fd, char __user *buf, size_t count,
1917
1917
count = current -> cgc_max_receive ;
1918
1918
1919
1919
if (s2e_decree_monitor_enabled ) {
1920
- invoke_orig = s2e_get_cfg_bool (current -> pid , current -> comm ,
1920
+ invoke_orig = s2e_get_cfg_bool (current , current -> comm ,
1921
1921
"invokeOriginalSyscalls" );
1922
1922
}
1923
1923
@@ -1929,16 +1929,15 @@ int asmlinkage cgcos_receive(int fd, char __user *buf, size_t count,
1929
1929
}
1930
1930
1931
1931
if (s2e_decree_monitor_enabled ) {
1932
- s2e_decree_read_data_post (current -> pid ,
1933
- current -> comm , fd ,
1934
- buf , res );
1932
+ s2e_decree_read_data_post (
1933
+ current , current -> comm , fd , buf , res );
1935
1934
}
1936
1935
}
1937
1936
} else {
1938
1937
size_t count_orig = count ; // remember original symbolic size
1939
1938
1940
1939
s2e_decree_handle_symbolic_receive_buffer (
1941
- current -> pid , current -> comm , (void * * )& buf , & count );
1940
+ current , current -> comm , (void * * )& buf , & count );
1942
1941
1943
1942
if (count != 0 ) {
1944
1943
void * kbuf ;
@@ -1951,8 +1950,8 @@ int asmlinkage cgcos_receive(int fd, char __user *buf, size_t count,
1951
1950
}
1952
1951
1953
1952
// res becomes symbolic if count_orig was symbolic
1954
- s2e_decree_read_data (current -> pid , current -> comm , fd ,
1955
- kbuf , count , & count_orig , & res );
1953
+ s2e_decree_read_data (current , current -> comm , fd , kbuf ,
1954
+ count , & count_orig , & res );
1956
1955
1957
1956
if (s2e_copy_to_user (buf , kbuf , count )) {
1958
1957
kfree (kbuf );
0 commit comments