Re: [PATCH v4 1/2] m68k: Handle __generic_copy_to_user faults more carefully

Greg Ungerer
2024-08-09T12:58:14Z

Hi Michael, Finn,

On 9/8/24 18:03, Michael Schmitz wrote:
> Hi Finn,
>
> Am 09.08.2024 um 15:34 schrieb Finn Thain:
>>
>> On Fri, 9 Aug 2024, Michael Schmitz wrote:
>>
>>>>
>>>> I tried out the "stress-ng --sysbadaddr -1" test, and that didn't go
>>>> so well for me:
>>>>
>>>> # stress-ng --sysbadaddr -1
>>>> stress-ng: info:  [37] defaulting to a 86400 second (1 day, 0.00
>>>> secs) run
>>>> per stressor
>>>> stress-ng: info:  [37] dispatching hogs: 1 sysbadaddr
>>>> *** ILLEGAL INSTRUCTION ***   FORMAT=4
>>>> Current process id is 39
>>>> BAD KERNEL TRAP: 00000000
>>>> Modules linked in:
>>>> PC: [<00000000>] 0x0
>>>> SR: 2004  SP: 6504e563  a2: 008ee380
>>>> d0: 000000f7    d1: 00000000    d2: 00000000    d3: 00000000
>>>> d4: 00a87b80    d5: bfbf3814    a0: 00000000    a1: bfbf3814
>>>> Process stress-ng-sysba (pid: 39, task=4dbb2ec5)
>>>> Frame format=4 eff addr=480a2004 pc=0002b154
>>>> Stack from 00adff20:
>>>>         00ade000 00000000 00000000 000000f7 00000000 00000004 00a87b80
>>>> 00000000
>>>>         00000000 00000000 00000000 008ee380 0002ab5c 00000100 00000122
>>>> fffffff6
>>>>         bfbf376c 0002b29e 000000f7 bfbf3814 00000000 00000000 00ade000
>>>> 0002b222
>>>>         00ae0800 80118988 00000000 00000005 bfbf37a0 00000005 bfbf3814
>>>> 00adffcc
>>>>         00023d2c 00adffcc 00000000 00000000 00000000 00000000 000000f7
>>>> 00000000
>>>>         80118b46 00021850 00024b00 000000f7 bfbf3814 00000000 00000000
>>>> bfbf3814
>>>> Call Trace: [<0002ab5c>] child_wait_callback+0x0/0x24
>>>>  [<0002b29e>] sys_wait4+0x7c/0x8e
>>>>  [<0002b222>] sys_wait4+0x0/0x8e
>>>>  [<00023d2c>] buserr_c+0xb0/0x152
>>>>  [<00021850>] buserr+0x28/0x30
>>>>  [<00024b00>] system_call+0x54/0xa8
>>>>
>>>> But that is the same with and without these patches.
>>>
>>> I wonder if recent signal handling changes (e.g. commit
>>> 0d4276cfbe6fd4c4a21acdee803b05a3a6192082) have rare unexpected side
>>> effects on
>>> Coldfire here ... OTOH, signal handling as such works just fine, right?
>>>
>>
>> That would be commit b845b574f86d ("m68k: Move signal frame following
>> exception on 68020/030") on mainline. If it caused a regression, that
>> would have first appeared in v6.4. I can't imagine how that commit could
>> affect Coldfire but that's no reason not to test an older kernel.
>
> Yes, testing older kernels is certainly the fastest way to rule out
> involvement of that commit.

I will go back a few revisions and see if I can shed some light on it.

Regards
Greg

> On a closer look, there is no possible way in that this commit can be
> responsible for the bug unless Coldfire does use frame format B for
> access errors. I don't think that's likely?
>
>> FWIW, my hunch is that the other stressors which call wait4() will
>> probably crash too (regardless of kernel version).
>
> Quite likely ...
>
> Cheers,
>
>     Michael
>
>
>