Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp654056imm; Wed, 6 Jun 2018 04:00:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIyxjSawpJXsO4i7j5l9Q2wX4ZvSU/LAbaR4i0Yru8WYYqwjUctIc5aiAIvuDeytxktsGNl X-Received: by 2002:a63:755d:: with SMTP id f29-v6mr2170651pgn.278.1528282817966; Wed, 06 Jun 2018 04:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528282817; cv=none; d=google.com; s=arc-20160816; b=OuOVMVFmnDZS5MP7tQcUz5tHT+/4WTnYSb/oOClvOiuCuM2j/FpInsqSCY5PSYD1io iH4fP8Pqw+pSJnzXPTyfgQoKoQIwiLJ+HOyhdr0b1ENmF/rQDJY4bE/8ad80Jc03Qq7h cI58wtnVNPfSAudN1wDf+CsJCmgsKY6pXcUnWAXqU+KCHlmP69OakX2Pv2uGr/A8F9+Z 6ILQ4JM9ECjfQMOZQaxWM9oMYb6VxvJe2nhu4DsjLz09d9DkQi7c5e5BSZ7WwbCnJ4Mj 1hqtqQaTxUsNDkkv5KfuWTz28KBhPPU//iP/mSh+X022iS+rkvKTcojnnktizMFQeJAW gM/g== 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:arc-authentication-results; bh=octIBqLREiSal6lMSl6gR/Ts+9pjYSXyOfNGD6HuyFI=; b=hMnXwBT0MOYwilORle3x1O0wvky6ksd00ZrfVtnFauo7PAftA1GDj3Nz1MvF0ugVgG IOWMCnab8wczRolze7vqpH564oqsy2vmnv9mcwS647YOHivjV/yXSNxDq0TRSEwxT7N9 rLI/OP9pkp2ZWqvcZnQiuoL3dKHV2jps7uZ8n/9iGf8W8XZ6Bw6Iy1V8/9hagCvOD4mU 7uaY6yPbunVflFXfZ77/4WQxlsjVYLWxvTUEu9zzf7CcCVt0aOx04Fa/2iOinDTFoM/X d6M2nUNjD/NZi2TzD87E6BnAxZ/UT86lfZVm+g0ZYOaOxFjZYkZNBr0n5IlR4xeq3Lco NIyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Yml0n9zR; 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 l17-v6si7610825pfi.179.2018.06.06.04.00.00; Wed, 06 Jun 2018 04:00:17 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Yml0n9zR; 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 S1752349AbeFFK6X (ORCPT + 99 others); Wed, 6 Jun 2018 06:58:23 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45718 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751516AbeFFK6V (ORCPT ); Wed, 6 Jun 2018 06:58:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=octIBqLREiSal6lMSl6gR/Ts+9pjYSXyOfNGD6HuyFI=; b=Yml0n9zRGQsKplT4j7q3Ky5uT xmg+n1eH5qCgs+7kDLVapxE1XSBrTcS1Zv/UfAjJGda+EccydNY7S5VRhn3GEUK6Zyj/JsbEEpa1j xPVJvdy23cOBnyGe7JAJ1jvg7h4wvGyDhytrcf82hu231FFj4Z1Myvd6TWa8Ust7kJlbDvJBW7aFH 4R/j4ew9Htq54pfF/zv1HJanSfZFszcmF3I/nsWQhYKHXd0T2TlQ0Mffwb5hOmKim1OChv/P3FIXx z6JXeSuT+Kyhqy87RXuAJaGx7rBCWnaJHTF74qOV7Q4v3YK7B2+faUBBXercXU/MQ3Vpf/a/u/1L2 XlCCI1Kog==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQW8v-0003c3-R7; Wed, 06 Jun 2018 10:58:17 +0000 Date: Wed, 6 Jun 2018 03:58:17 -0700 From: Christoph Hellwig To: Eric Sandeen Cc: Arnd Bergmann , "Darrick J. Wong" , linux-xfs@vger.kernel.org, Eric Sandeen , Martin Sebor , Brian Foster , Dave Chinner , Dan Williams , Ross Zwisler , linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] xfs: fix string handling in get/set functions Message-ID: <20180606105817.GA6575@infradead.org> References: <20180525151421.2317292-1-arnd@arndb.de> <7aad9fc3-ed65-a016-d477-5d830e31cb43@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7aad9fc3-ed65-a016-d477-5d830e31cb43@sandeen.net> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c > index 82f7c83c1dad..596e176c19a6 100644 > --- a/fs/xfs/xfs_ioctl.c > +++ b/fs/xfs/xfs_ioctl.c > @@ -1828,13 +1828,13 @@ xfs_ioc_getlabel( > /* Paranoia */ > BUILD_BUG_ON(sizeof(sbp->sb_fname) > FSLABEL_MAX); > > + /* 1 larger than sb_fname, so this ensures a trailing NUL char */ > + memset(label, 0, sizeof(label)); I don't get the comment. In fact I don't even get why we need any comment here. This is a structure that gets copied to userspace, and we zero the whole structure, as we should do by default for anything that goes to userspace. Otherwise this looks fine to me.