[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dragonfly-commits
Subject:    git: DragonFly_RELEASE_5_2 if_tap: Disallow to destroy an opened device
From:       Aaron LI <aly () crater ! dragonflybsd ! org>
Date:       2018-08-30 13:58:12
Message-ID: 20180830135812.96DC33DF9D8 () crater ! dragonflybsd ! org
[Download RAW message or body]


commit 07f09928e5993fbd5dcc7b98b37cdb429dfe225f
Author: Aaron LI <aly@aaronly.me>
Date:   Thu Aug 30 21:13:27 2018 +0800

    if_tap: Disallow to destroy an opened device
    
    When a tap device (created via 'ifconfig') is opened, disallow to destroy
    it (e.g., ifconfig destroy).  Otherwise, a panic occurs when the caller
    closes the device, since it has been already destroyed.
    
    Test case:
    [A]% ifconfig tap0 create
    [B]% # run a program that opens '/dev/tap0' and keep it running
    [A]% ifconfig tap0 destroy
    [B]% # exit the program which will then close '/dev/tap0'
    => panic!
    
    In addition:
    * Add an assertion to tapclose() to assert the device must exist.
    * Return EINVAL instead of ENOIX when try to destroy an manually created
      tap device.

Summary of changes:
 sys/net/tap/if_tap.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/07f09928e5993fbd5dcc7b98b37cdb429dfe225f


-- 
DragonFly BSD source repository
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic