Skip to contentSkip to conversation

Fix lock_iovec

PATCH In review Kirill A. Shutemov 3 participants 3 messages Jan 30, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix lock_iovec

Do not stop iovec conversion on iov_base == NULL if iov_len is 0

---
 linux-user/syscall.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/syscall.c +1 -1
index d099e97..5dc6594 100644
@@ -1028,7 +1028,7 @@ static abi_long lock_iovec(int type, struct iovec *vec, abi_ulong target_addr,
         base = tswapl(target_vec[i].iov_base);
         vec[i].iov_len = tswapl(target_vec[i].iov_len);
         vec[i].iov_base = lock_user(type, base, vec[i].iov_len, copy);
-       if (!vec[i].iov_base) 
+       if (!vec[i].iov_base && vec[i].iov_len)
             goto fail;
     }
     unlock_user (target_vec, target_addr, 0);
Signature · 4 lines
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + Velesys Ltd, http://www.velesys.com/
 + ALT Linux Team, http://www.altlinux.com/
#1 lore raw

Hi...

Quoted 1 line · Kirill A. Shutemov

Do not stop iovec conversion on iov_base == NULL if iov_len is 0

"is 0" or "is not 0"?

regards,

Mulyadi.

#2 lore raw
Quoted 5 lines · Mulyadi Santosa

Hi...

Quoted 1 line · Kirill A. Shutemov

Do not stop iovec conversion on iov_base == NULL if iov_len is 0

"is 0" or "is not 0"?

For now, iovec conversion stops on iov_base == NULL, but NULL in iov_base is correct if iov_len is 0.

Signature · 4 lines
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + Velesys Ltd, http://www.velesys.com/
 + ALT Linux Team, http://www.altlinux.com/