Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Potential BUG_ON() in do_group_exit() on 4.17.2
@ 2018-06-27 12:13 Georgi Guninski
  2018-06-27 21:14 ` James Hogan
  0 siblings, 1 reply; 3+ messages in thread
From: Georgi Guninski @ 2018-06-27 12:13 UTC (permalink / raw)
  To: linux-mips

Does this BUG_ON() gets hit on mips?

in 4.17.2 ./kernel/exit.c

do_group_exit(int exit_code)
{
	struct signal_struct *sig = current->signal;

	BUG_ON(exit_code & 0x80);

|do_group_exit| is called from

./kernel/signal.c:2482:		do_group_exit(ksig->info.si_signo);

Appears to me si_signo can be 0x80 (in decimal 128) because of:

arch/mips/include/uapi/asm/signal.h:15:#define _NSIG		128

Probably testcase will be:
$kill -128 `pidof program`

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Potential BUG_ON() in do_group_exit() on 4.17.2
  2018-06-27 12:13 Potential BUG_ON() in do_group_exit() on 4.17.2 Georgi Guninski
@ 2018-06-27 21:14 ` James Hogan
  2018-06-28  6:28   ` Georgi Guninski
  0 siblings, 1 reply; 3+ messages in thread
From: James Hogan @ 2018-06-27 21:14 UTC (permalink / raw)
  To: Georgi Guninski; +Cc: linux-mips

On Wed, Jun 27, 2018 at 03:13:02PM +0300, Georgi Guninski wrote:
> Does this BUG_ON() gets hit on mips?
> 
> in 4.17.2 ./kernel/exit.c
> 
> do_group_exit(int exit_code)
> {
> 	struct signal_struct *sig = current->signal;
> 
> 	BUG_ON(exit_code & 0x80);
> 
> |do_group_exit| is called from
> 
> ./kernel/signal.c:2482:		do_group_exit(ksig->info.si_signo);
> 
> Appears to me si_signo can be 0x80 (in decimal 128) because of:
> 
> arch/mips/include/uapi/asm/signal.h:15:#define _NSIG		128
> 
> Probably testcase will be:
> $kill -128 `pidof program`

I've hit this by accident before, while tweaking GDB on MIPS. See here:

[RFC] kernel/signal.c: avoid BUG_ON with SIG128 (MIPS):
https://patchwork.linux-mips.org/patch/5343/

[v2] MIPS: Reduce _NSIG from 128 to 127 to avoid BUG_ON:
https://patchwork.linux-mips.org/patch/5461/

[v3] kernel/signal.c: fix BUG_ON with SIG128 (MIPS):
https://patchwork.linux-mips.org/patch/5538/
https://patchwork.linux-mips.org/patch/5550/

[v4] MIPS: Reduce _NSIG from 128 to 127 to avoid BUG_ON:
https://patchwork.linux-mips.org/patch/5564/

I think the fear of subtle user ABI breakage was probably prominent in
why it never got properly fixed. It'd be nice to get some resolution
though.

Cheers
James

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Potential BUG_ON() in do_group_exit() on 4.17.2
  2018-06-27 21:14 ` James Hogan
@ 2018-06-28  6:28   ` Georgi Guninski
  0 siblings, 0 replies; 3+ messages in thread
From: Georgi Guninski @ 2018-06-28  6:28 UTC (permalink / raw)
  To: James Hogan; +Cc: linux-mips

On Wed, Jun 27, 2018 at 10:14:04PM +0100, James Hogan wrote:
> I've hit this by accident before, while tweaking GDB on MIPS. See here:
> 
> [RFC] kernel/signal.c: avoid BUG_ON with SIG128 (MIPS):
> https://patchwork.linux-mips.org/patch/5343/
>

Thanks. Does kernel execution on mips continue after BUG_ON() or is it
like panic()?
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-28  6:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-27 12:13 Potential BUG_ON() in do_group_exit() on 4.17.2 Georgi Guninski
2018-06-27 21:14 ` James Hogan
2018-06-28  6:28   ` Georgi Guninski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox