Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1262101rwi; Thu, 20 Oct 2022 10:24:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM740iV4OHhyBJMDadu8Hva4hFWpLNrP6ogEH8K9xhq3gWCKg5PaP8htTAfld56X9GGxGdRk X-Received: by 2002:a05:6402:150a:b0:459:2575:99c6 with SMTP id f10-20020a056402150a00b00459257599c6mr13285607edw.231.1666286666559; Thu, 20 Oct 2022 10:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666286666; cv=none; d=google.com; s=arc-20160816; b=TUyHLvWvlHqH0CrzOUwb334/hkrrCrFh9XOYXRVu4d5EWeA1dJ3ft4i6irnXYl/acO Mo5FOLavlkEedbTDA0OUjtkaUl59rclk7Jula8fOrWKr4v3B4KV0b/44LFaEm1PVQGS6 7LHhOPlXBBpSyoynMfvmcc0RReXbFHp1IJB2zj2aB/zxigxvgSXQX7idFwgPsZogqPy0 hduOCBAhLna9Ctp7SjLfTfCKkWzRDfc0VK7vBTi2RJPwjCgqLMbqd/RI8RKcrNefv3oN 48QfjlazymEOekdeKBJKPDq7NqAFN+3ekWlaLGSpK77KLgA1GgfX/Lx/dyVMXfzRM0Pd NbIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R+1VJKvQ64gmQLT5pRI8etc5uGtTLhS05M3Tp9kQtVQ=; b=fsQvkrzcxsqdf8DLYXd/T8UhlIGR0ovot4WRXFOhVlms0bQtDyGxRV7bx89es/SAGS Tg2Botj859NDDItGvzDzY3NX9DH3WCALrSMuRNS52403ebTd/uBrnlhhZyPSwrQk4Ezp oeB+qQxXo6JPqggWAfNhQNHZpYVy9lKVtr76o6N3/f8S8iIzGyaPHtqQpN/EY22+zfHI E9rP+rwuLElo/QxsblYGHIgEIP/hjzu3eUcZywGXsqczVLa6wLASIdQH8AzMRq1UgrKx zrUkk1w+ME/vPoHRvwVfU1mO64zvqm0InEWsz0jpcyr0CwGZyWksGL2hsvFnvmS0ORST I8Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dhPiWYqx; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb36-20020a1709076da400b0078dd22dd569si18834243ejc.121.2022.10.20.10.23.48; Thu, 20 Oct 2022 10:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dhPiWYqx; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbiJTRTI (ORCPT + 99 others); Thu, 20 Oct 2022 13:19:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbiJTRTH (ORCPT ); Thu, 20 Oct 2022 13:19:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F26E71D79BA for ; Thu, 20 Oct 2022 10:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666286345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R+1VJKvQ64gmQLT5pRI8etc5uGtTLhS05M3Tp9kQtVQ=; b=dhPiWYqxG8w/9laF7PJ7ahaUBzcJ2kQkWf0JFhzpMYCGLKw6e3DDDdiYy30skUW/woBaHD cXBARRhPD7rv/k83Tq+6psWDk9PpZk2ooWULlVsiU7YD2ZSDRL3hQMHvYvg7YxpFOAdZmg osIHU3CcAPPmQFd0Rl/R9ZLRLwwOROA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-86-Qp3MpcWqNBqGwEF9Be9dbQ-1; Thu, 20 Oct 2022 13:19:03 -0400 X-MC-Unique: Qp3MpcWqNBqGwEF9Be9dbQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 610F3857AB7; Thu, 20 Oct 2022 17:19:03 +0000 (UTC) Received: from [172.16.176.1] (unknown [10.22.50.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C760E1401CC0; Thu, 20 Oct 2022 17:19:02 +0000 (UTC) From: Benjamin Coddington To: Andreas Hasenack , Steve Dickson Cc: linux-nfs@vger.kernel.org Subject: Re: Invalid free() in blkmapd, core dump Date: Thu, 20 Oct 2022 13:19:00 -0400 Message-ID: <12B9F373-E858-4415-B71D-227FD6D7E4D6@redhat.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Adding Steve D directly to see if he can pick up the original fix. Steve, what happened to https://lore.kernel.org/linux-nfs/77a09978-a5aa-e= a7f-04b8-a8d398ee325f@huawei.com/ ? Ben On 20 Oct 2022, at 10:33, Andreas Hasenack wrote: > Hi, > > this was brought up before in > https://www.spinics.net/lists/linux-nfs/msg87598.html > > We recently got bug reports about the same issue, and it was only > yesterday that I finally managed to reproduce it in a VM. > > My reproduction steps are: > - add a scsi device to a vm (not virtio). Maybe works with sata too, > but scsi reproduced it > - add it to an LVM VG, and create an LV > - run blkmapd -f: > # blkmapd -f > blkmapd: open pipe file /run/rpc_pipefs/nfs/blocklayout failed: No > such file or directory > double free or corruption (out) > Aborted (core dumped) > > The "No such file or directory" has nothing to do with it. You can > "modprobe blocklayoutdriver" to get rid of it, but the invalid free() > still happens. > > in 2.6.1, gdb shows: > #9 0x00005555555571e5 in bl_add_disk (filepath=3D0x7fffffffd480 > "/dev/dm-2") at device-discovery.c:232 > 232 free(serial->data); > (gdb) l > 227 disk->dev =3D dev; > 228 disk->size =3D size; > 229 disk->valid_path =3D path; > 230 } > 231 if (serial) { > 232 free(serial->data); > 233 free(serial); > 234 } > 235 } > 236 return; > > As lixiaokeng said in that first post, this should be just > free(serial). Or use bl_free_scsi_string(), like his suggested patch > does.