Date: Mon, 11 May 2020 21:42:19 +0000 (UTC) From: Kristof Provost <kp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360935 - head/sys/opencrypto Message-ID: <202005112142.04BLgJNB052524@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kp Date: Mon May 11 21:42:19 2020 New Revision: 360935 URL: https://svnweb.freebsd.org/changeset/base/360935 Log: opencrypto: Add missing ioctl exit SDTs The opencrypto ioctl code has very useful probe points at the various exit points. These allow us to figure out exactly why a request failed. However, a few paths did not have these probe points. Add them here. Reviewed by: jhb Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Mon May 11 21:39:02 2020 (r360934) +++ head/sys/opencrypto/cryptodev.c Mon May 11 21:42:19 2020 (r360935) @@ -465,6 +465,8 @@ cryptof_ioctl( /* Should always be paired with GCM. */ if (sop->cipher != CRYPTO_AES_NIST_GCM_16) { CRYPTDEB("GMAC without GCM"); + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } break; @@ -539,8 +541,10 @@ cryptof_ioctl( return (EINVAL); } - if (txform == NULL && thash == NULL) + if (txform == NULL && thash == NULL) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); + } memset(&csp, 0, sizeof(csp)); @@ -550,13 +554,18 @@ cryptof_ioctl( case CRYPTO_AES_128_NIST_GMAC: case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: - if (sop->keylen != sop->mackeylen) + if (sop->keylen != sop->mackeylen) { + SDT_PROBE1(opencrypto, dev, ioctl, + error, __LINE__); return (EINVAL); + } break; #endif case 0: break; default: + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } csp.csp_mode = CSP_MODE_AEAD; @@ -564,14 +573,19 @@ cryptof_ioctl( switch (sop->mac) { #ifdef COMPAT_FREEBSD12 case CRYPTO_AES_CCM_CBC_MAC: - if (sop->keylen != sop->mackeylen) + if (sop->keylen != sop->mackeylen) { + SDT_PROBE1(opencrypto, dev, ioctl, + error, __LINE__); return (EINVAL); + } thash = NULL; break; #endif case 0: break; default: + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } csp.csp_mode = CSP_MODE_AEAD;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005112142.04BLgJNB052524>