From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5112FC4338F for ; Tue, 10 Aug 2021 15:01:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32E9060F02 for ; Tue, 10 Aug 2021 15:01:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242012AbhHJPB6 (ORCPT ); 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