[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Seccomp support for linux-m68k



Hi Andreas,

On 27/07/20 9:08 AM, Andreas Schwab wrote:
On Jul 27 2020, Michael Schmitz wrote:

Hi Andreas,

On 26/07/20 11:03 PM, Andreas Schwab wrote:
On Jul 26 2020, Michael Schmitz wrote:

No particular reason - I had seen testb used in the syscall entry code and
Where?  That may be bugs.
Here:

ENTRY(ret_from_signal)
         movel   %curptr@(TASK_STACK),%a1
         tstb    %a1@(TINFO_FLAGS+2)
         jge     1f
         jbsr    syscall_trace_leave
1:      RESTORE_SWITCH_STACK
         addql   #4,%sp
....

and here:

ENTRY(system_call)
         SAVE_ALL_SYS

         GET_CURRENT(%d1)
         movel   %d1,%a1

         | save top of frame
         movel   %sp,%curptr@(TASK_THREAD+THREAD_ESP0)

         | syscall trace?
         tstb    %a1@(TINFO_FLAGS+2)
         jmi     do_trace_entry
         cmpl    #NR_syscalls,%d0
         jcc     badsys

How is that relevant?  That is testing a single bit, of course.

No, tstb tests a byte operand. btst tests a bit. And testing the second byte of the thread info flags is just what we need if the trace bits are 14 and 15.

(Had to look up the m68k programmer's reference and check to be sure, admittedly.)

Cheers,

    Michael


Andreas.



Reply to: