Description of problem:
clvmd hangs or crash if invalid request sent via /var/run/lvm/clvmd.sock
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. start clvmd
2. run perl -e 'print "\xff"x32' | socat STDIN UNIX-CONNECT:/var/run/lvm/clvmd.sock
clvmd crash or hangs and eat 100% of CPU
no hang or crash occurs
invalid request may send lvm in case of memory pressure or similar problem.
attached patch solved problem for me.
Created attachment 523277 [details]
Yes, this seem to be reasonable fix, thanks.
Slightly modified patch committed upstream, thanks.
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Previously, if clvmd received invalid request through its socket (for example an incomplete header sent), clvmd process could crash or stay in infinite loop.
Additional checks were added so such invalid packet now causes proper error reply to client and clvmd no longer crashes.
Marking verified (SanityOnly).
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.