Source-Changes-HG archive

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

[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs external/cddl/osn...



details:   https://anonhg.NetBSD.org/src/rev/9c8bcaa3baf3
branches:  trunk
changeset: 745719:9c8bcaa3baf3
user:      fox <fox%NetBSD.org@localhost>
date:      Mon Mar 09 15:40:50 2020 +0000

description:
external/cddl/osnet: Fix possible null pointer access.

Detected by UBSan and fixed upstream, pick only the fix from the commit.

Cherry-pick:
>From 928e8ad47d3478a3d5d01f0dd6ae74a9371af65e Mon Sep 17 00:00:00 2001
From: Serapheim Dimitropoulos <serapheimd%gmail.com@localhost>
Date: Wed, 20 Feb 2019 09:59:57 -0800
Subject: [PATCH] Introduce auxiliary metaslab histograms

Reviewed by: Paul Dagnelie <pcd%delphix.com@localhost>
Reviewed-by: Brian Behlendorf <behlendorf1%llnl.gov@localhost>
Reviewed by: Matt Ahrens <mahrens%delphix.com@localhost>
Signed-off-by: Serapheim Dimitropoulos <serapheim%delphix.com@localhost>
Closes #8358

Reviewed by: kamil@

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/metaslab.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r c34de9394b07 -r 9c8bcaa3baf3 external/cddl/osnet/dist/uts/common/fs/zfs/metaslab.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/metaslab.c     Mon Mar 09 15:37:46 2020 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/metaslab.c     Mon Mar 09 15:40:50 2020 +0000
@@ -3370,7 +3370,7 @@
     zio_alloc_list_t *zal, zio_t *zio)
 {
        dva_t *dva = bp->blk_dva;
-       dva_t *hintdva = hintbp->blk_dva;
+       dva_t *hintdva = (hintbp != NULL) ? hintbp->blk_dva : NULL;
        int error = 0;
 
        ASSERT(bp->blk_birth == 0);



Home | Main Index | Thread Index | Old Index