Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 14:25, Valery Ushakov wrote: > If the sanitizer does complain about other uses, there is little point > in fixing one instance and not the others. We already agreed with Christos that this is appeasing of GCC. If you want to scan the whole kernel (or whole C) file for more

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 16:49, Martin Husemann wrote: > On Thu, Nov 07, 2019 at 04:45:31PM +0100, Kamil Rytarowski wrote: >> Unfortunately the C committee went into the opposite direction here and >> specified a potential dereference. > > Where? > > Martin > 6.3.2.1 C99 "An lvalue is an expression with

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 16:45, Kamil Rytarowski wrote: > On 07.11.2019 16:26, Martin Husemann wrote: >> On Thu, Nov 07, 2019 at 02:53:08PM +0100, Kamil Rytarowski wrote: >>> On 07.11.2019 14:25, Valery Ushakov wrote: If the sanitizer does complain about other uses, there is little point in fixing

Re: CVS commit: src/sys/kern

2019-11-07 Thread Martin Husemann
On Thu, Nov 07, 2019 at 06:46:48PM +0100, Kamil Rytarowski wrote: > member access within misaligned address 0x942d3de8c03c for type > 'const struct disklabel' which requires 8 byte alignment OK, why is it 8 byte aligned? Checking > revision 1.108 > date: 2011-01-18 20:52:24 +0100;

CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
Module Name:src Committed By: kamil Date: Thu Nov 7 18:35:41 UTC 2019 Modified Files: src/sys/kern: subr_disk_mbr.c Log Message: Revert src/sys/kern/subr_disk_mbr.c r.1.52 Addressed in a better way in r. 1.53. To generate a diff of this commit: cvs rdiff -u -r1.53

Re: CVS commit: src/sys/kern

2019-11-07 Thread Christos Zoulas
On Nov 7, 6:08pm, n...@gmx.com (Kamil Rytarowski) wrote: -- Subject: Re: CVS commit: src/sys/kern | Please review: | | http://netbsd.org/~kamil/patch-00194-disklabel-alignment.txt | | This patch works for me. | | Patch inspired by: | | Avoid misaligned access in disklabel(8) in find_label()

Re: CVS commit: src/sys/kern

2019-11-07 Thread Martin Husemann
On Thu, Nov 07, 2019 at 06:08:40PM +0100, Kamil Rytarowski wrote: > Please review: > > http://netbsd.org/~kamil/patch-00194-disklabel-alignment.txt > > This patch works for me. Yes, I believe that it does - but why is it needed? dlp = (void *)a->bp->b_data; Here we can assume that

Re: CVS commit: src/sys/kern

2019-11-07 Thread Valery Ushakov
On Thu, Nov 07, 2019 at 18:08:40 +0100, Kamil Rytarowski wrote: > On 07.11.2019 16:45, Kamil Rytarowski wrote: > > On 07.11.2019 16:26, Martin Husemann wrote: > >> On Thu, Nov 07, 2019 at 02:53:08PM +0100, Kamil Rytarowski wrote: > >>> On 07.11.2019 14:25, Valery Ushakov wrote: > If the

Re: CVS commit: src/sys/kern

2019-11-07 Thread Valery Ushakov
On Thu, Nov 07, 2019 at 09:58:06 -0600, David Young wrote: > On Thu, Nov 07, 2019 at 04:26:51PM +0100, Martin Husemann wrote: > > On Thu, Nov 07, 2019 at 02:53:08PM +0100, Kamil Rytarowski wrote: > > > On 07.11.2019 14:25, Valery Ushakov wrote: > > > > If the sanitizer does complain about other

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 17:20, Kamil Rytarowski wrote: > On 07.11.2019 17:08, Martin Husemann wrote: >> On Thu, Nov 07, 2019 at 04:56:16PM +0100, Kamil Rytarowski wrote: >>> 6.3.2.1 C11 >>> >>> 'An lvalue is an expression (with an object type other than void) that >>> potentially designates an object' >>>

CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
Module Name:src Committed By: kamil Date: Thu Nov 7 18:35:41 UTC 2019 Modified Files: src/sys/kern: subr_disk_mbr.c Log Message: Revert src/sys/kern/subr_disk_mbr.c r.1.52 Addressed in a better way in r. 1.53. To generate a diff of this commit: cvs rdiff -u -r1.53

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 17:09, Martin Husemann wrote: > On Thu, Nov 07, 2019 at 09:58:06AM -0600, David Young wrote: >> I think the problem is that if you have the series of statements, >> >> element_t *e = >element; >> >> if (s == NULL) >> return; > > Note that this example

CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
Module Name:src Committed By: kamil Date: Thu Nov 7 18:30:27 UTC 2019 Modified Files: src/sys/kern: subr_disk_mbr.c Log Message: Ensure in validate_label() that struct disklabel pointer is 8-byte aligned The label is searched each 4 bytes and can be detected in an

CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
Module Name:src Committed By: kamil Date: Thu Nov 7 18:30:27 UTC 2019 Modified Files: src/sys/kern: subr_disk_mbr.c Log Message: Ensure in validate_label() that struct disklabel pointer is 8-byte aligned The label is searched each 4 bytes and can be detected in an

Re: CVS commit: src/sys/kern

2019-11-07 Thread Martin Husemann
On Thu, Nov 07, 2019 at 04:56:16PM +0100, Kamil Rytarowski wrote: > 6.3.2.1 C11 > > 'An lvalue is an expression (with an object type other than void) that > potentially designates an object' > > This means that real dereference is not needed, only a potential. And > there are special cases of

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 17:08, Martin Husemann wrote: > On Thu, Nov 07, 2019 at 04:56:16PM +0100, Kamil Rytarowski wrote: >> 6.3.2.1 C11 >> >> 'An lvalue is an expression (with an object type other than void) that >> potentially designates an object' >> >> This means that real dereference is not needed,

Re: CVS commit: src/sys/kern

2019-11-07 Thread Steffen Nurpmeso
David Young wrote in <20191107155806.gl1...@pobox.com>: |On Thu, Nov 07, 2019 at 04:26:51PM +0100, Martin Husemann wrote: |> On Thu, Nov 07, 2019 at 02:53:08PM +0100, Kamil Rytarowski wrote: |>> On 07.11.2019 14:25, Valery Ushakov wrote: .. |I think the problem is that if you have the series

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 18:20, Martin Husemann wrote: > On Thu, Nov 07, 2019 at 06:08:40PM +0100, Kamil Rytarowski wrote: >> Please review: >> >> http://netbsd.org/~kamil/patch-00194-disklabel-alignment.txt >> >> This patch works for me. > > Yes, I believe that it does - but why is it needed? > syzbot

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 19:32, Valery Ushakov wrote: > On Thu, Nov 07, 2019 at 18:08:40 +0100, Kamil Rytarowski wrote: > >> On 07.11.2019 16:45, Kamil Rytarowski wrote: >>> On 07.11.2019 16:26, Martin Husemann wrote: On Thu, Nov 07, 2019 at 02:53:08PM +0100, Kamil Rytarowski wrote: > On 07.11.2019

Re: CVS commit: src/sys/kern

2019-11-07 Thread Valery Ushakov
On Thu, Nov 07, 2019 at 19:06:29 +0100, Martin Husemann wrote: > OK, why is it 8 byte aligned? Checking > > > revision 1.108 > > date: 2011-01-18 20:52:24 +0100; author: matt; state: Exp; lines: +2 -1; > > Make struct disklabel 8 byte aligned. This increases its size by 4 bytes > > on

Re: CVS commit: src/sys/kern

2019-11-07 Thread Martin Husemann
On Thu, Nov 07, 2019 at 09:58:06AM -0600, David Young wrote: > I think the problem is that if you have the series of statements, > > element_t *e = >element; > > if (s == NULL) > return; Note that this example has *nothing* in common with Kamil's code change. He

Re: CVS commit: src/sys/kern

2019-11-07 Thread Martin Husemann
On Thu, Nov 07, 2019 at 11:46:47AM +0100, Kamil Rytarowski wrote: > Please see my newer mail with rationale and another one with a > confirmation that this was real UB. Confirmation? The dereference in this case happens in memcmp() only, so what misalignment could there be? Martin

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 07:25, Martin Husemann wrote: > On Wed, Nov 06, 2019 at 11:17:23PM +0100, Kamil Rytarowski wrote: >> Technically, I think that this is a real UB. >> >> 6.3.2.3/7 >> A pointer to an object type may be converted to a pointer to a >> different object type. If the resulting pointer is

