linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-next 0/2] Fix kasan compilation warnings
@ 2020-05-12  6:37 Leon Romanovsky
  2020-05-12  6:37 ` [PATCH rdma-next 1/2] kasan: fix compilation warnings due to missing function prototypes Leon Romanovsky
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Leon Romanovsky @ 2020-05-12  6:37 UTC (permalink / raw)
  To: Andrew Morton, Andrey Konovalov, Andrey Ryabinin
  Cc: Leon Romanovsky, Ingo Molnar, kasan-dev, linux-kernel, linux-mm,
	Michal Marek, Peter Zijlstra

From: Leon Romanovsky <leonro@mellanox.com>

Hi,

The following two fixes are adding missing function prototypes
declarations to internal kasan header in order to eliminate compilation
warnings.

Thanks

Leon Romanovsky (2):
  kasan: fix compilation warnings due to missing function prototypes
  kasan: add missing prototypes to fix compilation warnings

 mm/kasan/common.c |  3 ---
 mm/kasan/kasan.h  | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

--
2.26.2


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

* [PATCH rdma-next 1/2] kasan: fix compilation warnings due to missing function prototypes
  2020-05-12  6:37 [PATCH rdma-next 0/2] Fix kasan compilation warnings Leon Romanovsky
@ 2020-05-12  6:37 ` Leon Romanovsky
  2020-05-12  6:37 ` [PATCH rdma-next 2/2] kasan: add missing prototypes to fix compilation warnings Leon Romanovsky
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2020-05-12  6:37 UTC (permalink / raw)
  To: Andrew Morton, Andrey Konovalov, Andrey Ryabinin
  Cc: Leon Romanovsky, kasan-dev, linux-mm, Michal Marek, linux-kernel

From: Leon Romanovsky <leonro@mellanox.com>

__asan_report_* function generates the following warnings while compiling
kernel, add them to the internal header to be aligned with other __asan_*
function prototypes.

mm/kasan/generic_report.c:130:6: warning: no previous prototype for '__asan_report_load1_noabort' [-Wmissing-prototypes]
  130 | void __asan_report_load##size##_noabort(unsigned long addr) \
      |      ^~~~~~~~~~~~~~~~~~
mm/kasan/generic_report.c:143:1: note: in expansion of macro 'DEFINE_ASAN_REPORT_LOAD'
  143 | DEFINE_ASAN_REPORT_LOAD(1);
      | ^~~~~~~~~~~~~~~~~~~~~~~

<...>

mm/kasan/generic_report.c:137:6: warning: no previous prototype for '__asan_report_store1_noabort' [-Wmissing-prototypes]
  137 | void __asan_report_store##size##_noabort(unsigned long addr) \
      |      ^~~~~~~~~~~~~~~~~~~
mm/kasan/generic_report.c:148:1: note: in expansion of macro 'DEFINE_ASAN_REPORT_STORE'
  148 | DEFINE_ASAN_REPORT_STORE(1);
      | ^~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 0b24becc810d ("kasan: add kernel address sanitizer infrastructure")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 mm/kasan/kasan.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h
index e8f37199d885..d428e588c700 100644
--- a/mm/kasan/kasan.h
+++ b/mm/kasan/kasan.h
@@ -230,15 +230,27 @@ void __asan_load16(unsigned long addr);
 void __asan_store16(unsigned long addr);

 void __asan_load1_noabort(unsigned long addr);
+void __asan_report_load1_noabort(unsigned long addr);
 void __asan_store1_noabort(unsigned long addr);
+void __asan_report_store1_noabort(unsigned long addr);
 void __asan_load2_noabort(unsigned long addr);
+void __asan_report_load2_noabort(unsigned long addr);
 void __asan_store2_noabort(unsigned long addr);
+void __asan_report_store2_noabort(unsigned long addr);
 void __asan_load4_noabort(unsigned long addr);
+void __asan_report_load4_noabort(unsigned long addr);
 void __asan_store4_noabort(unsigned long addr);
+void __asan_report_store4_noabort(unsigned long addr);
 void __asan_load8_noabort(unsigned long addr);
+void __asan_report_load8_noabort(unsigned long addr);
 void __asan_store8_noabort(unsigned long addr);
+void __asan_report_store8_noabort(unsigned long addr);
 void __asan_load16_noabort(unsigned long addr);
+void __asan_report_load16_noabort(unsigned long addr);
 void __asan_store16_noabort(unsigned long addr);
+void __asan_report_store16_noabort(unsigned long addr);
+void __asan_report_load_n_noabort(unsigned long addr, size_t size);
+void __asan_report_store_n_noabort(unsigned long addr, size_t size);

 void __asan_set_shadow_00(const void *addr, size_t size);
 void __asan_set_shadow_f1(const void *addr, size_t size);
--
2.26.2


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

* [PATCH rdma-next 2/2] kasan: add missing prototypes to fix compilation warnings
  2020-05-12  6:37 [PATCH rdma-next 0/2] Fix kasan compilation warnings Leon Romanovsky
  2020-05-12  6:37 ` [PATCH rdma-next 1/2] kasan: fix compilation warnings due to missing function prototypes Leon Romanovsky
