Hacker News new | past | comments | ask | show | jobs | submit | windenntw's comments login

What do you mean "tests"?


Have a system were you wxpect the sandboxing to work and have an automated check that it compiles there?


Part of the backdoor was in the tests. The attacker in this case could easily have sabotaged the test as well if a test was required.


Single Malt, specially Islays, are still very much welcomed :)


Get her to try https://www.escapemotions.com/products/rebelle/about , it is reaaaaally close to the original watercolour finish.


That software is lifetime license only at $70 for the basic and $110 for the pro... I wonder how that pricing model is working in today's day-and-age? It's not common anymore.


Looks cool, thanks!


You can already get that by replacing the cpu with a pistorm:

https://linuxjedi.co.uk/2021/12/27/800mips-amiga-with-emu68-...


Not really. AFAIK it all amounts to something between 600 to 800Mhz for real world code, at best. About the same for affordable FPGAs.

That aside, I don't really get this nostalgy for these systems. I don't care about Doom, or some port of Quake. While 68K assembly was much nicer for me than anything common today, what do I get from that without a usable Browser, Office, "daily driver" apps? Show me how to port Firefox, Chromium or something functionally equivalent to these, and how those perform! :-)

Or Blender.

(Or Android 68K! (Giggle))


If we're talking about an actual, modern 68060 CPU running at multiple GHz, then it would be trivial to run Firefox or Chromium -- just install Debian m68k and compile. :)

Apart from the nostalgy factor, I suspect there would be no actual benefit from such a system. I doubt m68k would compare well to ARM or x64 in terms of compatibility or modern-app performance.


I took a small look at your repo and noticed a possible issue: while Gravis Ultrasound did linear interpolation of samples [1], on Amiga all sample replay was strictly non-interpolated [2] ... essentially on each display scanline the hardware would check the period down-counter and load the next sample if zero was reached.

cf:

[1] http://www.gravisultrasound.com/files/documentation/GUSFAQ.t...

[2] http://bax.comlab.uni-rostock.de/dl/Paula_SystemTheoretic.pd...


Thanks for looking at the repo and for the links! Initially I just used non-interpolated output, but it was extremely noisy. I suspected the Amiga had some additional analog hardware which avoided this, so I just added some interpolation to make it sound better. But anyway, it's far from finished, if I have the time to pick it up again someday I could make it more accurate...



This one is ready made: http://www.apollo-core.com/v4.html


