[LTP] [PATCH v2] Add test for possible writev() issues with NULL buffer in iovec

Martin Doucha mdoucha@suse.cz
Tue Feb 23 13:00:12 CET 2021


On 23. 02. 21 12:46, Petr Vorel wrote:
> It takes some time to run due .all_filesystems, but I guess there is a reason to
> test it on all available fs.

Yes, test results depend on FS-specific backend implementation bugs.
ext2, ext3 and vfat fail; ext4, xfs and btrfs pass on unpatched kernels.

> ...
>> diff --git a/testcases/kernel/syscalls/writev/writev03.c b/testcases/kernel/syscalls/writev/writev03.c
>> new file mode 100644
>> index 000000000..58d6931d2
>> --- /dev/null
>> +++ b/testcases/kernel/syscalls/writev/writev03.c
>> @@ -0,0 +1,145 @@
>> +// SPDX-License-Identifier: GPL-2.0-or-later
>> +/*
>> + * Copyright (C) 2021 SUSE LLC <mdoucha@suse.cz>
>> + *
>> + * Check for potential issues in writev() if the first iovec entry is NULL
>> + * and the next one is not present in RAM. This can result in a brief window
>> + * where writev() first writes uninitialized data into the file (possibly
>> + * exposing internal kernel structures) and then overwrites it with the real
>> + * iovec contents later. Bugs fixed in:
> Maybe this doc part should be in * [DESCRIPTION] to get into docparse.

Yes, please add it before pushing the patch.

-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


More information about the ltp mailing list