Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3644120pxt; Tue, 10 Aug 2021 08:10:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN8906YGBobGdmrkXW4GKe4Pb0gmKL33XVtLJQdxGOlhNX9rBZur9s8w3n8lz9RIGBbDP0 X-Received: by 2002:a05:6402:b99:: with SMTP id cf25mr5513929edb.130.1628608241565; Tue, 10 Aug 2021 08:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628608241; cv=none; d=google.com; s=arc-20160816; b=DZV+uP3gwPzLU8U/MLs5zw9UPGxfjKX22+/Whw07gCLkt7S2dFS9u0oO81IXXF8qOo SrBkIJdpaZAibiiTqxnnvWS9G5dX0ITf1iaidbo12nZw7ELKoHm182O6xjfoPJomPUEY X56bB8xNSyNBfLkLQSd94kUmtEagSTwbiWNDdJgqO2/RqVIeZEkyeKm2kJSlaTBE9FQl dO/9sd7nXQcHPiTbCBLe0EKzzKK2q5mN6JbxdO38Ui4XE6LqjcEkBg9h6UwMFxGU+ZSs MoeL3Eu9pVRH9fH4eiaCWLSuJg1xW9BM5IEyfSPemSJWC9gc0VSumWlNyECTagwXrQk9 +XNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=L9KacOSerY3wbRZf63rzSZpQ4l5xGDv18/rQP5a0pPE=; b=LzYfXIep1R/cdbHW/m2keGQHUAEhtysO6ikGuSERZCN6EKc9jpX0NvX1j1opdcTBLf OEKs1LD5BNrvBAzxFRblM60hOCvs8q+V5CTF+6gQ7GjEhbM03I6o6Urg8OHFhDgca3mn nIFxPf5ATY+9mcCoHyLOluS2Y9ZSoGonQsXG4oE9KlyoZfnaYTsNlaOVFlFCpUAaRVT3 nrrRfXCZEAPQJIx4zgyRqPCHJK1g9BSdw60AywtRRd8y25VR+4dHTKS4xkGbF9GvF4Sq hIA7EKaGHUB9N6xKgkxH2UK/KgEVndk4px6HPlGlhfgrVLzx9sKGrmOPul0t1WT97pvx DBgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si20221192edw.18.2021.08.10.08.10.15; Tue, 10 Aug 2021 08:10:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240897AbhHJPB6 (ORCPT + 99 others); Tue, 10 Aug 2021 11:01:58 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:57255 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240809AbhHJPB4 (ORCPT ); Tue, 10 Aug 2021 11:01:56 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 17AF1UAK016806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Aug 2021 11:01:31 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 72B3A15C3DD0; Tue, 10 Aug 2021 11:01:30 -0400 (EDT) Date: Tue, 10 Aug 2021 11:01:30 -0400 From: "Theodore Ts'o" To: Lukas Czerner Cc: linux-ext4@vger.kernel.org Subject: Re: [PATCH 3/7] e2fsprogs: fix unexpected NULL variable Message-ID: References: <20210806095820.83731-1-lczerner@redhat.com> <20210806095820.83731-3-lczerner@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210806095820.83731-3-lczerner@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Aug 06, 2021 at 11:58:16AM +0200, Lukas Czerner wrote: > The ext2fs_check_mount_point() function can be called with mtpt being > NULL as for example from ext2fs_check_if_mounted(). However in the > is_swap_device condition we use the mtpt in strncpy without checking > whether it is non-null first. > > This should not be a problem on linux since the previous attempt to open > the device exclusively would have prevented us from ever reaching the > problematic strncpy. However it's still a bug and can cause problems on > other systems, fix it by conditioning strncpy on mtpt not being null. > > Signed-off-by: Lukas Czerner Applied, thanks. - Ted