From owner-freebsd-emulation@FreeBSD.ORG Sat Jun 24 11:10:07 2006 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E0B116A47B for ; Sat, 24 Jun 2006 11:10:07 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8710043D48 for ; Sat, 24 Jun 2006 11:10:05 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.7/8.13.7) with ESMTP id k5OB9pIJ022596 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 24 Jun 2006 13:09:51 +0200 (CEST) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.7/8.13.3/Submit) id k5OB9prI022595; Sat, 24 Jun 2006 13:09:51 +0200 (CEST) Date: Sat, 24 Jun 2006 13:09:51 +0200 From: Divacky Roman To: Dmitry Ganenko Message-ID: <20060624110951.GA21539@stud.fit.vutbr.cz> References: <885310187.20060623143520@apk-inform.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <885310187.20060623143520@apk-inform.com> User-Agent: Mutt/1.4.2i X-Scanned-By: MIMEDefang 2.54 on 147.229.10.14 Cc: freebsd-emulation@freebsd.org Subject: Re: Installation of Oracle10g Express Edition on FreeBSD 5.4-RELEASE X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jun 2006 11:10:07 -0000 > --- compat/linux/linux_misc.c.orig Fri Apr 1 01:17:42 2005 > +++ compat/linux/linux_misc.c Wed Jun 21 11:14:05 2006 > @@ -711,8 +711,9 @@ linux_times(struct thread *td, struct li > tms.tms_cutime = CONVTCK(td->td_proc->p_stats->p_cru.ru_utime); > tms.tms_cstime = CONVTCK(td->td_proc->p_stats->p_cru.ru_stime); > > - if ((error = copyout(&tms, args->buf, sizeof(tms)))) > - return error; > + if (args->buf != NULL) > + if ((error = copyout(&tms, args->buf, sizeof(tms)))) > + return error; > > microuptime(&tv); > td->td_retval[0] = (int)CONVTCK(tv); this looks ok... a different version was commited > --- compat/linprocfs/linprocfs.c.orig Fri Apr 1 01:27:16 2005 > +++ compat/linprocfs/linprocfs.c Wed Jun 21 11:14:10 2006 > @@ -515,7 +515,7 @@ linprocfs_doprocstat(PFS_FILL_ARGS) > sbuf_printf(sb, "%d", p->p_pid); > #define PS_ADD(name, fmt, arg) sbuf_printf(sb, " " fmt, arg) > PS_ADD("comm", "(%s)", p->p_comm); > - PS_ADD("statr", "%c", '0'); /* XXX */ > + PS_ADD("statr", "%c", 'S'); /* XXX */ > PS_ADD("ppid", "%d", p->p_pptr ? p->p_pptr->p_pid : 0); > PS_ADD("pgrp", "%d", p->p_pgid); > PS_ADD("session", "%d", p->p_session->s_sid); > @@ -535,7 +535,7 @@ linprocfs_doprocstat(PFS_FILL_ARGS) > PS_ADD("priority", "%d", 0); /* XXX */ > PS_ADD("timeout", "%u", 0); /* XXX */ > PS_ADD("itrealvalue", "%u", 0); /* XXX */ > - PS_ADD("starttime", "%d", 0); /* XXX */ > + PS_ADD("starttime", "%d", 1); /* XXX */ > PS_ADD("vsize", "%ju", (uintmax_t)kp.ki_size); > PS_ADD("rss", "%ju", P2K((uintmax_t)kp.ki_rssize)); > PS_ADD("rlim", "%u", 0); /* XXX */ this looks "almost ok" netchild@ is working on a patch which puts there real values... thnx for the idea > The third patch corrects a bug (or maybe a feature) in the pseudofs > code (it is necessary for linprocfs). The case is, if you assemble > linprocfs and try such a program, then the read function will read not > 4 as it was asked but one point less, that is, as it is easily > calculated, 3 bytes: > > File test.c > > #include > #include > #include > #include > > main () { > int fd, count; > char buf[10]; > > fd = open("/compat/linux/proc/self/cmdline", O_RDONLY); > count = read(fd, buf, 4); > buf[4] = '\0'; > printf("count = %d, buf = %s\n", count, buf); > } > > I am not sure whether the third correction is absolutely right; > moreover, I am not sure as to its place in the code. This question is > to real kernel hackers. pls, can you explain how this manifest in the oracle? I agree that this is a bug but I am not sure why noone noticed this. the fact is that most people use "cat /proc/x/y" and cat reads 1024 bytes in this case so this doesnt manifest > File patch3 > > --- fs/pseudofs/pseudofs_vnops.c.orig Mon Sep 6 22:38:01 2004 > +++ fs/pseudofs/pseudofs_vnops.c Wed Jun 21 11:14:14 2006 > @@ -530,7 +530,7 @@ pfs_read(struct vop_read_args *va) > PRELE(proc); > PFS_RETURN (EIO); > } > - sb = sbuf_new(sb, NULL, buflen, 0); > + sb = sbuf_new(sb, NULL, buflen+1, 0); > if (sb == NULL) { > if (proc != NULL) > PRELE(proc); this is wrong... what about this: Index: pseudofs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/fs/pseudofs/pseudofs_vnops.c,v retrieving revision 1.59 diff -u -r1.59 pseudofs_vnops.c --- pseudofs_vnops.c 22 Feb 2006 18:57:49 -0000 1.59 +++ pseudofs_vnops.c 24 Jun 2006 11:08:59 -0000 @@ -515,7 +515,7 @@ if (uio->uio_offset < 0 || uio->uio_resid < 0 || (offset = uio->uio_offset) != uio->uio_offset || (resid = uio->uio_resid) != uio->uio_resid || - (buflen = offset + resid) < offset || buflen > INT_MAX) { + (buflen = offset + resid + 1) < offset || buflen > INT_MAX) { if (proc != NULL) PRELE(proc); PFS_RETURN (EINVAL);