From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753241AbdLSV4E (ORCPT ); Tue, 19 Dec 2017 16:56:04 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:37974 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbdLSV4B (ORCPT ); Tue, 19 Dec 2017 16:56:01 -0500 Date: Tue, 19 Dec 2017 13:55:59 -0800 From: Andrew Morton To: Vineet Gupta Cc: Sudip Mukherjee , , Arnd Bergmann , "Alexey Brodkin" , arcml Subject: Re: [PATCH v2] arch: define weak abort Message-Id: <20171219135559.07104711eb9301f5f40a338f@linux-foundation.org> In-Reply-To: References: <1513118956-8718-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Dec 2017 13:39:22 -0800 Vineet Gupta wrote: > > --- a/kernel/exit.c > > +++ b/kernel/exit.c > > @@ -1759,3 +1759,11 @@ long kernel_wait4(pid_t upid, int __user *stat_addr, int options, > > return -EFAULT; > > } > > #endif > > + > > +__weak void abort(void) > > +{ > > + BUG(); > > + > > + /* if that doesn't kill us, halt */ > > + panic("Oops failed to kill thread"); > > +} > > Hmm, I realize there's a small gotcha with this, when testing with a different > patch from Arnd. This needs an EXPORT_SYMBOL() as well ! Yup. This? From: Andrew Morton Subject: kernel/exit.c: export abort() to modules gcc -fisolate-erroneous-paths-dereference can generate calls to abort() from modular code too. Reported-by: Vineet Gupta Cc: Sudip Mukherjee Cc: Arnd Bergmann Cc: "Alexey Brodkin" Signed-off-by: Andrew Morton --- kernel/exit.c | 1 + 1 file changed, 1 insertion(+) diff -puN kernel/exit.c~a kernel/exit.c --- a/kernel/exit.c~a +++ a/kernel/exit.c @@ -1763,3 +1763,4 @@ __weak void abort(void) /* if that doesn't kill us, halt */ panic("Oops failed to kill thread"); } +EXPORT_SYMBOL(abort); _