PAX: overwritten function pointer or return address, bans portage!

title: PAX: overwritten function pointer or return address, bans portage!
---
This first post may only be necessary if further analysis will need to be performed, so it is clear in what state the compromised system is kept for a few more weeks longer.
For the discussion on the Call Trace and the BUG in question and the PAX_RAP in (some) action, go to the next post.
---
You get that if you perform these (and have grsecurity installed and
configured, which if you don't, you may be, IMO, missing some points about
Linux, or do not care at all about security; the latter is many people), this
is from my bash history:
And the last command said this much on the command line:
I use the above method of mounting RO when I need (or like) to have
identifiable dd dumps of my system (quick note: after recovery the MD5 hash of
that dumped partition will not be the one of the time it was taken). Because
that is the system partion, the "/" partition, comprising /var /tmp /usr
/home, in short: complete system except /boot, the file:
Likely, I'll have to mount it RW, else I won't be able to access the contents
of it (I'm not an expert).
But I'm not going to do that in this Air-Gapped system. Because I don't know
if there is any risk involved. Certainly mounting a system RW is not the same
as mounting it RO... I just don't know if there would be any risk involved.
And with my Air-Gapped I practice extreme caution...
So I moved the medium where that image is stored into the same-hardware clone
of this Air-Gapped system, and did a simpler procedure than above, I did this:
And...:
...And that's what happened there.
And now it works fine here in Air-Gapped, mounting it RO:
If anyone on the upward curve of learning Linux is struggling with these
above, I wrote about it years ago now at:
Postfix smtp/TLS, Bkp/Cloning Mthd, Censorship/Intrusion
https://forums.gentoo.org/viewtopic-t-999436.html
where go to PART 2.
I'm only using now the methods of how Air-Gapping (linked from that Gentoo
topic) and backup/cloning is done, to analyze what happened with my system
which at the time of the compromise (three days ago now! --and counting, only
started to write--, boy, did it caught me by surprise! and did I work to
improve things in my systems since! I never even went online since!)...
To analyze what happened with my system which at the time of the compromise
was at the place of the clone (I mean it's the same machine) that I used to
recover the ext4 filesystem, which recover I didn't want to do in the
Air-Gapped system.
(You figure now, I hope, that the cloned system, deploying the methods that I
use, is fully recoverable.)
---
This first post may only be necessary if further analysis will need to be performed, so it is clear in what state the compromised system is kept for a few more weeks longer.
For the discussion on the Call Trace and the BUG in question and the PAX_RAP in (some) action, go to the next post.
---
- Code: Select all
Jan 26 13:11:49 g5n kernel: [24570.397442] grsec: (admin:S:/) exec of /sbin/losetup (losetup /dev/loop1 /mnt/some-where/dd_170123_g0n.JIC/170123_g0n_sda4.dd ) by /sbin/losetup[bash:29221] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:3997] uid/euid:0/0 gid/egid:0/0
Jan 26 13:11:57 g5n kernel: [24577.820950] grsec: (admin:S:/) exec of /sbin/blockdev (blockdev --setro /dev/loop1 ) by /sbin/blockdev[bash:29224] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:3997] uid/euid:0/0 gid/egid:0/0
Jan 26 13:11:59 g5n kernel: [24579.808741] grsec: (admin:S:/) exec of /sbin/blockdev (blockdev --getro /dev/loop1 ) by /sbin/blockdev[bash:29226] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:3997] uid/euid:0/0 gid/egid:0/0
Jan 26 13:12:13 g5n kernel: [24594.256370] grsec: (admin:S:/) exec of /bin/mount (mount /dev/loop1 /mnt/170123_g0n-r/ ) by /bin/mount[bash:29227] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:3997] uid/euid:0/0 gid/egid:0/0
Jan 26 13:12:13 g5n kernel: [24594.341678] grsec: (:::kernel::::S:/) exec of /bin/kmod (/sbin/modprobe -q -- fs-crypto_LUKS grsec_modharden_fs ) by /bin/kmod[kworker/u8:4:29229] uid/euid:0/0 gid/egid:0/0, parent /[kworker/u8:4:29105] uid/euid:0/0 gid/egid:0/0
Jan 26 13:12:26 g5n kernel: [24607.496953] grsec: (admin:S:/) exec of /sbin/cryptsetup (cryptsetup luksOpen /dev/loop1 170123_g0n-r ) by /sbin/cryptsetup[bash:29231] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:3997] uid/euid:0/0 gid/egid:0/0
Jan 26 13:12:37 g5n kernel: [24618.251423] grsec: (admin:S:/) exec of /bin/mount (mount /dev/mapper/170123_g0n-r /mnt/170123_g0n-r/ ) by /bin/mount[bash:29245] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:3997] uid/euid:0/0 gid/egid:0/0
Jan 26 13:12:38 g5n kernel: [24618.617938] EXT4-fs (dm-3): INFO: recovery required on readonly filesystem
Jan 26 13:12:38 g5n kernel: [24618.617940] EXT4-fs (dm-3): write access unavailable, cannot proceed
You get that if you perform these (and have grsecurity installed and
configured, which if you don't, you may be, IMO, missing some points about
Linux, or do not care at all about security; the latter is many people), this
is from my bash history:
- Code: Select all
686 losetup /dev/loop1 /mnt/some-where/dd_170123_g0n.JIC/170123_g0n_sda4.dd
687 blockdev --setro /dev/loop1
688 blockdev --getro /dev/loop1
689 mount /dev/loop1 /mnt/170123_g0n-r/
690 cryptsetup luksOpen /dev/loop1 170123_g0n-r
691 mount /dev/mapper/170123_g0n-r /mnt/170123_g0n-r/
And the last command said this much on the command line:
- Code: Select all
# mount /dev/mapper/170123_g0n-r /mnt/170123_g0n-r/
mount: /dev/mapper/170123_g0n-r is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/mapper/170123_g0n-r,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
#
I use the above method of mounting RO when I need (or like) to have
identifiable dd dumps of my system (quick note: after recovery the MD5 hash of
that dumped partition will not be the one of the time it was taken). Because
that is the system partion, the "/" partition, comprising /var /tmp /usr
/home, in short: complete system except /boot, the file:
- Code: Select all
# ls -l /mnt/some-where/dd_170123_g0n.JIC/170123_g0n_sda4.dd
-rw-r--r-- 1 root root 71167246848 2017-01-23 20:18 /mnt/some-where/dd_170123_g0n.JIC/170123_g0n_sda4.dd
#
Likely, I'll have to mount it RW, else I won't be able to access the contents
of it (I'm not an expert).
But I'm not going to do that in this Air-Gapped system. Because I don't know
if there is any risk involved. Certainly mounting a system RW is not the same
as mounting it RO... I just don't know if there would be any risk involved.
And with my Air-Gapped I practice extreme caution...
So I moved the medium where that image is stored into the same-hardware clone
of this Air-Gapped system, and did a simpler procedure than above, I did this:
- Code: Select all
# cryptsetup luksOpen /mnt/sdg1/dd_Add/dd_170123_g0n.JIC/170123_g0n_sda4.dd 170123_g0n-r
# mount /dev/mapper/170123_g0n-r /mnt/170123_g0n-r/
And...:
- Code: Select all
Jan 26 14:13:03 g0n kernel: [21695.817744] grsec: (admin:S:/) exec of /bin/mount (mount /mnt/sdg1/dd_Add/dd_170123_g0n.JIC/170123_g0n_sda4.dd /mnt/170123_g0n-r/ ) by /bin/mount[bash:5463] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:4245] uid/euid:0/0 gid/egid:0/0
Jan 26 14:13:04 g0n kernel: [21696.483879] grsec: (:::kernel::::S:/) exec of /bin/kmod (/sbin/modprobe -q -- fs-crypto_LUKS grsec_modharden_fs ) by /bin/kmod[kworker/u8:1:5468] uid/euid:0/0 gid/egid:0/0, parent /[kworker/u8:1:5418] uid/euid:0/0 gid/egid:0/0
Jan 26 14:13:26 g0n kernel: [21718.947863] grsec: (admin:S:/) exec of /sbin/cryptsetup (cryptsetup luksOpen /mnt/sdg1/dd_Add/dd_170123_g0n.JIC/170123_g0n_sda4.dd 170123_g0n-r ) by /sbin/cryptsetup[bash:5469] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:4245] uid/euid:0/0 gid/egid:0/0
Jan 26 14:14:16 g0n kernel: [21768.433008] grsec: (admin:S:/) exec of /bin/mount (mount /dev/mapper/170123_g0n-r /mnt/170123_g0n-r/ ) by /bin/mount[bash:5482] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:4245] uid/euid:0/0 gid/egid:0/0
Jan 26 14:14:17 g0n kernel: [21769.724488] EXT4-fs (dm-2): recovery complete
Jan 26 14:14:17 g0n kernel: [21769.778511] EXT4-fs (dm-2): mounted filesystem with ordered data mode. Opts: (null)
Jan 26 14:14:17 g0n kernel: [21769.778556] grsec: (admin:S:/) mount of /dev/mapper/170123_g0n-r to /mnt/170123_g0n-r by /bin/mount[mount:5482] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:4245] uid/euid:0/0 gid/egid:0/0
...And that's what happened there.
And now it works fine here in Air-Gapped, mounting it RO:
- Code: Select all
g5n ~ # losetup /dev/loop1 /mnt/sdg1/dd_Add/dd_170123_g0n.JIC/170123_g0n_sda4.dd
g5n ~ # ^C
g5n ~ # blockdev --setro /dev/loop1
g5n ~ # blockdev --getro /dev/loop1
1
g5n ~ # cryptsetup luksOpen /dev/loop1 170123_g0n-r
Enter passphrase for /mnt/sdg1/dd_Add/dd_170123_g0n.JIC/170123_g0n_sda4.dd:
g5n ~ # mount /dev/mapper/170123_g0n-r /mnt/170123_g0n-r/
mount: /dev/mapper/170123_g0n-r is write-protected, mounting read-only
g5n ~ #
If anyone on the upward curve of learning Linux is struggling with these
above, I wrote about it years ago now at:
Postfix smtp/TLS, Bkp/Cloning Mthd, Censorship/Intrusion
https://forums.gentoo.org/viewtopic-t-999436.html
where go to PART 2.
I'm only using now the methods of how Air-Gapping (linked from that Gentoo
topic) and backup/cloning is done, to analyze what happened with my system
which at the time of the compromise (three days ago now! --and counting, only
started to write--, boy, did it caught me by surprise! and did I work to
improve things in my systems since! I never even went online since!)...
To analyze what happened with my system which at the time of the compromise
was at the place of the clone (I mean it's the same machine) that I used to
recover the ext4 filesystem, which recover I didn't want to do in the
Air-Gapped system.
(You figure now, I hope, that the cloned system, deploying the methods that I
use, is fully recoverable.)