From owner-svn-src-stable@FreeBSD.ORG Mon Sep 16 12:42:20 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 45379791; Mon, 16 Sep 2013 12:42:20 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bk0-x235.google.com (mail-bk0-x235.google.com [IPv6:2a00:1450:4008:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C9132A7C; Mon, 16 Sep 2013 12:42:19 +0000 (UTC) Received: by mail-bk0-f53.google.com with SMTP id d7so1466355bkh.26 for ; Mon, 16 Sep 2013 05:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=IK9gujTyD/CEzs5FG0gpjZhq63qEta1WhhBQI7b2QUA=; b=ZTEMbU1eHUqi8lrqNjrGy29Q+QXN44VnyEWcVUhIr1v6tgWhZ5MeX+CCEzw1s0Nvz0 ayIr+Hjq2e/WlOuBMMP2y9neEX3XueInsUpk3Bbwqk4iMB0kNddOkcyFIPv8OVo1c3Mr JZRWBUzw0AEn0d5Rep3ly3Q5TQvgHa5KILGnnPMYAlMPzPnnqZPoIuW3y1FT2b/2qfnu u5r0s7tld6kpw5w3DiD7pgIB+tgNBqsaxjZ0Z6KU62QJ913AyWnG6XiUT3oc+PYpvHo4 uLfHJev1ML89cb+xVqbyLNH3MtG325uMjLXupXiXnY+9NIujBajD0rHHZDMZjRqOQ9R/ cWpA== X-Received: by 10.204.123.199 with SMTP id q7mr24693336bkr.10.1379335337405; Mon, 16 Sep 2013 05:42:17 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([5.248.115.71]) by mx.google.com with ESMTPSA id b6sm7562305bko.16.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Sep 2013 05:42:16 -0700 (PDT) Sender: Alexander Motin Message-ID: <5236FCA6.6070106@FreeBSD.org> Date: Mon, 16 Sep 2013 15:42:14 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130616 Thunderbird/17.0.6 MIME-Version: 1.0 To: Ivan Voras Subject: Re: svn commit: r255567 - stable/9/sys/geom/zero References: <201309141012.r8EACTW9032484@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2013 12:42:20 -0000 On 16.09.2013 15:20, Ivan Voras wrote: > On 14 September 2013 12:12, Alexander Motin wrote: > >> Add unmapped BIO support to GEOM ZERO if kern.geom.zero.clear is cleared. > >> + if (g_zero_clear && (bp->bio_flags & BIO_UNMAPPED) == 0) >> memset(bp->bio_data, g_zero_byte, bp->bio_length); > > > Umm, I might be wrong, but won't this basically export random kernel > memory to anyone reading from /dev/gzero? I may be wrong, but I think it won't. Buffer for reading is provided by the caller, mapped to KVA and then unmapped back without modifications. If there was some garbage in the buffer, it will remain there, but that is a caller's garbage. There may be exceptions in case of of gstripe and graid3 that allocate own buffers I am not sure they clean before use, but do you know many people using graid3 on top of gzero? -- Alexander Motin