But not suitable for anything Unix or Unix related, because it has no MMU (and likely won't ever have an MMU).


Could you post a bit more info about that binary? (eg: run ldd to dump the used libs, etc)

Could you get some kind of stack trace at the time of the get_thread_area call?

I'd like to be able to pinpoint the call(s) somewhere in

https://codesearch.debian.net/search?q=get_thread_area&perpk...


  # ldd /bin/ls
 libselinux.so.1 => /lib/m68k-linux-gnu/libselinux.so.1 (0xc0028000)
 libc.so.6 => /lib/m68k-linux-gnu/libc.so.6 (0xc004e000)
 /lib/ld.so.1 (0xc0000000)
 libpcre2-8.so.0 => /lib/m68k-linux-gnu/libpcre2-8.so.0 (0xc019e000)
 libdl.so.2 => /lib/m68k-linux-gnu/libdl.so.2 (0xc01f9000)

Both from ld and from libc. HTH

  # strace -o /dev/fd/1 -e get_thread_area -i /bin/ls | cut -f2 -d"[" | cut -f1 -d"]" | sort | uniq
  ????????
  c0018330
  c007313c

  # gdb /bin/ls
  (gdb) break *0xc0018330
  (gdb) r
  Breakpoint 1, __m68k_read_tp () at ../sysdeps/unix/sysv/linux/m68k/m68k- helpers.c:24
  (gdb) bt
  #0  __m68k_read_tp () at ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c:24
  #1  0xc0002e76 in init_tls (naudit=0) at rtld.c:808
  #2  0xc0005318 in dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=<optimized out>, auxv=<optimized out>)
    at rtld.c:2030
  #3  0xc00152c0 in _dl_sysdep_start (start_argptr=0xeffffd20, dl_main=0xc0003704 <dl_main>) at ../elf/dl-sysdep.c:250
  #4  0xc0003194 in _dl_start_final (arg=0xeffffd20, info=0xeffffabe) at rtld.c:489
  #5  0xc000348e in _dl_start (arg=0xeffffd20) at rtld.c:584
  #6  0xc000289c in _start () from /lib/ld.so.1


  (gdb) continue 
  Breakpoint 1, __m68k_read_tp () at ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c:24
  24 in ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c
  (gdb) bt
  #0  __m68k_read_tp () at ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c:24
  #1  0xc000d83e in _dl_fixup (save_a0=-1073325311, save_a1=-1072331548, l=0xc0023a90, reloc_arg=96) at dl-runtime.c:99
  #2  0xc00132ca in _dl_runtime_resolve () at ../sysdeps/m68k/dl-trampoline.S:43

  (gdb) delete breakpoints 
  (gdb) break *0xc007313c
  (gdb) continue 
  Breakpoint 2, __m68k_read_tp () at ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c:24
  24 ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c: No such file or directory.
  (gdb) bt
  #0  __m68k_read_tp () at ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c:24
  #1  0xc0110ce4 in statfs () at ../sysdeps/unix/syscall-template.S:123
  #2  0xc002ffd8 in ?? () from /lib/m68k-linux-gnu/libselinux.so.1
  #3  0xc0047489 in ?? () from /lib/m68k-linux-gnu/libselinux.so.1
  #4  0xeffffbe0 in ?? ()
  #5  0xc004b328 in ?? () from /lib/m68k-linux-gnu/libselinux.so.1
  #6  0x00000001 in ?? ()
  #7  0x8001e31c in stderr ()
  #8  0xc004b480 in ?? () from /lib/m68k-linux-gnu/libselinux.so.1
  #9  0x00000000 in ?? ()

  (gdb) continue 
  Breakpoint 2, __m68k_read_tp () at ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c:24
  24 in ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c
  (gdb) bt
  #0  __m68k_read_tp () at ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c:24
  #1  0xc0073408 in __GI___errno_location () at errno-loc.c:26
  #2  0xc002ffe4 in ?? () from /lib/m68k-linux-gnu/libselinux.so.1
  #3  0xc004b328 in ?? () from /lib/m68k-linux-gnu/libselinux.so.1
  #4  0x00000001 in ?? ()
  #5  0x8001e31c in stderr ()
  #6  0xc004b480 in ?? () from /lib/m68k-linux-gnu/libselinux.so.1
  #7  0x00000000 in ?? ()

  (gdb) continue 
  Breakpoint 2, __m68k_read_tp () at 
  ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c:24
  24 in ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c
  (gdb) bt
  #0  __m68k_read_tp () at ../sysdeps/unix/sysv/linux/m68k/m68k-helpers.c:24
  #1  0xc00c1528 in ptmalloc_init () at arena.c:358
  #2  0xc00c4786 in ptmalloc_init () at arena.c:326
  #3  malloc_hook_ini (sz=304, caller=0xc00b00ec <__fopen_internal+22>) at hooks.c:31
  #4  0xc00c461c in __GI___libc_malloc (bytes=304) at malloc.c:3203
  #5  0xc00b00ec in __fopen_internal (filename=0xc004746d "/proc/filesystems", mode=0xc0047562 "re", is32=1) at iofopen.c:58
  #6  0xc00b01c2 in _IO_new_fopen (filename=0xc004746d "/proc/filesystems", mode=0xc0047562 "re") at iofopen.c:86
  #7  0xc0036c06 in selinuxfs_exists () from /lib/m68k-linux-gnu/libselinux.so.1


  (gdb) disassemble __m68k_read_tp
  Dump of assembler code for function __m68k_read_tp:
     0xc0018328 <+0>: movel #333,%d0
     0xc001832e <+6>: trap #0
  => 0xc0018330 <+8>: moveal %d0,%a0
     0xc0018332 <+10>: rts


  (gdb) info proc mappings 
  process 336
  Mapped address spaces:

 Start Addr   End Addr       Size     Offset objfile
 0x80000000 0x8001b000    0x1b000        0x0 /usr/bin/ls
 0x8001d000 0x8001e000     0x1000    0x1b000 /usr/bin/ls
 0x8001e000 0x8001f000     0x1000    0x1c000 /usr/bin/ls
 0x8001f000 0x80020000     0x1000        0x0 [heap]
 0xc0000000 0xc0020000    0x20000        0x0 /usr/lib/m68k-linux-gnu/ld-2.33.so
 0xc0021000 0xc0022000     0x1000    0x1f000 /usr/lib/m68k-linux-gnu/ld-2.33.so
 0xc0022000 0xc0024000     0x2000    0x20000 /usr/lib/m68k-linux-gnu/ld-2.33.so
 0xc0028000 0xc0049000    0x21000        0x0 /usr/lib/m68k-linux-gnu/libselinux.so.1
 0xc0049000 0xc004b000     0x2000    0x21000 /usr/lib/m68k-linux-gnu/libselinux.so.1
 0xc004b000 0xc004c000     0x1000    0x21000 /usr/lib/m68k-linux-gnu/libselinux.so.1
 0xc004c000 0xc004d000     0x1000    0x22000 /usr/lib/m68k-linux-gnu/libselinux.so.1
 0xc004d000 0xc004e000     0x1000        0x0 
 0xc004e000 0xc018e000   0x140000        0x0 /usr/lib/m68k-linux-gnu/libc-2.33.so
 0xc018e000 0xc0190000     0x2000   0x140000 /usr/lib/m68k-linux-gnu/libc-2.33.so
 0xc0190000 0xc0192000     0x2000   0x140000 /usr/lib/m68k-linux-gnu/libc-2.33.so
 0xc0192000 0xc0196000     0x4000   0x142000 /usr/lib/m68k-linux-gnu/libc-2.33.so
 0xc0196000 0xc019e000     0x8000        0x0 
 0xc019e000 0xc01f3000    0x55000        0x0 /usr/lib/m68k-linux-gnu/libpcre2-8.so.0.10.4
 0xc01f3000 0xc01f5000     0x2000    0x55000 /usr/lib/m68k-linux-gnu/libpcre2-8.so.0.10.4
 0xc01f5000 0xc01f6000     0x1000    0x55000 /usr/lib/m68k-linux-gnu/libpcre2-8.so.0.10.4
 0xc01f6000 0xc01f7000     0x1000    0x56000 /usr/lib/m68k-linux-gnu/libpcre2-8.so.0.10.4
 0xc01f7000 0xc01f9000     0x2000        0x0 
 0xc01f9000 0xc01fb000     0x2000        0x0 /usr/lib/m68k-linux-gnu/libdl-2.33.so
 0xc01fb000 0xc01fe000     0x3000     0x2000 /usr/lib/m68k-linux-gnu/libdl-2.33.so
 0xc01fe000 0xc01ff000     0x1000     0x3000 /usr/lib/m68k-linux-gnu/libdl-2.33.so
 0xc01ff000 0xc0200000     0x1000     0x4000 /usr/lib/m68k-linux-gnu/libdl-2.33.so
 0xeffdf000 0xf0000000    0x21000        0x0 [stack]


excellent, thanks!

so the traced calls would more or less be:

https://sources.debian.org/src/glibc/2.33-3/sysdeps/m68k/tls...

https://sources.debian.org/src/glibc/2.33-3/sysdeps/unix/sys...

Maybe it is all related to errno needing to read the base TLS pointer? https://sources.debian.org/src/linux/5.15.15-1/arch/m68k/ker...

Sounds like we'd benefit from placing the result of calling sys_get_thread_area(void) in the VDSO area and updating it from http://lxr.linux.no/linux+v5.14/arch/m68k/include/asm/entry.... every time we do a process switch


> Maybe it is all related to errno needing to read the base TLS pointer?

Probably everything that uses __thread requires this. e.g. malloc(), or some functions that return pointers to static buffers, and implementators wanted to make them multi-thread safe.

  /*
     The interface of this function is completely stupid,
     it requires a static buffer.  We relax this a bit in 
     that we allow one buffer for each thread.
  */
  static __thread char buffer[18];

  char * inet_ntoa (struct in_addr in)
  {
    unsigned char *bytes = (unsigned char *) &in;
    __snprintf (buffer, sizeof (buffer), "%d.%d.%d.%d",
                bytes[0], bytes[1], bytes[2], bytes[3]);
    return buffer;
  }


Well.. I just noticed that implementation of inet_ntoa in glibc is a bit suspect. Using %d with char, without typecasting to (int) or using %hhd is tricky, and depending on memory alignment rules, and on whether arguments are passed in registers on on the stack this can produce incorrect results.

This is because arguments from the stack can be taken as ints (typically in batches of 4 octects), and put there as char (1 octet typically, but alignment might force it to be aligned to 4 bytes, I guess it depends). Interesting.


errno and malloc() not that surpsising


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: