Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3691825imm; Fri, 25 May 2018 09:53:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrKthbVZ5BZR0gBap6xuP6nHlFBQ/Z5ZZWq7E8mVblZSDdkMy9+ZNucqH/iQzDo4kg02qRm X-Received: by 2002:a63:4c8:: with SMTP id 191-v6mr2624866pge.129.1527267236324; Fri, 25 May 2018 09:53:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527267236; cv=none; d=google.com; s=arc-20160816; b=qCTJ5PopfT5eUFU9NpYnnsxynLOQAdPQr4RO6R733gRN36u5iOmAvw9itrrQ3KIijz YxO6YRxokzSfhPdJhXn6n/AtHTVWrOFNd6M+QQriQlCx2VGHdc16AiXhkexFID2BE1y9 Xz+6PYLXTXDnpFxFZqRbwAPxy9mSoZzvPiyiO7GBtQki/Ezsor+c7hCX0W1V359rEEXp bXek0dBr1ode9fMGro85Cd4OnHa28AbPUJf/3PL9ygbAFqq6qzYdeYQKL+k7kM32REvq CgmSYPuy+feGgE0ag1BtCUfjturArEPXrRVa+4540BviwM7LFDxv4GHtmGPK5cjXCZEc 7zYA== 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=O3mIudw+fcvB6tmv1EUEGrqgNnL32Ir3WwWMWmtAPf4=; b=yiauAWhG/5VnQ6+LLvOM0jvKkK5TsqWkHXPGJsjiCqrYbnKwq/uT+IVtZB6/Q/21S9 8U9uUFbE6Jrw41PPI0RGI7md9qWYMclb3jA8AhNL0N/oo6RrYOEagbYvQQTDt5MyTKrO uC5FRNBzcpUrvvJeajaLX3qQbS80QOwW+07LkGOsE7yXxJ+0ZYzZDJaP10tZVntyaove ObEz4DnDCpsZKChhPrK62+jx/fMgwGKygQ3PqpWHFP5qQ9sZXbufjf+3Ed8O3KMlKGWh 4Nj8e4KYwmYo356Tj/6aaaiPWnlpOkCZn8g+ehlgq0kG/r3wT8ZhxQiPJaKxLjaJyKAY lfSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ewFxMMme; 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 f39-v6si23820927plb.572.2018.05.25.09.53.41; Fri, 25 May 2018 09:53:56 -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=ewFxMMme; 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 S967335AbeEYQw1 (ORCPT + 99 others); Fri, 25 May 2018 12:52:27 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48640 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967189AbeEYQw0 (ORCPT ); Fri, 25 May 2018 12:52:26 -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=O3mIudw+fcvB6tmv1EUEGrqgNnL32Ir3WwWMWmtAPf4=; b=ewFxMMmeRleKkjGA41Ne0Zps7 rw+jrm2sFhKWcHLuGRMiqi8FebCnos20ZCYZsMQrS8lNIHS3EAqKOS3zdTToGEMeYxgzu65LETfPL IWPgFDagiB2LH5JTxqd15scIs3NTGUxE5jdMOWBTfX+qCygE+OFBfHR4viPQJp+BT8I8PAfwF4FOH JEQFz1wdJTIkN2xoapMqpSh5cqD2whfZc99taNeKxtgHefe0JW/ppZ+LUvsh9W1iYmL2RC8z6v12S 8FgR9EMP8pKjR3DxlNvg62wW7Wj29oB5zTkZSZOc4v0JXu22IAFKrP0W6+UQosDcYgRBdYYgLetJp EbSq5iMnQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fMFx0-0003fo-Kp; Fri, 25 May 2018 16:52:22 +0000 Date: Fri, 25 May 2018 09:52:22 -0700 From: Christoph Hellwig To: Arnd Bergmann Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org, Eric Sandeen , Martin Sebor , Brian Foster , Dave Chinner , Eric Sandeen , Dan Williams , Ross Zwisler , linux-kernel@vger.kernel.org Subject: Re: [PATCH] xfs: mark sb_fname as nonstring Message-ID: <20180525165222.GA7567@infradead.org> References: <20180525151421.2317292-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180525151421.2317292-1-arnd@arndb.de> 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 84fbf164cbc3..eb79f2bc4dcc 100644 > --- a/fs/xfs/xfs_ioctl.c > +++ b/fs/xfs/xfs_ioctl.c > @@ -1819,12 +1819,12 @@ xfs_ioc_getlabel( > BUILD_BUG_ON(sizeof(sbp->sb_fname) > FSLABEL_MAX); > > spin_lock(&mp->m_sb_lock); > - strncpy(label, sbp->sb_fname, sizeof(sbp->sb_fname)); > + strncpy(label, sbp->sb_fname, XFSLABEL_MAX); > spin_unlock(&mp->m_sb_lock); Hmm, shouldn't we just do a memcpy here? Also given that the kernel never even looks at sb_fname maybe we can turn into an array of unsigned chars to escape those string warnings?