Re: CVS commit: src/sys/kern

2019-11-07 Thread Valery Ushakov
On Thu, Nov 07, 2019 at 13:59:37 +0100, Kamil Rytarowski wrote: > On 07.11.2019 13:48, Valery Ushakov wrote: > > On Thu, Nov 07, 2019 at 13:37:21 +0100, Kamil Rytarowski wrote: > > > >> On 07.11.2019 13:17, Valery Ushakov wrote: > >>> On Thu, Nov 07, 2019 at 06:02:39 +0100, Kamil Rytarowski

Re: CVS commit: src/sys/kern

2019-11-07 Thread Valery Ushakov
On Thu, Nov 07, 2019 at 06:02:39 +0100, Kamil Rytarowski wrote: > I have checked received the following patch and received a feedback from > a LLVM developer. > > On 07.11.2019 05:47, 'Dmitry Vyukov' via syzkaller-netbsd-bugs wrote: > > I've consulted with some people and _presumably_ (to the

CVS commit: src/sys/compat/netbsd32

2019-11-07 Thread Rin Okuyama
Module Name:src Committed By: rin Date: Thu Nov 7 15:21:56 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32.h Log Message: For netbsd32_statvfs, f_spare should be netbsd32_uint64, not uint64_t. Fix syscalls using struct statvfs on COMPAT_NETBSD32 on amd64,

CVS commit: src/sys/compat/netbsd32

2019-11-07 Thread Rin Okuyama
Module Name:src Committed By: rin Date: Thu Nov 7 15:21:56 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32.h Log Message: For netbsd32_statvfs, f_spare should be netbsd32_uint64, not uint64_t. Fix syscalls using struct statvfs on COMPAT_NETBSD32 on amd64,

Re: CVS commit: src/sys/kern

2019-11-07 Thread David Young
On Thu, Nov 07, 2019 at 04:26:51PM +0100, Martin Husemann wrote: > On Thu, Nov 07, 2019 at 02:53:08PM +0100, Kamil Rytarowski wrote: > > On 07.11.2019 14:25, Valery Ushakov wrote: > > > If the sanitizer does complain about other uses, there is little point > > > in fixing one instance and not the

Re: CVS commit: src/sys/kern

2019-11-07 Thread Martin Husemann
On Thu, Nov 07, 2019 at 02:53:08PM +0100, Kamil Rytarowski wrote: > On 07.11.2019 14:25, Valery Ushakov wrote: > > If the sanitizer does complain about other uses, there is little point > > in fixing one instance and not the others. > > We already agreed with Christos that this is appeasing of

Re: CVS commit: src/sys/kern

2019-11-07 Thread Valery Ushakov
On Thu, Nov 07, 2019 at 15:48:55 +0300, Valery Ushakov wrote: > On Thu, Nov 07, 2019 at 13:37:21 +0100, Kamil Rytarowski wrote: > > > On 07.11.2019 13:17, Valery Ushakov wrote: > > > On Thu, Nov 07, 2019 at 06:02:39 +0100, Kamil Rytarowski wrote: > > > > > >> I have checked received the

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 11:53, Martin Husemann wrote: > On Thu, Nov 07, 2019 at 11:46:47AM +0100, Kamil Rytarowski wrote: >> Please see my newer mail with rationale and another one with a >> confirmation that this was real UB. > > Confirmation? The dereference in this case happens in memcmp() > only, so

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 13:17, Valery Ushakov wrote: > On Thu, Nov 07, 2019 at 06:02:39 +0100, Kamil Rytarowski wrote: > >> I have checked received the following patch and received a feedback from >> a LLVM developer. >> >> On 07.11.2019 05:47, 'Dmitry Vyukov' via syzkaller-netbsd-bugs wrote: >>> I've

Re: CVS commit: src/sys/kern

