Bug#798283: clvmd: stack smashing detected -- solved

Adi Kriegisch adi at kriegisch.at
Wed Sep 9 09:10:10 UTC 2015


Tags: patch
Severity: important

Hey!

I finally found the source of the problem: During cluster initialization an
int is casted to a uint64_t which triggered the stack protection in gcc-4.9:
  | int select_fd;
  | (...)
  | saLckSelectionObjectGet(lck_handle, (SaSelectionObjectT *)&select_fd);

I fixed the issue by declaring select_fd as uint64_t, as SaSelectionObjectT
defined in /usr/include/openais/saAis.h is:
  | typedef uint64_t SaUint64T;
  | typedef SaUint64T SaSelectionObjectT;

To make the issue more explicit I casted it back to an int. Patch is
attached.

-- Adi

PS: What I do not understand is why gcc-4.9 does not raise this issue at
compile time: all type information is already there...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clvmd-openais-stack-protection.patch
Type: text/x-diff
Size: 622 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-lvm-maintainers/attachments/20150909/b9979ce8/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-lvm-maintainers/attachments/20150909/b9979ce8/attachment.sig>


More information about the pkg-lvm-maintainers mailing list