Discussion:
Allow make test with ASan / --address-sanitizer
Andrew Bartlett via samba-technical
2018-05-03 04:35:45 UTC
Permalink
I needed to get AddressSanitizer working to fix the LSA use-after-free
bug and the attached make it all work again.

Recent versions of GCC require that the library be in LD_PRELOAD before
anything that is linked with libasan. I use a horrible ldd hack to
find the right library path (sorry, not sorry).

Once we get a more modern sn-devel I'll enable this by default in
autobuild.

Please review and push!

Andrew Bartlett
--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team https://samba.org
Samba Development and Support, Catalyst IT
https://catalyst.net.nz/services/samba
William Brown via samba-technical
2018-05-03 04:57:39 UTC
Permalink
On Thu, 2018-05-03 at 16:35 +1200, Andrew Bartlett via samba-technical
Post by Andrew Bartlett via samba-technical
I needed to get AddressSanitizer working to fix the LSA use-after-
free
bug and the attached make it all work again.
Recent versions of GCC require that the library be in LD_PRELOAD before
anything that is linked with libasan. I use a horrible ldd hack to
find the right library path (sorry, not sorry).
It's what you have to do because of python being in the way. It's fine
...
Post by Andrew Bartlett via samba-technical
Once we get a more modern sn-devel I'll enable this by default in
autobuild.
Please review and push!
Andrew Bartlett
Looks good to me, I can't wait to use this more seriously!

Thanks for this,

William
Andrew Bartlett via samba-technical
2018-05-03 05:06:07 UTC
Permalink
On Thu, 2018-05-03 at 16:57 +1200, William Brown via samba-technical
Post by William Brown via samba-technical
On Thu, 2018-05-03 at 16:35 +1200, Andrew Bartlett via samba-technical
Post by Andrew Bartlett via samba-technical
I needed to get AddressSanitizer working to fix the LSA use-after-
free
bug and the attached make it all work again.
Recent versions of GCC require that the library be in LD_PRELOAD before
anything that is linked with libasan. I use a horrible ldd hack to
find the right library path (sorry, not sorry).
It's what you have to do because of python being in the way. It's fine
...
Post by Andrew Bartlett via samba-technical
Once we get a more modern sn-devel I'll enable this by default in
autobuild.
Please review and push!
Andrew Bartlett
Looks good to me, I can't wait to use this more seriously!
A good way to help would be make autobuild.py take an --address-
sanitizer option (that we will eventually make the default) so we can
start trying to do the full build with ASan.

Andrew Bartlett
--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team https://samba.org
Samba Development and Support, Catalyst IT
https://catalyst.net.nz/services/samba
Andrew Bartlett via samba-technical
2018-05-03 05:01:05 UTC
Permalink
On Thu, 2018-05-03 at 16:35 +1200, Andrew Bartlett via samba-technical
Post by Andrew Bartlett via samba-technical
I needed to get AddressSanitizer working to fix the LSA use-after-free
bug and the attached make it all work again.
Recent versions of GCC require that the library be in LD_PRELOAD before
anything that is linked with libasan. I use a horrible ldd hack to
find the right library path (sorry, not sorry).
Once we get a more modern sn-devel I'll enable this by default in
autobuild.
Please review and push!
Douglas has reviewed it and this is in autoubuild.

Thanks,

Andrew Bartlett
--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team https://samba.org
Samba Development and Support, Catalyst IT
https://catalyst.net.nz/services/samba
Andrew Bartlett via samba-technical
2018-05-03 07:20:51 UTC
Permalink
On Thu, 2018-05-03 at 16:35 +1200, Andrew Bartlett via samba-technical
Post by Andrew Bartlett via samba-technical
I needed to get AddressSanitizer working to fix the LSA use-after-free
bug and the attached make it all work again.
Recent versions of GCC require that the library be in LD_PRELOAD before
anything that is linked with libasan. I use a horrible ldd hack to
find the right library path (sorry, not sorry).
Once we get a more modern sn-devel I'll enable this by default in
autobuild.
And this patch allows a developer build with --address-sanitizer
enabled.

Please review this also.

Thanks!

Andrew Bartlett
--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
Alexander Bokovoy via samba-technical
2018-05-03 08:18:06 UTC
Permalink
Post by William Brown via samba-technical
On Thu, 2018-05-03 at 16:35 +1200, Andrew Bartlett via samba-technical
Post by Andrew Bartlett via samba-technical
I needed to get AddressSanitizer working to fix the LSA use-after-free
bug and the attached make it all work again.
Recent versions of GCC require that the library be in LD_PRELOAD before
anything that is linked with libasan. I use a horrible ldd hack to
find the right library path (sorry, not sorry).
Once we get a more modern sn-devel I'll enable this by default in
autobuild.
And this patch allows a developer build with --address-sanitizer
enabled.
Please review this also.
LGTM.

Pushed to autobuild.
--
/ Alexander Bokovoy
Gary Lockyer via samba-technical
2018-05-04 01:00:39 UTC
Permalink
I've had a little play with this, it does blow out the test run times in
the order of 5 to 6 times. And there do appear to be issues, I currently
don't have the time to chase these down.

Cheers
Gary
Post by Alexander Bokovoy via samba-technical
Post by William Brown via samba-technical
On Thu, 2018-05-03 at 16:35 +1200, Andrew Bartlett via samba-technical
Post by Andrew Bartlett via samba-technical
I needed to get AddressSanitizer working to fix the LSA use-after-free
bug and the attached make it all work again.
Recent versions of GCC require that the library be in LD_PRELOAD before
anything that is linked with libasan. I use a horrible ldd hack to
find the right library path (sorry, not sorry).
Once we get a more modern sn-devel I'll enable this by default in
autobuild.
And this patch allows a developer build with --address-sanitizer
enabled.
Please review this also.
LGTM.
Pushed to autobuild.
William Brown via samba-technical
2018-05-04 01:35:13 UTC
Permalink
On Fri, 2018-05-04 at 13:00 +1200, Gary Lockyer via samba-technical
Post by Gary Lockyer via samba-technical
I've had a little play with this, it does blow out the test run times in
the order of 5 to 6 times. And there do appear to be issues, I
currently
don't have the time to chase these down.
The extra time is expected - it is intercepting your malloc/free calls
after all.

Given that we now have the ability to run this, it makes it easier to
pick up the issues later, it's good enough that we have the ability to
find these now.
Post by Gary Lockyer via samba-technical
Cheers
Gary
Post by Alexander Bokovoy via samba-technical
Post by William Brown via samba-technical
On Thu, 2018-05-03 at 16:35 +1200, Andrew Bartlett via samba-
technical
Post by Andrew Bartlett via samba-technical
I needed to get AddressSanitizer working to fix the LSA use-
after-free
bug and the attached make it all work again.
Recent versions of GCC require that the library be in
LD_PRELOAD before
anything that is linked with libasan. I use a horrible ldd hack to
find the right library path (sorry, not sorry).
Once we get a more modern sn-devel I'll enable this by default in
autobuild.
And this patch allows a developer build with --address-sanitizer
enabled.
Please review this also.
LGTM.
Pushed to autobuild.
Loading...