2019-11-07 Thread Valery Ushakov
On Thu, Nov 07, 2019 at 13:37:21 +0100, Kamil Rytarowski wrote: > On 07.11.2019 13:17, Valery Ushakov wrote: > > On Thu, Nov 07, 2019 at 06:02:39 +0100, Kamil Rytarowski wrote: > > > >> I have checked received the following patch and received a feedback from > >> a LLVM developer. > >> > >> On

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 13:48, Valery Ushakov wrote: > On Thu, Nov 07, 2019 at 13:37:21 +0100, Kamil Rytarowski wrote: > >> On 07.11.2019 13:17, Valery Ushakov wrote: >>> On Thu, Nov 07, 2019 at 06:02:39 +0100, Kamil Rytarowski wrote: >>> As a side note - the C99 standard contains "derefer" exactly once,

Re: CVS commit: src/sys/kern

2019-11-07 Thread Martin Husemann
On Thu, Nov 07, 2019 at 04:45:31PM +0100, Kamil Rytarowski wrote: > Unfortunately the C committee went into the opposite direction here and > specified a potential dereference. Where? Martin

Re: CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
On 07.11.2019 16:26, Martin Husemann wrote: > On Thu, Nov 07, 2019 at 02:53:08PM +0100, Kamil Rytarowski wrote: >> On 07.11.2019 14:25, Valery Ushakov wrote: >>> If the sanitizer does complain about other uses, there is little point >>> in fixing one instance and not the others. >> >> We already

CVS commit: src/lib/libc/tls

2019-11-07 Thread Joerg Sonnenberger
Module Name:src Committed By: joerg Date: Thu Nov 7 22:25:22 UTC 2019 Modified Files: src/lib/libc/tls: tls.c Log Message: Mirror the ld.elf_so logic for handling aligning the TLS size. Most noticable, recompute the start of the TLS area for variant I relative to the

CVS commit: src/lib/libc/tls

2019-11-07 Thread Joerg Sonnenberger
Module Name:src Committed By: joerg Date: Thu Nov 7 22:25:22 UTC 2019 Modified Files: src/lib/libc/tls: tls.c Log Message: Mirror the ld.elf_so logic for handling aligning the TLS size. Most noticable, recompute the start of the TLS area for variant I relative to the

CVS commit: src/sys/kern

2019-11-07 Thread Joerg Sonnenberger
Module Name:src Committed By: joerg Date: Thu Nov 7 19:45:18 UTC 2019 Modified Files: src/sys/kern: kern_lwp.c Log Message: Preserve the LWP ID of the calling thread on (v)fork. This ensures that _lwp_self() remains invariant as necessary for the locking in the dynamic

CVS commit: src/sys/kern

2019-11-07 Thread Joerg Sonnenberger
Module Name:src Committed By: joerg Date: Thu Nov 7 19:45:18 UTC 2019 Modified Files: src/sys/kern: kern_lwp.c Log Message: Preserve the LWP ID of the calling thread on (v)fork. This ensures that _lwp_self() remains invariant as necessary for the locking in the dynamic

CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
Module Name:src Committed By: kamil Date: Thu Nov 7 20:34:29 UTC 2019 Modified Files: src/sys/kern: subr_disk_mbr.c Log Message: Revert subr_disk_mbr.c r.1.54 Requested by as there can be a better way to fix the original problem with alignment. To generate a diff of

CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
Module Name:src Committed By: kamil Date: Thu Nov 7 20:34:29 UTC 2019 Modified Files: src/sys/kern: subr_disk_mbr.c Log Message: Revert subr_disk_mbr.c r.1.54 Requested by as there can be a better way to fix the original problem with alignment. To generate a diff of

CVS commit: src/sys/dev/pci

2019-11-07 Thread Tohru Nishimura
Module Name:src Committed By: nisimura Date: Thu Nov 7 22:00:37 UTC 2019 Modified Files: src/sys/dev/pci: if_kse.c Log Message: comment touchup To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/if_kse.c Please note that diffs are not public

CVS commit: src/sys/dev/pci

2019-11-07 Thread Tohru Nishimura
Module Name:src Committed By: nisimura Date: Thu Nov 7 22:00:37 UTC 2019 Modified Files: src/sys/dev/pci: if_kse.c Log Message: comment touchup To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/if_kse.c Please note that diffs are not public

CVS commit: src/sys/arch/x86/x86

