Powered by Linux
Re: [PATCH] slist: Properly handle one-way merges — Semantic Matching Tool

Re: [PATCH] slist: Properly handle one-way merges

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 15, 2016, at 9:08 AM, Dan Carpenter wrote:

> On Sat, Feb 13, 2016 at 11:48:39PM -0500, Oleg Drokin wrote:
>> so far the biggest class of issues here is when we allocate something, but check for errptr, and there exists another path
>> that does not allocate anything and exit code path checks for NULL to see if the allocation needs to be unwinded (transaction stopped and such).
>> I do not think assuming IS_ERR is also NULL pointer check is such a great idea since that might fail to find some bugs where we can get NULL or err ptr?
>> 
>> Kind of like:
>> ptr *handle = NULL;
>> 
>> if (something) {
>> 	handle = transaction_start(blah);
>> 	if (IS_ERR(handle))
>> 		goto err;
>> 	do_some_stuff(handle);
>> …
>> }
>> 
>> if (handle)     <== false positive hits here.
>> 	transaction_stop(handle);
>> 
>> err:
>> ...
> 
> That test is only supposed to complain where every path leading to the
> check dereferences the pointer.
> 
> Can you give me something I can test myself?

Yes, Sorry the full Lustre source building is a bit of a pain because the server code was only ever tested on older kernels in "enterprise distros".

If you can procure Centos6.7 or centos7.2 (or probably corresponding oracle linux kernel, though I never tried that) source,
just build that, then use the lustre source and there run:

sh autogen.sh
./configure --with-linux=/path/to/older/built/kernel/tree --disable-ldiskfs

In fact if your debian is of 3.10 or below, it might just work even there, just use --disable-ldiskfs build option (without it we need full kernel sources that
contain ext4, so we can add some patches on top of it).

Once configure completes, in the lustre source you could do build_kernel_data.sh and test_kernel.sh and it would work on whole lustre kernel source only.
Sadly the single file compilation with kchecker does not work for some reason.

--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux