From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666AbdBNA1W (ORCPT ); Mon, 13 Feb 2017 19:27:22 -0500 Received: from mail.kernel.org ([198.145.29.136]:42746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751408AbdBNA1V (ORCPT ); Mon, 13 Feb 2017 19:27:21 -0500 Date: Tue, 14 Feb 2017 09:27:11 +0900 From: Masami Hiramatsu To: Andrey Ryabinin Cc: , , Alexander Potapenko , Dmitry Vyukov Subject: Re: [PATCH] [TRIVIAL] kasan: Add a prototype of task_struct to avoid warning Message-Id: <20170214092711.e0f8559272542a948346d647@kernel.org> In-Reply-To: <96010656-62a2-a4e1-3fc2-1c41b6caffe3@virtuozzo.com> References: <148699609915.25482.4216286293667050154.stgit@devbox> <96010656-62a2-a4e1-3fc2-1c41b6caffe3@virtuozzo.com> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; 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 Mon, 13 Feb 2017 18:06:34 +0300 Andrey Ryabinin wrote: > > > On 02/13/2017 05:28 PM, Masami Hiramatsu wrote: > > Add a prototype of task_struct to fix below warning on arm64. > > > > CC arch/arm64/kernel/probes/kprobes.o > > In file included from /tmp/linux/arch/arm64/kernel/probes/kprobes.c:19:0: > > /tmp/linux/include/linux/kasan.h:81:53: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration > > static inline void kasan_unpoison_task_stack(struct task_struct *task) {} > > ^~~~~~~~~~~ > > > What tree is that? > I can't see how is this possible on upstream or -next. kasan.h includes linux/sched.h so it supposed to know about task_struct. > Also is the first include in kprobes, so it can't be a header recursion. Ah, sorry, I used a bit older -tip tree. I confirmed it was solved. > > BTW, arch/arm64/kernel/probes/kprobes.c no longer needs since > commit ad05711cec12131e1277ce749a99d08ecf233aa7 ("arm64: Remove stack duplicating code from jprobes") OK, thank you for checking. Please drop this. > > > > As same as other types (kmem_cache, page, and vm_struct) > > this adds a prototype of task_struct data structure on > > top of kasan.h. > > > > Signed-off-by: Masami Hiramatsu > > Cc: Andrey Ryabinin > > Cc: Alexander Potapenko > > Cc: Dmitry Vyukov > > --- > > include/linux/kasan.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/include/linux/kasan.h b/include/linux/kasan.h > > index 820c0ad..c9df9e1 100644 > > --- a/include/linux/kasan.h > > +++ b/include/linux/kasan.h > > @@ -7,6 +7,7 @@ > > struct kmem_cache; > > struct page; > > struct vm_struct; > > +struct task_struct; > > > > #ifdef CONFIG_KASAN > > > > -- Masami Hiramatsu