@ 2020-05-12  6:37 ` Leon Romanovsky
  2020-05-12 10:09 ` [PATCH rdma-next 0/2] Fix kasan " Leon Romanovsky
  2020-05-12 15:34 ` Andrey Konovalov
  3 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2020-05-12  6:37 UTC (permalink / raw)
  To: Andrew Morton, Andrey Ryabinin
  Cc: Leon Romanovsky, Ingo Molnar, kasan-dev, linux-mm,
	Peter Zijlstra, linux-kernel

From: Leon Romanovsky <leonro@mellanox.com>

Use internal kasan header to declare missing prototypes to fix the
following compilation warnings.

mm/kasan/report.c:457:6: warning: no previous prototype for 'report_enabled' [-Wmissing-prototypes]
  457 | bool report_enabled(void)
      |      ^~~~~~~~~~~~~~
mm/kasan/report.c:482:6: warning: no previous prototype for '__kasan_report' [-Wmissing-prototypes]
  482 | void __kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip)
      |      ^~~~~~~~~~~~~~

Fixes: 57b78a62e7f2 ("x86/uaccess, kasan: Fix KASAN vs SMAP")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 mm/kasan/common.c | 3 ---
 mm/kasan/kasan.h  | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/kasan/common.c b/mm/kasan/common.c
index 2906358e42f0..cbb119224330 100644
--- a/mm/kasan/common.c
+++ b/mm/kasan/common.c
@@ -613,9 +613,6 @@ void kasan_free_shadow(const struct vm_struct *vm)
 }
 #endif

-extern void __kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip);
-extern bool report_enabled(void);
-
 bool kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip)
 {
 	unsigned long flags = user_access_save();
diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h
index d428e588c700..02d54a1d0b2d 100644
--- a/mm/kasan/kasan.h
+++ b/mm/kasan/kasan.h
@@ -153,6 +153,9 @@ bool check_memory_region(unsigned long addr, size_t size, bool write,
 void *find_first_bad_addr(void *addr, size_t size);
 const char *get_bug_type(struct kasan_access_info *info);

+bool report_enabled(void);
+void __kasan_report(unsigned long addr, size_t size, bool is_write,
+		    unsigned long ip);
 bool kasan_report(unsigned long addr, size_t size,
 		bool is_write, unsigned long ip);
 void kasan_report_invalid_free(void *object, unsigned long ip);
--
2.26.2


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

* Re: [PATCH rdma-next 0/2] Fix kasan compilation warnings
  2020-05-12  6:37 [PATCH rdma-next 0/2] Fix kasan compilation warnings Leon Romanovsky
  2020-05-12  6:37 ` [PATCH rdma-next 1/2] kasan: fix compilation warnings due to missing function prototypes Leon Romanovsky
  2020-05-12  6:37 ` [PATCH rdma-next 2/2] kasan: add missing prototypes to fix compilation warnings Leon Romanovsky
@ 2020-05-12 10:09 ` Leon Romanovsky
  2020-05-12 15:34 ` Andrey Konovalov
  3 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2020-05-12 10:09 UTC (permalink / raw)
  To: Andrew Morton, Andrey Konovalov, Andrey Ryabinin
  Cc: Ingo Molnar, kasan-dev, linux-kernel, linux-mm, Michal Marek,
	Peter Zijlstra

On Tue, May 12, 2020 at 09:37:26AM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
>
> Hi,
>
> The following two fixes are adding missing function prototypes
> declarations to internal kasan header in order to eliminate compilation
> warnings.
>
> Thanks

Sorry for forgetting to clean subject, the patches are not "rdma-next"
but MM related.

Thanks

>
> Leon Romanovsky (2):
>   kasan: fix compilation warnings due to missing function prototypes
>   kasan: add missing prototypes to fix compilation warnings
>
>  mm/kasan/common.c |  3 ---
>  mm/kasan/kasan.h  | 15 +++++++++++++++
>  2 files changed, 15 insertions(+), 3 deletions(-)
>
> --
> 2.26.2
>
>

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

* Re: [PATCH rdma-next 0/2] Fix kasan compilation warnings
  2020-05-12  6:37 [PATCH rdma-next 0/2] Fix kasan compilation warnings Leon Romanovsky
                   ` (2 preceding siblings ...)
  2020-05-12 10:09 ` [PATCH rdma-next 0/2] Fix kasan " Leon Romanovsky
@ 2020-05-12 15:34 ` Andrey Konovalov
  2020-05-12 16:11   ` Leon Romanovsky
  3 siblings, 1 reply; 6+ messages in thread
From: Andrey Konovalov @ 2020-05-12 15:34 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Andrew Morton, Andrey Konovalov, Andrey Ryabinin,
	Leon Romanovsky, Ingo Molnar, kasan-dev, LKML,
	Linux Memory Management List, Michal Marek, Peter Zijlstra

On Tue, May 12, 2020 at 8:37 AM Leon Romanovsky <leon@kernel.org> wrote:
>
> From: Leon Romanovsky <leonro@mellanox.com>
>
> Hi,
>
> The following two fixes are adding missing function prototypes
> declarations to internal kasan header in order to eliminate compilation
> warnings.
>
> Thanks
>
> Leon Romanovsky (2):
>   kasan: fix compilation warnings due to missing function prototypes
>   kasan: add missing prototypes to fix compilation warnings

Hi Leon,

I've mailed a series with slightly different/fuller fixes for these issues.

Thanks for the report!

>
>  mm/kasan/common.c |  3 ---
>  mm/kasan/kasan.h  | 15 +++++++++++++++
>  2 files changed, 15 insertions(+), 3 deletions(-)
>
> --
> 2.26.2
>
> --
> You received this message because you are subscribed to the Google Groups "kasan-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/20200512063728.17785-1-leon%40kernel.org.

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

* Re: [PATCH rdma-next 0/2] Fix kasan compilation warnings
  2020-05-12 15:34 ` Andrey Konovalov
