Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp836031ybl; Fri, 30 Aug 2019 07:54:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHvj9ALJct/QhJpgSCxvz49EdbQLKfBXUprewavhVRTyg5aSr4NiV7Ikf0MLoNpU+l4G9p X-Received: by 2002:aa7:8757:: with SMTP id g23mr19083994pfo.63.1567176871625; Fri, 30 Aug 2019 07:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567176871; cv=none; d=google.com; s=arc-20160816; b=loQz+lADyR4+8Fd3eGlENIQ05WWmNXjKBPUztyk2u1GwJOzjJaGChUFMBodyspALw4 HxuiVOVPAEugexa7dpbm83E34ozJOslY86aB9/56EAaKocBMbbQHsYTrnXfhCctR9Dhh oZA6I0SSjh9tHMvbOYB+G9UWsKUYFi/inS57KEVXvKkjDndV2elM5qu7mbFxFZthuRF+ n0ajfXHz+KsmW46WceNTry8lVtBth7GYmR8joHCdc40kyIFr8keiR0/HGzTOVdVeT0w5 k/Hl1bgCRf9eVKYrMhwyOYrCphtAItSeJ0gtrpoe0vFucEVkIPPOgLVZTHU6ZpS+ETOp W0YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=elBMA7XStNQqn0xnx17M5IleJjwTUUXWgaglfXsybBk=; b=ime6QrSryBBGZisGIjGT2JJ8J05OuS0QYoqFVfZNeXcOORPQQrdCElXQXUrrxWBToA o1TIbysdSPgXTIjidwrc6Ivp0dKMNxbO7tVPc3nF3rPrJoywK8JzDd6SJ8003HDUsTCe ul4Fhw+69kuju3u5E7rC5AdGcyYBfqnlwDLctS2hnErVXL3PC3QsSVSBx0ezQieRjqve 2ctsbSMjUp3inC9bjp7r2cDbsYBmOdWmPpJCI3tmBU/1NZIXVYcig/SGNY5DAqqgwq0m BB4FPmCIy2ulHZN7viHrnsrXt++R7JeTmVuKb3Qef53YjeRXgfoRWS0o3xspdOSVZgju ck9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FLzNB5xX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si5060818pjp.1.2019.08.30.07.54.16; Fri, 30 Aug 2019 07:54:31 -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=pass header.i=@gmail.com header.s=20161025 header.b=FLzNB5xX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727940AbfH3OxR (ORCPT + 99 others); Fri, 30 Aug 2019 10:53:17 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:40725 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727135AbfH3OxR (ORCPT ); Fri, 30 Aug 2019 10:53:17 -0400 Received: by mail-qk1-f193.google.com with SMTP id f10so6367614qkg.7; Fri, 30 Aug 2019 07:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=elBMA7XStNQqn0xnx17M5IleJjwTUUXWgaglfXsybBk=; b=FLzNB5xXAXrVENogWaDCuVt1rfRYsBVVUMJdaR/Da4BqDSG84guWmY7CTISXgHkCLd 3SL8vvScXbqB4Nu/2H/g0F3j8MjXsIuBOSIjXG2XT8Ua9Pmwkc9PQS3Z/iDoR42G+IFJ IdhkSyj0AhT6d0EBttvT/qC5+qFIUbI6/YGdI1nvxsUFQWe1kaZJaOFu0lZL5L93zNL8 T/A71rhoyNavJU8Fm3cX5q4/Wii+GNqb9bD890/eFR8sXSJBE4HDmF7b00cpsI/G2qQi Bi+r/nvwJa5fpwG/czdxl8zXo2msjgCGNQjY19iSVHug+FDC/3xrg/h0/D3//5CuQBV2 6hxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=elBMA7XStNQqn0xnx17M5IleJjwTUUXWgaglfXsybBk=; b=S9l2L0pneDyDbxDBRSOso7h/OCs3//Xcb+adBgqi9heb4KLZjY0ef2g9ciMRW3BiT5 NEl93iyrPejeTZHWIEFNN0AbbAXCuAiNUwPfs5MNbEmaD3zZ5767EFKZ+eBFqkWdQmtY QDEDzrVGGWtH2cbgqC1hkYM13G363/AdfT33pp8c/tduyoxPXqOTNy8aQNCPdIQ8ntTC seYv205vlhOfJiBOQUVcsBI3jaSJD1rbPD2DgAHG0FVCZaRroz3TDFnetBigScZgCd/G 9iKpcCgeSNzfiPso9dpI+C2LMrBv1WmPxoxIiS6aj0zW4GRDoCyRt4AYNtfG0PD/eLIy KTlA== X-Gm-Message-State: APjAAAWJ9os19JBQ6Q83rzr9cJfZgeCtDBfXL/ejCoSKFSDJERtxMOQB Nn9HKRqQk3nWwLuxzZhXx0qmtDU4cBP+ZyG4J0s= X-Received: by 2002:a37:b07:: with SMTP id 7mr14362304qkl.386.1567176796337; Fri, 30 Aug 2019 07:53:16 -0700 (PDT) MIME-Version: 1.0 References: <20190830053707.GA69101@LGEARND20B15> <20190830053945.GX5354@magnolia> In-Reply-To: <20190830053945.GX5354@magnolia> From: Austin Kim Date: Fri, 30 Aug 2019 23:53:06 +0900 Message-ID: Subject: Re: [PATCH] xfs: Initialize label array properly To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2019=EB=85=84 8=EC=9B=94 30=EC=9D=BC (=EA=B8=88) =EC=98=A4=ED=9B=84 2:39, D= arrick J. Wong =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84= =B1: > > On Fri, Aug 30, 2019 at 02:37:07PM +0900, Austin Kim wrote: > > In case kernel stack variable is not initialized properly, > > there is a risk of kernel information disclosure. > > > > So, initialize 'char label[]' array with null characters. > > Got a testcase for this? At least a couple other filesystems implement > this ioctl too, which means they all should be checked/tested on a > regular basis. Thanks for feedback. As you pointed out, I figured out ioctl(e.g: ext4_ioctl, f2fs_ioctl) of other file system is implemented with the same ways. Please ignore the patch in this mail thread. BR, Austin Kim > > --D > > > Signed-off-by: Austin Kim > > --- > > fs/xfs/xfs_ioctl.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c > > index 9ea5166..09b3bee 100644 > > --- a/fs/xfs/xfs_ioctl.c > > +++ b/fs/xfs/xfs_ioctl.c > > @@ -2037,7 +2037,7 @@ xfs_ioc_setlabel( > > char __user *newlabel) > > { > > struct xfs_sb *sbp =3D &mp->m_sb; > > - char label[XFSLABEL_MAX + 1]; > > + char label[XFSLABEL_MAX + 1] =3D {0}; > > size_t len; > > int error; > > > > -- > > 2.6.2 > >