diff options
| author | John Levon <john.levon@joyent.com> | 2018-12-18 13:28:52 +0000 |
|---|---|---|
| committer | Robert Mustacchi <rm@joyent.com> | 2019-01-18 15:34:59 +0000 |
| commit | 066570e74d37d22ae7d90b89576bf0df451f0349 (patch) | |
| tree | 9a2c81460edd3bcb496255761e4f837b44466995 /usr/src | |
| parent | 2dc5cbd37af38054ac6aab88a3ecee22a13ed2eb (diff) | |
| download | illumos-joyent-066570e74d37d22ae7d90b89576bf0df451f0349.tar.gz | |
10093 kmem_log_enter() dereferences pointer before NULL check
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Reviewed by: Gergő Doma <domag02@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/uts/common/os/kmem.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/src/uts/common/os/kmem.c b/usr/src/uts/common/os/kmem.c index b41ab8c465..5f85f396ec 100644 --- a/usr/src/uts/common/os/kmem.c +++ b/usr/src/uts/common/os/kmem.c @@ -1425,11 +1425,13 @@ static void * kmem_log_enter(kmem_log_header_t *lhp, void *data, size_t size) { void *logspace; - kmem_cpu_log_header_t *clhp = &lhp->lh_cpu[CPU->cpu_seqid]; + kmem_cpu_log_header_t *clhp; if (lhp == NULL || kmem_logging == 0 || panicstr) return (NULL); + clhp = &lhp->lh_cpu[CPU->cpu_seqid]; + mutex_enter(&clhp->clh_lock); clhp->clh_hits++; if (size > clhp->clh_avail) { |