2019-11-07 Thread SAITOH Masanobu
Module Name:src Committed By: msaitoh Date: Fri Nov 8 04:15:02 UTC 2019 Modified Files: src/sys/arch/x86/x86: intr.c Log Message: Fix a bug that evcnt_detach() called twice when the idt vector is full. OK'd by knakahara. To generate a diff of this commit: cvs rdiff -u

CVS commit: src/sys/arch/x86/x86

2019-11-07 Thread SAITOH Masanobu
Module Name:src Committed By: msaitoh Date: Fri Nov 8 04:15:02 UTC 2019 Modified Files: src/sys/arch/x86/x86: intr.c Log Message: Fix a bug that evcnt_detach() called twice when the idt vector is full. OK'd by knakahara. To generate a diff of this commit: cvs rdiff -u

CVS commit: src/sys/dev/pci

2019-11-07 Thread SAITOH Masanobu
Module Name:src Committed By: msaitoh Date: Fri Nov 8 04:45:55 UTC 2019 Modified Files: src/sys/dev/pci: pcidevs.h pcidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.1377 -r1.1378 src/sys/dev/pci/pcidevs.h cvs rdiff -u -r1.1376

CVS commit: src/sys/dev/pci

2019-11-07 Thread SAITOH Masanobu
Module Name:src Committed By: msaitoh Date: Fri Nov 8 04:37:45 UTC 2019 Modified Files: src/sys/dev/pci: pcidevs Log Message: - Update Intel's NVMe SSDs. - Modify 0x0953's description to "750 or DC P3[567]00 SSD" - Add DC P4[56]00 - Add Apollo Lake TXE HECI. To

CVS commit: src/sys/dev/pci

2019-11-07 Thread SAITOH Masanobu
Module Name:src Committed By: msaitoh Date: Fri Nov 8 04:37:45 UTC 2019 Modified Files: src/sys/dev/pci: pcidevs Log Message: - Update Intel's NVMe SSDs. - Modify 0x0953's description to "750 or DC P3[567]00 SSD" - Add DC P4[56]00 - Add Apollo Lake TXE HECI. To

CVS commit: src/sys/dev/pci

2019-11-07 Thread Tohru Nishimura
Module Name:src Committed By: nisimura Date: Thu Nov 7 09:05:29 UTC 2019 Modified Files: src/sys/dev/pci: if_kse.c Log Message: clarify 8842 MAC behaves 100FDX only has no alternative media selection possible. To generate a diff of this commit: cvs rdiff -u -r1.39

CVS commit: src/sys/dev/pci

2019-11-07 Thread Tohru Nishimura
Module Name:src Committed By: nisimura Date: Thu Nov 7 09:05:29 UTC 2019 Modified Files: src/sys/dev/pci: if_kse.c Log Message: clarify 8842 MAC behaves 100FDX only has no alternative media selection possible. To generate a diff of this commit: cvs rdiff -u -r1.39

CVS commit: src/sys/arch/arm/rockchip

2019-11-07 Thread Jared D. McNeill
Module Name:src Committed By: jmcneill Date: Fri Nov 8 00:35:16 UTC 2019 Modified Files: src/sys/arch/arm/rockchip: rk_i2c.c Log Message: Support reads of more than 32 bytes in a single xfer. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6

CVS commit: src/sys/arch/arm/rockchip

2019-11-07 Thread Jared D. McNeill
Module Name:src Committed By: jmcneill Date: Fri Nov 8 00:35:16 UTC 2019 Modified Files: src/sys/arch/arm/rockchip: rk_i2c.c Log Message: Support reads of more than 32 bytes in a single xfer. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6

CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
Module Name:src Committed By: kamil Date: Thu Nov 7 20:30:49 UTC 2019 Modified Files: src/sys/kern: subr_disk_mbr.c Log Message: Decorate check_label_magic() with __noubsan Requested by To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55

CVS commit: src/sys/kern

2019-11-07 Thread Kamil Rytarowski
Module Name:src Committed By: kamil Date: Thu Nov 7 20:30:49 UTC 2019 Modified Files: src/sys/kern: subr_disk_mbr.c Log Message: Decorate check_label_magic() with __noubsan Requested by To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55