NetBSD-Bugs archive

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

Re: bin/58024: wg-userspace N destroy fails to destroy tun interface created by wg-userspace N create



The following reply was made to PR bin/58024; it has been noted by GNATS.

From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: gnats-bugs%NetBSD.org@localhost, netbsd-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/58024: wg-userspace N destroy fails to destroy tun interface created by wg-userspace N create
Date: Sun, 10 Mar 2024 06:46:03 +0000

 The EEXIST happens because of all this crud in the opencrypto rump
 component, used to create the /dev/crypto node in the rump system's
 namespace:
 
 https://nxr.netbsd.org/xref/src/sys/rump/dev/lib/libopencrypto/opencrypto_c=
 omponent.c?r=3D1.6#54
 
      54 	if ((error =3D devsw_attach("crypto", NULL, &bmaj,
      55 	    &crypto_cdevsw, &cmaj)) !=3D 0)
      56 		panic("cannot attach crypto: %d", error);
      57=20
      58 	if ((error =3D rump_vfs_makeonedevnode(S_IFCHR, "/dev/crypto",
      59 	    cmaj, 0)) !=3D 0)
      60 		panic("cannot create /dev/crypto: %d", error);
      61=20
      62 	/*
      63 	 * Initialize OpenCrypto and its pseudo-devices here
      64 	 */
      65 	crypto_init();
      66 	rump_pdev_add(cryptoattach, 1);
      67 #if 0
      68 	/*
      69 	 * rump defines "_MODULE" in spite of using built-in module
      70 	 * initialization(module_init_class()). So, swcryptoattach_interna=
 l()
      71 	 * is called by two functions, one is swcryptoattach() and the oth=
 er is
      72 	 * swcrypto_modcmd().
      73 	 * That causes "builtin module `swcrypto' failed to init" WARNING =
 message.
      74 	 * To suppress this warning, we let rump use swcrypto_modcmd() cal=
 l-path
      75 	 * only.
      76 	 *
      77 	 * TODO:
      78 	 * There is still "crypto: unable to register devsw, error 17" mes=
 sage.
      79 	 * it should be suppressed.
      80 	 */
      81 	rump_pdev_add(swcryptoattach, 0);
      82 #endif
 
 This is all very grody and should be done differently, and it's not
 clear that just suppressing the warning here is right.
 


Home | Main Index | Thread Index | Old Index