Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1133232ybg; Mon, 27 Jul 2020 08:41:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyzhiX9c5BaPqFm5V74csz9npR03oxP1DXWboX8kG+SXGf2DeIL9jtlylkA61RL63BThVx X-Received: by 2002:a17:906:854d:: with SMTP id h13mr9475451ejy.446.1595864497387; Mon, 27 Jul 2020 08:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595864497; cv=none; d=google.com; s=arc-20160816; b=lEUlJxOHr/JQ2zsSx8vY6/3sLMIZRDed54L6zaJRpl8A7UXGn1Tyk5VSVZQZXezMzV B5WSYYqA0RrhfazqoOYwdDpHEjdVG/QXG+0cuyJ5WxlhM0KOW5+4r9lKa4ei/a3LzhuG CNxNP0APf2M5iiAfb/6BOmaHl4vnOIQgd4xJTJX2cT7DWrqMiZcv5o9R4GPHioy++5LW rgF0siENqECczkWLqeszzWxdlpdxb74COXCJQbg1BDrRz1uwYlN+6ArKxFoVQCNkYGjm ZSwfpQSeysDsF+y0OGry7ShdbBvk4FklsvfTH71qb2fT3g7k04LvACCkA/a57Leyr4Iu wMWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=3MHzayRxL6bOiigyiJOXy0PhmCnVIol0KG4wc5+RCf8=; b=RRkeHYUSavsrcvprpqg0cg6iI44VnzPm/JnzkuW8bInQCPN4gZTvf1o0QFUREgE9YQ eXBkzUq+sSa2kJJ6XuLGqYGOIpRnlZk94jUZ6AVMpV5oOpfiSbcKmnFabsi0FWsG1EsR Bcz1ZKTgVSGMxfhn+tIxUbRwVAKk/ZXFh1XirLtNhda3f4s584nu/FX497MrF3qQRHkg DUaFVyxkmfg6bf55KXywzFk++/kBpxwp8ko60Pq9bF5ReVBcg6ebrx8MW2Qwrgu5tJcy ez6aY8nlPUd40/xH3AEKgo/dTAwvRj2j4W6YS2Iv1cg94ATyVUHwLR/t3sopVlxl1mZf 3P7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VV0QxcDh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id jr22si1250238ejb.739.2020.07.27.08.41.14; Mon, 27 Jul 2020 08:41:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VV0QxcDh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730103AbgG0Pkh (ORCPT + 99 others); Mon, 27 Jul 2020 11:40:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729049AbgG0Pkh (ORCPT ); Mon, 27 Jul 2020 11:40:37 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1731CC061794 for ; Mon, 27 Jul 2020 08:40:37 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id u64so15593860qka.12 for ; Mon, 27 Jul 2020 08:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3MHzayRxL6bOiigyiJOXy0PhmCnVIol0KG4wc5+RCf8=; b=VV0QxcDhBbkfas2oiGVS1tvt5ESJqhpl67y4uGCMb2n8mBj4P/nU8cHUjPv/l76bU4 gjETm59e+fdYBwoodcOoh5UBxu7PGmou3asy7AL7Er8fbs2atIxO53YJaHKqiHTjuDds uaaNWCmDvrjyoUO8wlSmU05OiMrdHR9gTE1KZHICoXD4hWPwF9ZOf0SEFlP8KbD3vDAO Kwvs3ocpCiWZTfN0OihoxC4jjfSlefzs0ztS9PBUMkSl/xIR2wpSHO70miNuSAGrRdPo J0lI1V2F7Z3w0wUZ+go35o8LtiBgZRBNNuTmpDojB8TO83eJEFKBkk7Xdc0hm62xdgoz /CVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3MHzayRxL6bOiigyiJOXy0PhmCnVIol0KG4wc5+RCf8=; b=gFAccrvMktWmIUiRkRDJERKDzl48hfz8JkssRh2P47orDcF7lV1FKiVgkFWpycYMRm 6DHfA82Li7KnJCXWobrJrRp/sRmfXZgIP9tqKuPaIalMtQxAvLaByVsAnvzi6XQ2Skvt ptpN2p5MH4tD6+/9nzMK9zatmsJ2YDKRm328NRZoD7B824sS3+d1aJxG8wK4VR5imfF/ l7ssf+c9VUUxKMiQlDkV3NPGwpHe1lC0OOPprzF4v8Pl3gzLFnfDXHG2IkpcJ/uoE+R8 iYz+O81vIUdVSitbtS5MT6P6D75K4ehUQ6LPShiggOeI1BsTk5x2NgrfsUNqCG1o4RjJ QQ6g== X-Gm-Message-State: AOAM532RQcQVsBs+BuAN9NMJZ8V51IiX0VZfZBlxKJ4AhVWl78vLnM6b 8Qq2fQLGV9106GDgw92uRw== X-Received: by 2002:a37:a655:: with SMTP id p82mr23048681qke.92.1595864436373; Mon, 27 Jul 2020 08:40:36 -0700 (PDT) Received: from PWN ([209.94.141.207]) by smtp.gmail.com with ESMTPSA id 128sm17457791qkk.101.2020.07.27.08.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 08:40:35 -0700 (PDT) Date: Mon, 27 Jul 2020 11:40:33 -0400 From: Peilin Ye To: Arnd Bergmann Cc: Stefan Richter , Dan Carpenter , Greg Kroah-Hartman , linux-kernel-mentees@lists.linuxfoundation.org, linux1394-devel@lists.sourceforge.net, "linux-kernel@vger.kernel.org" Subject: Re: [Linux-kernel-mentees] [PATCH] firewire: Prevent kernel-infoleak in ioctl_get_info() Message-ID: <20200727154033.GA315469@PWN> References: <20200727151537.315023-1-yepeilin.cs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 27, 2020 at 05:35:12PM +0200, Arnd Bergmann wrote: > On Mon, Jul 27, 2020 at 5:18 PM Peilin Ye wrote: > > > > ioctl_get_info() is copying uninitialized stack memory to userspace due to > > the compiler not initializing holes in statically allocated structures. > > Fix it by initializing `event` using memset() in fill_bus_reset_event(). > > > > Cc: stable@vger.kernel.org > > Suggested-by: Dan Carpenter > > Suggested-by: Arnd Bergmann > > Signed-off-by: Peilin Ye > > Acked-by: Arnd Bergmann > > I would recommend always looking through the git history of the > file to come up with an appropriate 'Fixes' tag. In this case > > $ git log -p --follow drivers/firewire/core-cdev.c > > searching for any mention of fill_bus_reset_event leads you to > commit 344bbc4de14e. > > In my ~/.gitconfig I have this alias: > > [core] > abbrev = 12 > [alias] > fixes = show --format='Fixes: %h (\"%s\")' -s > > With something like that, calling 'git fixes 344bbc4de14e' produces > the line to copy: > > Fixes: 344bbc4de14e ("firewire: Generalize get_config_rom to get_info.") Thank you for the advice! Actually I did all of that (manually...) but wasn't sure whether I should add it on. I will send a v2 soon, and do so for future patches. Thank you, Peilin Ye