Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-24 Thread Paul Burton
On Tue, Jun 24, 2014 at 09:19:45AM +0100, Peter Maydell wrote: > On 24 June 2014 00:53, Paul Burton wrote: > > Well I disagree with your logic, but perhaps that's primarily because of > > your claim that the semctl code is "clearly bogus" and "obviously > > broken". Could you back that up? I know

Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-24 Thread Peter Maydell
On 24 June 2014 00:53, Paul Burton wrote: > Well I disagree with your logic, but perhaps that's primarily because of > your claim that the semctl code is "clearly bogus" and "obviously > broken". Could you back that up? I know there's the one bogus line in > the GETVAL/SETVAL case that was mention

Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-23 Thread Paul Burton
On Mon, Jun 23, 2014 at 11:42:14PM +0100, Peter Maydell wrote: > On 23 June 2014 23:36, Paul Burton wrote: > > Actually no, I don't think you're right about that afterall. The > > argument union itself is never modified. I imagine if it were then it > > would be painful in the case of the semctl s

Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-23 Thread Paul Burton
On Tue, Jun 24, 2014 at 12:21:42AM +0100, Peter Maydell wrote: > On 24 June 2014 00:06, Paul Burton wrote: > > On Mon, Jun 23, 2014 at 11:35:17PM +0100, Peter Maydell wrote: > >> and so I'm dubious about a patch that's > >> trying to make a very small change to it > > > > Isn't that precisely how

Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-23 Thread Peter Maydell
On 24 June 2014 00:06, Paul Burton wrote: > On Mon, Jun 23, 2014 at 11:35:17PM +0100, Peter Maydell wrote: >> and so I'm dubious about a patch that's >> trying to make a very small change to it > > Isn't that precisely how good bisectable bug fixes should be made? The key is in the second half of

Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-23 Thread Paul Burton
On Mon, Jun 23, 2014 at 11:35:17PM +0100, Peter Maydell wrote: > >> Have you checked this on other architectures than MIPS? > >> I have a vague recollection that there are between-arch > >> differences regarding handling of the semctl argument... > > > > I haven't tried running code for any other t

Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-23 Thread Peter Maydell
On 23 June 2014 23:36, Paul Burton wrote: > Actually no, I don't think you're right about that afterall. The > argument union itself is never modified. I imagine if it were then it > would be painful in the case of the semctl syscall where the union is > passed directly as an argument, rather than

Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-23 Thread Paul Burton
On Mon, Jun 23, 2014 at 11:18:25PM +0100, Paul Burton wrote: > > Also, VERIFY_READ doesn't seem right for some of the > > semctl operations which will modify the target_semun. > > > > thanks > > -- PMM > > That part I think you're right about, I'll switch to VERIFY_WRITE. Actually no, I don't th

Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-23 Thread Peter Maydell
On 23 June 2014 23:18, Paul Burton wrote: > On Mon, Jun 23, 2014 at 11:12:42PM +0100, Peter Maydell wrote: >> On 23 June 2014 22:40, Paul Burton wrote: >> > The ptr argument to the ipc syscall was incorrectly being used as the >> > value of the argument union for the SEMCTL call. It is actually,

Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-23 Thread Paul Burton
On Mon, Jun 23, 2014 at 11:12:42PM +0100, Peter Maydell wrote: > On 23 June 2014 22:40, Paul Burton wrote: > > The ptr argument to the ipc syscall was incorrectly being used as the > > value of the argument union for the SEMCTL call. It is actually, as its > > name would suggest, a pointer to that

Re: [Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-23 Thread Peter Maydell
On 23 June 2014 22:40, Paul Burton wrote: > The ptr argument to the ipc syscall was incorrectly being used as the > value of the argument union for the SEMCTL call. It is actually, as its > name would suggest, a pointer to that union. Have you checked this on other architectures than MIPS? I have

[Qemu-devel] [PATCH] linux-user: fix ipc(SEMCTL, ...) argument handling

2014-06-23 Thread Paul Burton
The ptr argument to the ipc syscall was incorrectly being used as the value of the argument union for the SEMCTL call. It is actually, as its name would suggest, a pointer to that union. Fix by dereferencing the pointer to obtain the target argument union. This fixes fakeroot, or at least version