From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751270AbbIJXIR (ORCPT ); Thu, 10 Sep 2015 19:08:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50408 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbbIJXIQ (ORCPT ); Thu, 10 Sep 2015 19:08:16 -0400 Date: Thu, 10 Sep 2015 16:08:15 -0700 From: Andrew Morton To: Vitaly Kuznetsov Cc: Andy Shevchenko , Rasmus Villemoes , James Bottomley , linux-kernel@vger.kernel.org, "K. Y. Srinivasan" Subject: Re: [PATCH] lib/string_helpers.c: fix infinite loop in string_get_size() Message-Id: <20150910160815.30d56ee48bbfdf5eed783c53@linux-foundation.org> In-Reply-To: <1441371393-15030-1-git-send-email-vkuznets@redhat.com> References: <1441371393-15030-1-git-send-email-vkuznets@redhat.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 4 Sep 2015 14:56:33 +0200 Vitaly Kuznetsov wrote: > string_get_size(1, 512, 0, ..., ...) call results in an infinite loop. The > problem is that if size == 0 when we start calculating sf_cap this loop > will never end. > > The caller causing the issue is sd_read_capacity(), the problem was noticed > on Hyper-V. When fixing bugs, please provide enough info for others to be able to understand which kernel version(s) need the fix. In this case: what end-user action triggers this bug? (iow, how does sdkp->capacity become zero?)