Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat Fix pserialize enter/exit pairs in linux_getifcon...



details:   https://anonhg.NetBSD.org/src/rev/41d4104b7f6e
branches:  trunk
changeset: 832409:41d4104b7f6e
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu May 10 01:32:24 2018 +0000

description:
Fix pserialize enter/exit pairs in linux_getifconf and linux32_getifconf

Tested by using a small linux program that uses ioctl(SIOCGIFCONF).
Probably fix PR kern/53259 as well.

diffstat:

 sys/compat/linux/common/linux_socket.c     |  6 +++---
 sys/compat/linux32/common/linux32_socket.c |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r c539ae4d595f -r 41d4104b7f6e sys/compat/linux/common/linux_socket.c
--- a/sys/compat/linux/common/linux_socket.c    Thu May 10 00:30:56 2018 +0000
+++ b/sys/compat/linux/common/linux_socket.c    Thu May 10 01:32:24 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_socket.c,v 1.141 2018/05/03 21:43:33 christos Exp $      */
+/*     $NetBSD: linux_socket.c,v 1.142 2018/05/10 01:32:24 ozaki-r Exp $       */
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.141 2018/05/03 21:43:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.142 2018/05/10 01:32:24 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1183,7 +1183,7 @@
                        ifa_release(ifa, &psref_ifa);
                }
 
-               s = pserialize_read_enter();
+               KASSERT(pserialize_in_read_section());
                if_release(ifp, &psref);
        }
        pserialize_read_exit(s);
diff -r c539ae4d595f -r 41d4104b7f6e sys/compat/linux32/common/linux32_socket.c
--- a/sys/compat/linux32/common/linux32_socket.c        Thu May 10 00:30:56 2018 +0000
+++ b/sys/compat/linux32/common/linux32_socket.c        Thu May 10 01:32:24 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_socket.c,v 1.28 2017/11/22 10:19:14 ozaki-r Exp $ */
+/*     $NetBSD: linux32_socket.c,v 1.29 2018/05/10 01:32:24 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.28 2017/11/22 10:19:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.29 2018/05/10 01:32:24 ozaki-r Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -478,7 +478,7 @@
                        ifa_release(ifa, &psref_ifa);
                }
 
-               s = pserialize_read_enter();
+               KASSERT(pserialize_in_read_section());
                if_release(ifp, &psref);
        }
        pserialize_read_exit(s);



Home | Main Index | Thread Index | Old Index