Saturday, 11 May 2019

OpenBSD and post release ... status

Hi folks,

Had been warned by other openbsd folks there is a new MAP_CONCEAL feature (and consumers called malloc_conceal/calloc_conceal (a realloc_conceal is absolutely not necessary, the address will keep the flag internally), I decided to rebuild the whole system despite having done this just last night. This is interesting feature, controlling the informations you want to disclose for debugging. To be more concrete, let's use a very basic C++ application reading an external file containing sensitive information, purposely generating a core dump :


#include <sys/mman.h>
#include <sys/stat.h>
#include <string>
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <iostream>

int main(int argc, char **argv) {
...
                auto st = fstat(fd, &s);
                auto sz = s.st_size;
                auto flg = MAP_PRIVATE;
#if defined(HIDEIT)
                flg |= MAP_CONCEAL;
#endif
                auto p = ::mmap(nullptr, sz, PROT_READ|PROT_WRITE, flg, fd, 0);
                if (p != MAP_FAILED) {
                        auto str = reinterpret_cast<char *>(p);
                        ::raise(SIGSEGV);
                        ::munmap(p, sz);
...
        return 0;

}

The version without the new flag would disclose the value of the mapped file content as you can see


gdb ./test_without ./test_without.core
...
(gdb) f 1  
#1  0x000006c2da1db473 in main (argc=2, argv=0x7f7ffffc3548) at test_conceal.cc:26
26 ::raise(SIGSEGV);
(gdb) p str
$1 = 0x6c5d77c5000 "My credit card number -- whoooops\n"
...

whereas the version with the new flag ...

gdb ./test_with ./test_with.core
... f 1
#1  0x000006e7271c1484 in main (argc=2, argv=0x7f7ffffcc868) at test_conceal.cc:26
26 ::raise(SIGSEGV);
(gdb) p str
$1 = 0x6e9b7336000 <Address 0x6e9b7336000 out of bounds>

It can be useful that's for sure, we shall see if other operating systems would implement similar feature (edit they do but via madvise) ...
Also if like me you possess a Thinkpad with AMD Ryzen, I would recommend following up this topic from openbsd-misc. The GPU driver had been updated but still the kernel need to be updated accordingly before being able to feel its full potential ...

To finish with OpenBSD, there who is still very active on advertising video games, had updated the list, just to remind there is quite a handful possibility to entertain yourself even on a pretty secure os as this one ;-) His enthusiasm is a nice thing to see !


Labels: , , , ,

View David Carlier's profile on LinkedIn

Thursday, 18 October 2018

Further releases ...

... on this surprising hot autumn here in the emerald island.

Today, no real surprise, OpenBSD 6.4 is out, so before the 1st of November, here the "changelog". I think from now we can start to forget the old 1st May/1st November hardcoded dates :-)

radare2 finally got to 3.0.0 but there is a quick 3.0.1 "hotfix" version already scheduled (today or tomorrow). Also autumn is the sign of life coming down :-) so FreeBSD 10.4 End of Life is soon-ish albeit the date is not hardcoded yet. FreeBSD 11 and soon FreeBSD 12 have sufficiently new features and stability to be interesting, I personally appreciate the shorter lifetime of FreeBSD releases between major branches, compared to how it used to be ...

Months ago mentioned couple of times people reporting issues with Intel components. In a personal level, I started to move towards AMD and its Ryzen branding as a new OpenBSD machine. Some people might be more interested by ARM laptops instead. No disappointment so far, the extra power will serve me right for LLVM builds as well. You can find people who tested this sort of combo like qbit here. Also pypy will finally have a major bump version resulted from a patch I did quite a time ago (and which I almost forgot :-)).

Labels: , , , , ,

View David Carlier's profile on LinkedIn