Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-13 Thread Walter Wu
On Tue, 2019-10-08 at 14:11 +0200, Dmitry Vyukov wrote: > On Tue, Oct 8, 2019 at 1:42 PM Qian Cai wrote: > > > On Oct 8, 2019, at 7:02 AM, Walter Wu wrote: > > > I don't know very well in UBSAN, but I try to build ubsan kernel and > > > test a negative number in memset and kmalloc_memmove_invalid

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-08 Thread Dmitry Vyukov
On Tue, Oct 8, 2019 at 1:42 PM Qian Cai wrote: > > On Oct 8, 2019, at 7:02 AM, Walter Wu wrote: > > I don't know very well in UBSAN, but I try to build ubsan kernel and > > test a negative number in memset and kmalloc_memmove_invalid_size(), it > > look like no check. > > It sounds like more impo

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-08 Thread Walter Wu
On Tue, 2019-10-08 at 07:42 -0400, Qian Cai wrote: > > > On Oct 8, 2019, at 7:02 AM, Walter Wu wrote: > > > > I don't know very well in UBSAN, but I try to build ubsan kernel and > > test a negative number in memset and kmalloc_memmove_invalid_size(), it > > look like no check. > > It sounds li

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-08 Thread Qian Cai
> On Oct 8, 2019, at 7:02 AM, Walter Wu wrote: > > I don't know very well in UBSAN, but I try to build ubsan kernel and > test a negative number in memset and kmalloc_memmove_invalid_size(), it > look like no check. It sounds like more important to figure out why the UBSAN is not working in

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-08 Thread Walter Wu
On Tue, 2019-10-08 at 05:47 -0400, Qian Cai wrote: > > > On Oct 8, 2019, at 2:16 AM, Walter Wu wrote: > > > > It is an undefined behavior to pass a negative numbers to > >memset()/memcpy()/memmove(), so need to be detected by KASAN. > > Why can’t this be detected by UBSAN? I don't know ver

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-08 Thread Qian Cai
> On Oct 8, 2019, at 2:16 AM, Walter Wu wrote: > > It is an undefined behavior to pass a negative numbers to >memset()/memcpy()/memmove(), so need to be detected by KASAN. Why can’t this be detected by UBSAN?

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Walter Wu
On Mon, 2019-10-07 at 15:33 +0200, Dmitry Vyukov wrote: > On Mon, Oct 7, 2019 at 2:33 PM Walter Wu wrote: > > On Mon, 2019-10-07 at 14:19 +0200, Dmitry Vyukov wrote: > > > On Mon, Oct 7, 2019 at 2:03 PM Walter Wu > > > wrote: > > > My idea was just to always print "heap-out-of-bounds" and don't

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Dmitry Vyukov
On Mon, Oct 7, 2019 at 2:33 PM Walter Wu wrote: > On Mon, 2019-10-07 at 14:19 +0200, Dmitry Vyukov wrote: > > On Mon, Oct 7, 2019 at 2:03 PM Walter Wu wrote: > > My idea was just to always print "heap-out-of-bounds" and don't > > differentiate if the size come from userspace or not. > > Got it. >

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Walter Wu
On Mon, 2019-10-07 at 14:19 +0200, Dmitry Vyukov wrote: > On Mon, Oct 7, 2019 at 2:03 PM Walter Wu wrote: > > > > > > > > > > On Mon, Oct 7, 2019 at 10:18 AM Walter Wu > > > > > > > > > > wrote: > > > > > > > > > > > The patchsets help to produce KASAN report when size is > > > > > > > > > > >

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Dmitry Vyukov
On Mon, Oct 7, 2019 at 2:03 PM Walter Wu wrote: > > > > > > > > > On Mon, Oct 7, 2019 at 10:18 AM Walter Wu > > > > > > > > > wrote: > > > > > > > > > > The patchsets help to produce KASAN report when size is > > > > > > > > > > negative numbers > > > > > > > > > > in memory operation function.

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Walter Wu
On Mon, 2019-10-07 at 12:51 +0200, Dmitry Vyukov wrote: > On Mon, Oct 7, 2019 at 11:50 AM Walter Wu wrote: > > > > On Mon, 2019-10-07 at 17:28 +0800, Walter Wu wrote: > > > On Mon, 2019-10-07 at 11:10 +0200, Dmitry Vyukov wrote: > > > > On Mon, Oct 7, 2019 at 11:03 AM Walter Wu > > > > wrote: >

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Dmitry Vyukov
On Mon, Oct 7, 2019 at 11:50 AM Walter Wu wrote: > > On Mon, 2019-10-07 at 17:28 +0800, Walter Wu wrote: > > On Mon, 2019-10-07 at 11:10 +0200, Dmitry Vyukov wrote: > > > On Mon, Oct 7, 2019 at 11:03 AM Walter Wu > > > wrote: > > > > > > > > On Mon, 2019-10-07 at 10:54 +0200, Dmitry Vyukov wrote

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Walter Wu
On Mon, 2019-10-07 at 17:28 +0800, Walter Wu wrote: > On Mon, 2019-10-07 at 11:10 +0200, Dmitry Vyukov wrote: > > On Mon, Oct 7, 2019 at 11:03 AM Walter Wu wrote: > > > > > > On Mon, 2019-10-07 at 10:54 +0200, Dmitry Vyukov wrote: > > > > On Mon, Oct 7, 2019 at 10:52 AM Walter Wu > > > > wrote:

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Walter Wu
On Mon, 2019-10-07 at 11:10 +0200, Dmitry Vyukov wrote: > On Mon, Oct 7, 2019 at 11:03 AM Walter Wu wrote: > > > > On Mon, 2019-10-07 at 10:54 +0200, Dmitry Vyukov wrote: > > > On Mon, Oct 7, 2019 at 10:52 AM Walter Wu > > > wrote: > > > > > > > > On Mon, 2019-10-07 at 10:24 +0200, Dmitry Vyukov

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Dmitry Vyukov
On Mon, Oct 7, 2019 at 11:03 AM Walter Wu wrote: > > On Mon, 2019-10-07 at 10:54 +0200, Dmitry Vyukov wrote: > > On Mon, Oct 7, 2019 at 10:52 AM Walter Wu wrote: > > > > > > On Mon, 2019-10-07 at 10:24 +0200, Dmitry Vyukov wrote: > > > > On Mon, Oct 7, 2019 at 10:18 AM Walter Wu > > > > wrote:

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Walter Wu
On Mon, 2019-10-07 at 10:54 +0200, Dmitry Vyukov wrote: > On Mon, Oct 7, 2019 at 10:52 AM Walter Wu wrote: > > > > On Mon, 2019-10-07 at 10:24 +0200, Dmitry Vyukov wrote: > > > On Mon, Oct 7, 2019 at 10:18 AM Walter Wu > > > wrote: > > > > The patchsets help to produce KASAN report when size is

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Dmitry Vyukov
On Mon, Oct 7, 2019 at 10:52 AM Walter Wu wrote: > > On Mon, 2019-10-07 at 10:24 +0200, Dmitry Vyukov wrote: > > On Mon, Oct 7, 2019 at 10:18 AM Walter Wu wrote: > > > The patchsets help to produce KASAN report when size is negative numbers > > > in memory operation function. It is helpful for pr

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Walter Wu
On Mon, 2019-10-07 at 10:24 +0200, Dmitry Vyukov wrote: > On Mon, Oct 7, 2019 at 10:18 AM Walter Wu wrote: > > The patchsets help to produce KASAN report when size is negative numbers > > in memory operation function. It is helpful for programmer to solve the > > undefined behavior issue. Patch 1

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Dmitry Vyukov
On Mon, Oct 7, 2019 at 10:18 AM Walter Wu wrote: > The patchsets help to produce KASAN report when size is negative numbers > in memory operation function. It is helpful for programmer to solve the > undefined behavior issue. Patch 1 based on Dmitry's review and > suggestion, patch 2 is a test in

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Walter Wu
On Mon, 2019-10-07 at 09:29 +0200, Dmitry Vyukov wrote: > > > > diff --git a/mm/kasan/tags_report.c b/mm/kasan/tags_report.c > > > > index 969ae08f59d7..19b9e364b397 100644 > > > > --- a/mm/kasan/tags_report.c > > > > +++ b/mm/kasan/tags_report.c > > > > @@ -36,6 +36,16 @@ > > > > > > > > const ch

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-07 Thread Dmitry Vyukov
On Mon, Oct 7, 2019 at 5:23 AM Walter Wu wrote: > > > > > > "out-of-bounds" is the _least_ frequent KASAN bug type. So saying > > > > > > "out-of-bounds" has downsides of both approaches and won't prevent > > > > > > duplicate reports by syzbot... > > > > > > > > > > > maybe i should add your comm

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-06 Thread Walter Wu
On Fri, 2019-10-04 at 15:52 +0200, Dmitry Vyukov wrote: > On Fri, Oct 4, 2019 at 2:05 PM Walter Wu wrote: > > > > On Fri, 2019-10-04 at 11:54 +0200, Dmitry Vyukov wrote: > > > > > "out-of-bounds" is the _least_ frequent KASAN bug type. So saying > > > > > "out-of-bounds" has downsides of both appr

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-04 Thread Dmitry Vyukov
On Fri, Oct 4, 2019 at 2:05 PM Walter Wu wrote: > > On Fri, 2019-10-04 at 11:54 +0200, Dmitry Vyukov wrote: > > > > "out-of-bounds" is the _least_ frequent KASAN bug type. So saying > > > > "out-of-bounds" has downsides of both approaches and won't prevent > > > > duplicate reports by syzbot... >

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-04 Thread Walter Wu
On Fri, 2019-10-04 at 11:54 +0200, Dmitry Vyukov wrote: > > > "out-of-bounds" is the _least_ frequent KASAN bug type. So saying > > > "out-of-bounds" has downsides of both approaches and won't prevent > > > duplicate reports by syzbot... > > > > > maybe i should add your comment into the comment in

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-04 Thread Dmitry Vyukov
On Fri, Oct 4, 2019 at 11:44 AM Walter Wu wrote: > > On Fri, 2019-10-04 at 11:18 +0200, Dmitry Vyukov wrote: > > On Fri, Oct 4, 2019 at 10:02 AM Walter Wu wrote: > > > > > > On Fri, 2019-10-04 at 12:42 +0800, Walter Wu wrote: > > > > On Thu, 2019-10-03 at 16:53 +0200, Dmitry Vyukov wrote: > > > >

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-04 Thread Walter Wu
On Fri, 2019-10-04 at 11:18 +0200, Dmitry Vyukov wrote: > On Fri, Oct 4, 2019 at 10:02 AM Walter Wu wrote: > > > > On Fri, 2019-10-04 at 12:42 +0800, Walter Wu wrote: > > > On Thu, 2019-10-03 at 16:53 +0200, Dmitry Vyukov wrote: > > > > On Thu, Oct 3, 2019 at 3:51 PM Walter Wu > > > > wrote:> >

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-04 Thread Dmitry Vyukov
On Fri, Oct 4, 2019 at 10:02 AM Walter Wu wrote: > > On Fri, 2019-10-04 at 12:42 +0800, Walter Wu wrote: > > On Thu, 2019-10-03 at 16:53 +0200, Dmitry Vyukov wrote: > > > On Thu, Oct 3, 2019 at 3:51 PM Walter Wu > > > wrote:> > > > > > > > > static void print_error_description(struct kasan_acce

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-04 Thread Walter Wu
On Fri, 2019-10-04 at 12:42 +0800, Walter Wu wrote: > On Thu, 2019-10-03 at 16:53 +0200, Dmitry Vyukov wrote: > > On Thu, Oct 3, 2019 at 3:51 PM Walter Wu wrote:> > > > > > > static void print_error_description(struct kasan_access_info *info) > > > { > > > - pr_err("BUG: KASAN: %s in %pS\n

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-03 Thread Walter Wu
On Thu, 2019-10-03 at 16:53 +0200, Dmitry Vyukov wrote: > On Thu, Oct 3, 2019 at 3:51 PM Walter Wu wrote:> > > how about this? > > > > commit fd64691026e7ccb8d2946d0804b0621ac177df38 > > Author: Walter Wu > > Date: Fri Sep 27 09:54:18 2019 +0800 > > > > kasan: detect invalid size in memory

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-03 Thread Dmitry Vyukov
On Thu, Oct 3, 2019 at 3:51 PM Walter Wu wrote:> > how about this? > > commit fd64691026e7ccb8d2946d0804b0621ac177df38 > Author: Walter Wu > Date: Fri Sep 27 09:54:18 2019 +0800 > > kasan: detect invalid size in memory operation function > > It is an undefined behavior to pass a negativ

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-03 Thread Walter Wu
On Thu, 2019-10-03 at 17:38 +0800, Walter Wu wrote: > On Thu, 2019-10-03 at 08:26 +0200, Dmitry Vyukov wrote: > > On Thu, Oct 3, 2019 at 4:18 AM Walter Wu wrote: > > > > > > On Wed, 2019-10-02 at 15:57 +0200, Dmitry Vyukov wrote: > > > > On Wed, Oct 2, 2019 at 2:15 PM Walter Wu > > > > wrote: >

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-03 Thread Walter Wu
On Thu, 2019-10-03 at 08:26 +0200, Dmitry Vyukov wrote: > On Thu, Oct 3, 2019 at 4:18 AM Walter Wu wrote: > > > > On Wed, 2019-10-02 at 15:57 +0200, Dmitry Vyukov wrote: > > > On Wed, Oct 2, 2019 at 2:15 PM Walter Wu > > > wrote: > > > > > > > > On Mon, 2019-09-30 at 12:36 +0800, Walter Wu wrote

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-02 Thread Dmitry Vyukov
On Thu, Oct 3, 2019 at 4:18 AM Walter Wu wrote: > > On Wed, 2019-10-02 at 15:57 +0200, Dmitry Vyukov wrote: > > On Wed, Oct 2, 2019 at 2:15 PM Walter Wu wrote: > > > > > > On Mon, 2019-09-30 at 12:36 +0800, Walter Wu wrote: > > > > On Fri, 2019-09-27 at 21:41 +0200, Dmitry Vyukov wrote: > > > > >

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-02 Thread Walter Wu
On Wed, 2019-10-02 at 15:57 +0200, Dmitry Vyukov wrote: > On Wed, Oct 2, 2019 at 2:15 PM Walter Wu wrote: > > > > On Mon, 2019-09-30 at 12:36 +0800, Walter Wu wrote: > > > On Fri, 2019-09-27 at 21:41 +0200, Dmitry Vyukov wrote: > > > > On Fri, Sep 27, 2019 at 4:22 PM Walter Wu > > > > wrote: > >

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-02 Thread Dmitry Vyukov
On Wed, Oct 2, 2019 at 2:15 PM Walter Wu wrote: > > On Mon, 2019-09-30 at 12:36 +0800, Walter Wu wrote: > > On Fri, 2019-09-27 at 21:41 +0200, Dmitry Vyukov wrote: > > > On Fri, Sep 27, 2019 at 4:22 PM Walter Wu > > > wrote: > > > > > > > > On Fri, 2019-09-27 at 15:07 +0200, Dmitry Vyukov wrote:

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-10-02 Thread Walter Wu
On Mon, 2019-09-30 at 12:36 +0800, Walter Wu wrote: > On Fri, 2019-09-27 at 21:41 +0200, Dmitry Vyukov wrote: > > On Fri, Sep 27, 2019 at 4:22 PM Walter Wu wrote: > > > > > > On Fri, 2019-09-27 at 15:07 +0200, Dmitry Vyukov wrote: > > > > On Fri, Sep 27, 2019 at 5:43 AM Walter Wu > > > > wrote:

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-09-30 Thread Walter Wu
On Tue, 2019-10-01 at 05:01 +0200, Dmitry Vyukov wrote: > On Tue, Oct 1, 2019 at 4:36 AM Walter Wu wrote: > > > > On Mon, 2019-09-30 at 10:57 +0200, Marc Gonzalez wrote: > > > On 30/09/2019 06:36, Walter Wu wrote: > > > > > > > bool check_memory_region(unsigned long addr, size_t size, bool write,

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-09-30 Thread Dmitry Vyukov
On Tue, Oct 1, 2019 at 4:36 AM Walter Wu wrote: > > On Mon, 2019-09-30 at 10:57 +0200, Marc Gonzalez wrote: > > On 30/09/2019 06:36, Walter Wu wrote: > > > > > bool check_memory_region(unsigned long addr, size_t size, bool write, > > > unsigned long ret_ip) > > >

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-09-30 Thread Walter Wu
On Mon, 2019-09-30 at 10:57 +0200, Marc Gonzalez wrote: > On 30/09/2019 06:36, Walter Wu wrote: > > > bool check_memory_region(unsigned long addr, size_t size, bool write, > > unsigned long ret_ip) > > { > > + if (long(size) < 0) { > > + kasan_

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-09-30 Thread Marc Gonzalez
On 30/09/2019 06:36, Walter Wu wrote: > bool check_memory_region(unsigned long addr, size_t size, bool write, > unsigned long ret_ip) > { > + if (long(size) < 0) { > + kasan_report_invalid_size(src, dest, len, _RET_IP_); > + retur

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-09-29 Thread Walter Wu
On Fri, 2019-09-27 at 21:41 +0200, Dmitry Vyukov wrote: > On Fri, Sep 27, 2019 at 4:22 PM Walter Wu wrote: > > > > On Fri, 2019-09-27 at 15:07 +0200, Dmitry Vyukov wrote: > > > On Fri, Sep 27, 2019 at 5:43 AM Walter Wu > > > wrote: > > > > > > > > memmove() and memcpy() have missing underflow is

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-09-27 Thread Dmitry Vyukov
On Fri, Sep 27, 2019 at 4:22 PM Walter Wu wrote: > > On Fri, 2019-09-27 at 15:07 +0200, Dmitry Vyukov wrote: > > On Fri, Sep 27, 2019 at 5:43 AM Walter Wu wrote: > > > > > > memmove() and memcpy() have missing underflow issues. > > > When -7 <= size < 0, then KASAN will miss to catch the underflo

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-09-27 Thread Walter Wu
On Fri, 2019-09-27 at 15:07 +0200, Dmitry Vyukov wrote: > On Fri, Sep 27, 2019 at 5:43 AM Walter Wu wrote: > > > > memmove() and memcpy() have missing underflow issues. > > When -7 <= size < 0, then KASAN will miss to catch the underflow issue. > > It looks like shadow start address and shadow end

Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-09-27 Thread Dmitry Vyukov
On Fri, Sep 27, 2019 at 5:43 AM Walter Wu wrote: > > memmove() and memcpy() have missing underflow issues. > When -7 <= size < 0, then KASAN will miss to catch the underflow issue. > It looks like shadow start address and shadow end address is the same, > so it does not actually check anything. >

[PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y

2019-09-26 Thread Walter Wu
memmove() and memcpy() have missing underflow issues. When -7 <= size < 0, then KASAN will miss to catch the underflow issue. It looks like shadow start address and shadow end address is the same, so it does not actually check anything. The following test is indeed not caught by KASAN: ch