@ 2020-05-12 16:11   ` Leon Romanovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2020-05-12 16:11 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Andrew Morton, Andrey Konovalov, Andrey Ryabinin, Ingo Molnar,
	kasan-dev, LKML, Linux Memory Management List, Michal Marek,
	Peter Zijlstra

On Tue, May 12, 2020 at 05:34:10PM +0200, Andrey Konovalov wrote:
> On Tue, May 12, 2020 at 8:37 AM Leon Romanovsky <leon@kernel.org> wrote:
> >
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > Hi,
> >
> > The following two fixes are adding missing function prototypes
> > declarations to internal kasan header in order to eliminate compilation
> > warnings.
> >
> > Thanks
> >
> > Leon Romanovsky (2):
> >   kasan: fix compilation warnings due to missing function prototypes
> >   kasan: add missing prototypes to fix compilation warnings
>
> Hi Leon,
>
> I've mailed a series with slightly different/fuller fixes for these issues.
>
> Thanks for the report!

No problem, thanks for taking care.

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

end of thread, other threads:[~2020-05-12 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12  6:37 [PATCH rdma-next 0/2] Fix kasan compilation warnings Leon Romanovsky
2020-05-12  6:37 ` [PATCH rdma-next 1/2] kasan: fix compilation warnings due to missing function prototypes Leon Romanovsky
2020-05-12  6:37 ` [PATCH rdma-next 2/2] kasan: add missing prototypes to fix compilation warnings Leon Romanovsky
2020-05-12 10:09 ` [PATCH rdma-next 0/2] Fix kasan " Leon Romanovsky
2020-05-12 15:34 ` Andrey Konovalov
2020-05-12 16:11   ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).