Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp420610imm; Tue, 7 Aug 2018 22:26:23 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx1vlMRYP0QgNqLCGX5GZvK3nUC7L+LxQFV/N5FbYhpca1JZyFnmtgufeqibj21xIfZY301 X-Received: by 2002:a63:e14a:: with SMTP id h10-v6mr1141185pgk.358.1533705983431; Tue, 07 Aug 2018 22:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533705983; cv=none; d=google.com; s=arc-20160816; b=FFrX8SrKNTOH/gbQGwEgWCkWxzEd0Mxja82+trbV+rXMCYruzTuuhFBDqZ1Vbveyim mmwrq1EMkm4nJzScaemxZCZqIX8+h1GpyOW0Rtl4wqfxy6lARyzuRWWvEIJMQySNXn6L 8NkyF/7gONTbDyV4OPK1x+KIrh272hJTAtSKwjQ7T3jvOsTcw6fk/D3pczKavp1Et+Js w1xWz91ij2P584XV1GY1/4BOfGnJaqNdfOKML5vSxtWpv8jsrmWQ35FCSB/gOiFsJLxs Lt+YCEGZiwwInEk8UZqTVavXCUqBnm8HsZ/tK4N0ILzwms+ObhBx3kGJVtacuYZZz8PB g0Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature :arc-authentication-results; bh=NJ61PDHsya3BtHIcFEgx29MCwXRWqNineuFDly6u++8=; b=Y58pf6UzDTwJEjX5dDIC1k4HyN21avkseGChaKWuLUACvyWlTEgIyAVkNb+wWR4UHl QLaUPFKqKVAHitfT/ZCmLLePSpyXZ3kPzDQ17FzZfbfnLyrTuhAWb12w+G0X0aLpcHOD o1wT6xwE6MaxvM6bSJkV2/zzgHvEQnNhD4o2v1ZoJylwpyJQbwc9gJdVtDoSx6DXhVgY 64NBbW1b2xB0r36hvKVxfzE5n+6MADJzTd9C8g52aBr6pGxjlx/531RrMPQBhqxpk0JV QgY2EWZihFVRYabCn6SwifwklUESOZYrhvVoi9eaSoMiq/B+C87iVNNwVnTku//bpu8e Pc7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=NwJkoCt2; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=BogTMRmU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si2598683plt.468.2018.08.07.22.26.08; Tue, 07 Aug 2018 22:26:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=NwJkoCt2; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=BogTMRmU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726869AbeHHHnL (ORCPT + 99 others); Wed, 8 Aug 2018 03:43:11 -0400 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:41029 "EHLO wnew2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726538AbeHHHnL (ORCPT ); Wed, 8 Aug 2018 03:43:11 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id D6055349; Wed, 8 Aug 2018 01:25:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 08 Aug 2018 01:25:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=NJ61PDHsya3BtHIcFEgx29MCwXRWqNineuFDly6u++8=; b=NwJkoCt2 v/CvGNr5nyQj+QqdB3EZHC95VnZ5qnZ81ajyYcUAsLrRNDorJ/AhI2Lm1utBFMM1 R3qTiOg9e0U7u11CRDzDEaUKrPtQ6/Kewt0l12Sf5kqKvYV6h59xvzGl1K/QIABk ajGGpbzcbIZN3hI20QcrqpHXxebSycu4e9uyGSkEG1CD2W9+80UWhro8VbCV/vyQ DSDG6L6KH4dAUoWr9RacorlyoI1/3WOHSWP/DvYLDx0YljLws8PxoUxQqrXKkLJZ Qe4CT/NexYTlDwdSizHcmwFQZmyGLgYOKNMRwX1QX1PI6gtK8fBbNfX5X/ENfcGw r6Rac8VWpBWcFg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=NJ61PDHsya3BtHIcFEgx29MCwXRWq NineuFDly6u++8=; b=BogTMRmUtEKQh4ElE2iBriMQmQbWTNnw65VfamclL4JU1 bc5dgVMKSW9miPjEmmbmUCdScKAeGFleGP+AAux6dhojdeW9qZ76gTJGeso+KqJ1 RRicR3SB0Z+Om+hkcCvXCLJRxBqAua2eWIR0MGdUpTAhv4DdKqMjJXaexbDlNf3U lDXtLrWUNDOzup4eh+uqFdByTIWCnP0A8o3RXM2nOiBQK9pSkknqr3zWYJBAG4sD 9s1Ssc2gwpgImDx8XDewhEPUZ9ODR4EzPeNo1kMTP43e/nQL3FxyR+Ab1oadihrd TJpG9U3CakbI2xV2WZHhva3DXBt2mkp+cjcnNfyrA== X-ME-Proxy: X-ME-Sender: Received: from localhost (unknown [194.244.16.108]) by mail.messagingengine.com (Postfix) with ESMTPA id ABB4010268; Wed, 8 Aug 2018 01:25:16 -0400 (EDT) Date: Wed, 8 Aug 2018 07:25:14 +0200 From: Greg KH To: xiao jin Cc: agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org, yanmin.zhang@intel.com Subject: Re: [PATCH] dm-bufio: adjust the reserved buffer for dm-verify-target. Message-ID: <20180808052514.GA20034@kroah.com> References: <1533704823-5448-1-git-send-email-jin.xiao@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1533704823-5448-1-git-send-email-jin.xiao@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 08, 2018 at 01:07:03PM +0800, xiao jin wrote: > We hit the BUG() report at include/linux/scatterlist.h:144! > The callback is as bellow: > => verity_work > => verity_hash_for_block > => verity_verify_level > => verity_hash > => verity_hash_update > => sg_init_one > => sg_set_buf > > More debug shows the root cause. When creating dufio client it > uses the __vmalloc() to allocate the buffer data for the reserved > dm_buffer. The buffer that allocated by the __vmalloc() is invalid > according to the __virt_addr_valid(). > > Mostly the reserved dm_buffer is not touched. But occasionally > it might fail to allocate the dm_buffer data when we try to > allocate in the __alloc_buffer_wait_no_callback(). Then it has > to take the reserved dm_buffer for usage. Finally it reports the > BUG() as virt_addr_valid() detects the buffer data address is invalid. > > The patch is to adjust the reserved buffer for dm-verity-target. We > allocated two dm_buffers into the reserved buffers list when creating > the buffer interface. The first dm_buffer in the reserved buffer list > is allocated by the __vmalloc(), it's not used after that. The second > dm_buffer in the reserved buffer list is allocated by the > __get_free_pages() which can be consumed after that. > > Signed-off-by: xiao jin > --- > drivers/md/dm-bufio.c | 4 ++-- > drivers/md/dm-verity-target.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.