Re: CVS commit: src/sys/compat/netbsd32

2020-03-08 Thread Paul Goyette

On Mon, 9 Mar 2020, Paul Goyette wrote:


Module Name:src
Committed By:   pgoyette
Date:   Mon Mar  9 01:06:34 UTC 2020

Modified Files:
src/sys/compat/netbsd32: netbsd32_mod.c

Log Message:
If a syscall requires a module to be autoloaded, the initial invocation
of that syscall will return ERESTART.  For amd64's netbsd32_syscall()
that means we need to back up the PC saved in the trap frame so we can
re-issue the syscall instruction.  For "normal" syscall traps, we saved
the instruction length in the trap frame, but this was missing for the
oosyscall/lcall path.  Since the PC was not backed up, the kernel-only
value ERESTART was returned to userland, causing all sort of grief for
old compat_netbsd32 executables!


While here, I also added some comments on some recent #endif to better
identify their associated #if - no functional change intended for this.



XXX Pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/compat/netbsd32/netbsd32_mod.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


!DSPAM:5e6596db22973983836595!




++--+---+
| Paul Goyette   | PGP Key fingerprint: | E-mail addresses: |
| (Retired)  | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org   |
++--+---+


Re: CVS commit: src/usr.bin/finger

2020-03-08 Thread Luke Mewburn


On 20-01-30 23:50, Sevan Janiyan wrote:
  | Module Name:src
  | Committed By:   sevan
  | Date:   Thu Jan 30 23:50:23 UTC 2020
  | 
  | Modified Files:
  | src/usr.bin/finger: finger.1
  | 
  | Log Message:
  | Drop url which is now invalid, see CSRG archive or mirrors on TUHS.org or
  | svnweb.FreeBSD.org

I think the URL was always invalid because ".ua" is not Australia
(".au" is), and TUHS is maintained by Warren Toomey in Australia.

Looks like TUHS is now at https://www.tuhs.org or ftp://www.tuhs.org
but the I can't find a variation the link below any more.


  | 
  | To generate a diff of this commit:
  | cvs rdiff -u -r1.19 -r1.20 src/usr.bin/finger/finger.1
  | 
  | Please note that diffs are not public domain; they are subject to the
  | copyright notices on the relevant files.
  | 

  | Modified files:
  | 
  | Index: src/usr.bin/finger/finger.1
  | diff -u src/usr.bin/finger/finger.1:1.19 src/usr.bin/finger/finger.1:1.20
  | @@ -212,5 +212,4 @@ last login data base
  |  The
  |  .Nm
  |  command appeared in
  | -.Bx 2.0 :
  | -.Lk ftp://ftp.tuhs.org.ua/PDP-11/Distributions/ucb/2bsd.tar.gz
  | +.Bx 2.0
  | 



Re: CVS commit: src/sys/kern

2020-03-08 Thread Andrew Doran
On Sun, Mar 08, 2020 at 08:34:29AM +0100, Maxime Villard wrote:
> Le 08/03/2020 ? 01:31, Andrew Doran a ?crit?:
> > Module Name:src
> > Committed By:   ad
> > Date:   Sun Mar  8 00:31:19 UTC 2020
> > 
> > Modified Files:
> > src/sys/kern: subr_kmem.c
> > 
> > Log Message:
> > KMEM_SIZE: append the size_t to the allocated buffer, rather than
> > prepending, so it doesn't screw up the alignment of the buffer.
> > 
> > Reported-by: syzbot+c024c50570cccac51...@syzkaller.appspotmail.com
> > 
> > 
> > To generate a diff of this commit:
> > cvs rdiff -u -r1.78 -r1.79 src/sys/kern/subr_kmem.c
> > 
> > Please note that diffs are not public domain; they are subject to the
> > copyright notices on the relevant files.
> 
> This is wrong. The point of KMEM_SIZE is to store at a reliable location
> the size of the buffer, in order to then verify that the 'size' argument
> given to kmem_free() is correct.
> 
> Here, you are using that size argument to compute the location, which
> breaks the whole point of the check.

Sure I understand the frustration, but it's still correct according to
the parameters I set for it 10+ years ago, which were for it to be a
quick-n-dirty diagnostic aid.

> Also it probably collides with the KASAN shadow.

Hmm, is that purely an alignment issue then, because it works in 8 byte
cells?  Otherwise it sounds like this should not be enabled with KASAN at
all.

Andrew
 
> Please revert this change.
>
> As said previously, if cacheline alignment is expected this way, then it
> should clearly be part of the kmem contract, and documented to be so.


Re: CVS commit: src/lib/libc/compiler_rt

2020-03-08 Thread Joerg Sonnenberger
On Sun, Mar 08, 2020 at 06:30:06AM +, Rin Okuyama wrote:
> Module Name:  src
> Committed By: rin
> Date: Sun Mar  8 06:30:06 UTC 2020
> 
> Modified Files:
>   src/lib/libc/compiler_rt: Makefile.inc
> 
> Log Message:
> Fix broken printf(3) %d output for numbers more than two digits, e.g.,
> 
>   printf("%d\n", 42) ---> "::" instead of "42"
> 
> Our __{,u}modsi3 codes assume that __udivsi3 returns remainder to
> %d1 (volatile register). __udivsi3 in libgcc does not, and therefore
> mixing them up results in mess.

This looks like the wrong fix to me. This is not about libgcc at all.
The depency in the src/common code should be fixed IMO. If __{,u}modsi3
wants to make assumptions about the remainder being implicitly computed,
it really should be using the divmod primitive instead.

Joerg


Re: CVS commit: src/sys/dev/hid

2020-03-08 Thread Martin Husemann
On Sun, Mar 08, 2020 at 02:16:00PM -, Christos Zoulas wrote:
> >Log Message:
> >Use unsigned to avoid undefined behavior. Found by kUBSan.
> 
> I think it is better to add U to all the HUP_ constants for consistency.
> It looks funny this way.

Yes, please keep it consistent.

Martin


Re: CVS commit: src/sys/dev/hid

2020-03-08 Thread Christos Zoulas
In article <20200308140933.1b842f...@cvs.netbsd.org>,
SAITOH Masanobu  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  msaitoh
>Date:  Sun Mar  8 14:09:33 UTC 2020
>
>Modified Files:
>   src/sys/dev/hid: hid.h
>
>Log Message:
>Use unsigned to avoid undefined behavior. Found by kUBSan.

I think it is better to add U to all the HUP_ constants for consistency.
It looks funny this way.

christos



re: CVS commit: src/sys/arch/sun2/conf

2020-03-08 Thread matthew green
"Rin Okuyama" writes:
> Module Name:  src
> Committed By: rin
> Date: Sun Mar  8 06:25:10 UTC 2020
> 
> Modified Files:
>   src/sys/arch/sun2/conf: GENERIC
> 
> Log Message:
> Retire md(4) in favor of tmpfs provided by module,
> though both are not useful for 8MB RAM system...

hi Rin.


it's cool you got modules on sun2 working... however, the
module version of a thing is going to use more real memory
than the built-in version, so i'm not sure where this is
going yet...

8MB?  luxury?  :)  i've been testing in 4MB tme :)


.mrg.