I bought a second-hand laptop from a stranger. My (totally unjustified) concern is that there might be malware on the device.
According to this answer, there is no easy fix if it's malicious firmware. I don't know how easy it is to implant malicious firmware, so I have no idea if this should be a legitimate concern.
If the malware is on the disk however, that seems to be easier. The laptop I bought has a SATA SSD. Here are the steps I followed :
The laptop came with what looked like a fresh W10 install.
I installed Manjaro with the graphical installer, presumably wiping W10 from the drive.
I then booted again on the Manjaro Live USB and followed the Arch Wiki instructions for a SATA drive to wipe /dev/sda.
hdparm -I /dev/sda
displayed6min for SECURITY ERASE UNIT. 6min for ENHANCED SECURITY ERASE UNIT.
which, according to the best answer here, means that there was no secure erase of the disk, simply a deletion of the "native" (meaning that it's something intrinsic to how the SSD works , not user controlled) encryption key of the disc, as far as I understand.
The question is : if there was any malware on the disk, is that enough to make sure it can never affect me?
I have no understanding of malware and only basic understanding of encryption, so I'm not sure that wiping the SSD encryption key without overwriting the data on it will actually prevent the malware from running.
The Arch Wiki mentions many other options (cat, dd, shred, etc.) to overwrite the disk data, but the most upvoted answer here states that, with an SSD (because of wear leveling), these other options do not actually overwrite the disk, but instead write zeroes/random data to new blocks.