[LU-4629] Issues found by static analysis tools Created: 13/Feb/14  Updated: 30/Aug/23  Resolved: 20/Jun/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.6.0

Type: Bug Priority: Critical
Reporter: Dmitry Eremin (Inactive) Assignee: Dmitry Eremin (Inactive)
Resolution: Fixed Votes: 0
Labels: kw

Issue Links:
Duplicate
is duplicated by LU-5172 lustre-initialization-1: kernel BUG a... Closed
Related
is related to LU-7595 New static analysis issues in 2.7.64-... Resolved
is related to LU-10264 New static analysis issues in v2_10_5... Resolved
is related to LU-10657 New static analysis issues in v2_10_5... Resolved
is related to LU-10658 New static analysis issues in v2_10_5... Resolved
is related to LU-10668 New static analysis issues in v2_10_5... Resolved
is related to LU-10772 New static analysis issues in v2_10_5... Resolved
is related to LU-10811 New static analysis issues in v2_10_5... Resolved
is related to LU-10896 New static analysis issues in v2_11_5... Resolved
is related to LU-5384 Static analysis issues in lfsck Resolved
is related to LU-7354 New static analysis issues in 2.7.62-... Resolved
is related to LU-2753 Tracking bug for static code analysis... Resolved
is related to LU-10528 New static analysis issues in v2_10_5... Resolved
is related to LU-5831 New static analysis issues in lfsck Resolved
is related to LU-5832 New static analysis issues in lustre_... Resolved
is related to LU-5865 New static analysis issues in lfsck Resolved
is related to LU-5869 New static analysis issues in osc Resolved
is related to LU-6021 5 new static analysis issues in lnetc... Resolved
is related to LU-10809 New static analysis issues in v2_9_52... Resolved
is related to LU-11021 New static analysis issues in v2_11_5... Resolved
is related to LU-5200 New static analysis issues in 2.5.60-... Resolved
is related to LU-5316 New static analysis issues in 2.5.60-... Resolved
is related to LU-5382 New static analysis issues in 2.5.58-... Resolved
is related to LU-5383 New static analysis issues in mount_l... Resolved
is related to LU-5493 New static analysis issues in 2.6.50-... Resolved
is related to LU-5864 New static analysis issues in lfs Resolved
is related to LU-5870 New static analysis issues in llite Resolved
is related to LU-5922 New static analysis issues in 2.6.90-... Resolved
is related to LU-8128 static analysis tool detected potenti... Resolved
is related to LU-9057 New static analysis issues in v2_9_52... Resolved
is related to LU-9077 New static analysis issues in v2_9_52... Resolved
is related to LU-9152 New static analysis issues in v2_9_53... Resolved
is related to LU-9315 New static analysis issues in v2_9_55... Resolved
is related to LU-9513 New static analysis issues in v2_9_57... Resolved
is related to LU-2875 Remove LASSERT()s on return values fr... Resolved
Severity: 3
Rank (Obsolete): 12663

 Description   

This is a common ticket for all issues found by static analysis tools.
The several patches are expected for this ticket.



 Comments   
Comment by Dmitry Eremin (Inactive) [ 21/Feb/14 ]

Reviewed patches can be observed by http://review.whamcloud.com/#/q/message:LU-4629,n,z
Merged patches can be observed by http://review.whamcloud.com/#/q/message:LU-4629+status:merged,n,z

Comment by James A Simmons [ 06/Mar/14 ]

I noticed several of these patches handle code paths that previously ignored returned NULL pointers. What I find confusing is when is LASSERT a proper solution versus just handling the error condition. There doesn't seem to be any clear standard in this practice in the Lustre code.

Comment by Mikhail Pershin [ 22/Apr/14 ]

James, there are two types of 'capsules' - server and client. Client 'capsule' is request buffers packed on client, server - packed reply buffers on server. So the main rule is to don't assert on wire data, so server must checks all clients buffers and return -EPROTO on them in case of error, the client must do the same for server buffers. Meanwhile server may assert on own just packed reply buffers because this means internal logic error in code, e.g. buffer wasn't properly packed. Just an error code is not working well in such cases because may be not noticed for a long time, while assertion will occur during new code development/testing, well, it should at least.

So we are talking about two different cases - checking the incoming data through the wire (protocol correctness) and internal checks for code correctness, e.g. buffer must exists after successful allocation.

Comment by James A Simmons [ 01/May/14 ]

Thank you Mikhail for the explanation. I have noticed several patches deal with strncpy issues. Why not use the kernels internal kstr* functions instead. This would seem a better way to go. We just have to implement wrappers for the non linux platforms.

Comment by Dmitry Eremin (Inactive) [ 05/May/14 ]

In most places buffer already allocated and usage of kstrndup() is not appropriate. Also I don't think that allocation many little chunks is a good idea. I prefer to allocate big chunk once instead of many small.

Comment by Dmitry Eremin (Inactive) [ 09/Jun/14 ]

Add more patches: http://review.whamcloud.com/#/q/message:LU-4629,n,z

Comment by Peter Jones [ 20/Jun/14 ]

Remaining open patches landed for 2.6. Any future such issues will be tracked under new tickets linked to this one

Comment by Ian Costello [ 21/Oct/14 ]

Hi Peter, Oleg

Could we get this one bug completed with the review process and committed to 2.5?

Thanks,
Ian Costello

Generated at Sat Feb 10 01:44:27 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.