Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4670205ybi; Mon, 3 Jun 2019 15:12:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9FUNxdAPCpRskKuKKy3BSdJpjz+GMrKZPtm74oOmUSljSiFXWJJCHCUWMHIKAhf5XcCGo X-Received: by 2002:a63:c30e:: with SMTP id c14mr31730379pgd.41.1559599959131; Mon, 03 Jun 2019 15:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559599959; cv=none; d=google.com; s=arc-20160816; b=Iw8zcJiZFRxzQm3MIMb9/m6OdLApF2/djcUeodVQ5IPX8Nnj6TdGo+EwrIOTe/gdBi DfIMTt2iD7itP/kyhLy9q/H1RpXL8YfPCqy8/nEE5mORG1nSolxLmYp4USbhpy3IbJNb lv9zH4/aoFxnqp1qLa7OjrE6ZJXVrrmXJ82bxG+ezuVz5ePMBqEVCskrtwX4VW9dPfYC D1AMYyhgl0NJu5uu4awtoBpv2ppfceVOZOGtQR7BQELzRdxN1mhVFE0bmgg5PR6wODwt iEjCZeV5fw6bVXX21iF6p9HBPSUYBGl2DwXgiWEYGEIqVkeMKEsmk7QT32YVBlSg4i1o vApg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=KcMRXd21hP8UmZkIG2RNnfnlH3SL7cuLE0q0RRkiu6s=; b=dgJAfhZqUUqTWrXBd3bpLydQ8UE1zOmih594cV00B6Ukr5jYN1Fdxz5Iytx4wkPhgu XppiNePi5x/A0xPTBY9Dk/OL39rxeLODHBwdNseADsRvrdoZTXegaD4z22dLVOpHkDrB wE1+frLa4LsPFZNjxo5srtc6twR03XDxW0CJtd9WavRntObc+ICHuPY1cqpYKkKSkoth pKhVuPDj2xmPOtG4/Ameco1aNndSxY2QvePvF0u5sIqEAHoFfEvGtiZZ8Iw5vqnB2RsA JJ3YYjnp8+j++zTWc1zBpjB9vwoHoEbeKWPNNnvg3pymnlJXHfi2PAwZW+QvtPbv3jox heWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=VKJfnpAi; 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 g4si21031460plb.188.2019.06.03.15.12.23; Mon, 03 Jun 2019 15:12:39 -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=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=VKJfnpAi; 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 S1726832AbfFCWLG (ORCPT + 99 others); Mon, 3 Jun 2019 18:11:06 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:37173 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbfFCWLG (ORCPT ); Mon, 3 Jun 2019 18:11:06 -0400 Received: by mail-lf1-f65.google.com with SMTP id m15so14806542lfh.4 for ; Mon, 03 Jun 2019 15:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KcMRXd21hP8UmZkIG2RNnfnlH3SL7cuLE0q0RRkiu6s=; b=VKJfnpAi1elHGrQJDGOtM/gN/DHi+Ci3IGMyX3NflK3rCh5QLlasviFfYvd5Z1n0Ll sfT8j+rkJXOwV+YDS4o331naQ3mO3WKL+3uzZCCq+E1Ng8/lfuiakuEj6quDz1FceLdp VfWqSDxDiyG7NS9ZHVwM7jMRPxBMvAPlMmUAa+1zKBWuFKfkWh+WvFe7roZu+S9re1MR 3mC8jy0LYvW2rqnw21AMOZdU5BlpaR9WphB1XPicbMYHATdnNswhzKRw/tq3nf2r/7OW 3pfIOyj1vzv7RlvQMgzQll2YOArCb8xfux5xgJZAvw7K6GU8R2M0+JaSP0/ZEshAzMpu KasQ== 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; bh=KcMRXd21hP8UmZkIG2RNnfnlH3SL7cuLE0q0RRkiu6s=; b=LGik2T1TR/ClC+kzcXlzbRhroJf8kGi2PU6dN6Lcvq2ATn5eX6IU+Ub8lLOMhi7qg/ 5M6zt4qOjFSWcbzXE+AybPbyg/T0yRGOBtfEzlAILFxM7X40Wp+rU8cSBNkyskx07k5+ dMgStBe3Dnbtil8+95SIKdJu7JWXG3vaz/9A2KRWS1ze8PtcGAcePfUA30JaFV1oetns eMRt05X+rznKkRE2VTdh3lK2wEVphVHeEqpOzdOI4x0z/oKn7DyMWJWRrCyAaSfMUXtM Tlpn62doeVPQXy2DsH3aDX1jaS1A5CVBo1k8tLjYY6r1N5Kb3I8B5nlRu74bD3ygempw YDQA== X-Gm-Message-State: APjAAAX1PNQP96gvIXxIoJpyFpIF2lMIbqgovrT4VXhWaO3CQClInx4p GYGe/FifhnfJNTJZFNpC+NdHGDL5h5rqUwaUe//p X-Received: by 2002:ac2:4358:: with SMTP id o24mr14377637lfl.13.1559596567285; Mon, 03 Jun 2019 14:16:07 -0700 (PDT) MIME-Version: 1.0 References: <20190601021526.GA8264@zhanggen-UX430UQ> In-Reply-To: From: Paul Moore Date: Mon, 3 Jun 2019 17:15:56 -0400 Message-ID: Subject: Re: [PATCH v3] selinux: lsm: fix a missing-check bug in selinux_sb_eat_lsm_opts() To: Ondrej Mosnacek Cc: Gen Zhang , Stephen Smalley , Eric Paris , selinux@vger.kernel.org, Linux kernel mailing list , netdev@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 3, 2019 at 3:23 AM Ondrej Mosnacek wrote: > On Sat, Jun 1, 2019 at 4:15 AM Gen Zhang wrote: > > In selinux_sb_eat_lsm_opts(), 'arg' is allocated by kmemdup_nul(). It > > returns NULL when fails. So 'arg' should be checked. And 'mnt_opts' > > should be freed when error. > > > > Signed-off-by: Gen Zhang > > Reviewed-by: Ondrej Mosnacek > > It looks like you're new to the kernel development community, so let > me give you a bit of friendly advice for the future :) > > You don't need to repost the patch when people give you > Acked-by/Reviewed-by/Tested-by (unless there is a different reason to > respin/repost the patches). The maintainer goes over the replies when > applying the final patch and adds Acked-by/Reviewed-by/... on his/her > own. > > If you *do* need to respin a path for which you have received A/R/T, > then you need to distinguish between two cases: > 1. Only trivial changes to the patch (only fixed typos, edited commit > message, removed empty line, etc. - for example, v1 -> v2 of this > patch falls into this category) - in this case you can collect the > A/R/T yourself and add them to the new version. This saves the > maintainer and the reviewers from redundant work, since the patch is > still semantically the same and the A/R/T from the last version still > apply. > 2. Non-trivial changes to the patch (as is the case for this patch) - > in this case your patch needs to be reviewed again and you should > disregard all A/R/T from the previous version. You can easily piss > someone off if you add their Reviewed-by to a patch they haven't > actually reviewed, so be careful ;-) I want to stress Ondrej's last point. Carrying over an Acked-by/Reviewed-by/Tested-by tag if you make anything more than the most trivial change in a patch is *very* bad, and will likely result in a loss of trust between you and the maintainer. If you are unsure, drop the A/R/T tag, there is *much* less harm in asking someone to re-review a patch than falsely tagging a patch as reviewed by someone when you have made substantial changes. I suspect you may have already read the Documentation/process/submitting-patches.rst file, but if you haven't it is worth reading. It covers many of the things that are discussed elsewhere. If you aren't already, you should get in the habit of doing the following for each patch you post to the mailing list: 1. Make sure it compiles cleanly, or at least doesn't introduce any new compiler warnings/errors. 2. Run ./scripts/checkpatch.pl and fix as many problems as you can; a patch can still be accepted with checkpatch warnings/errors (and some maintainers might dislike some of checkpatch's decisions), but it helps a lot if you can fix all those. 3. At the very least make sure your kernel changes boot, if you can, run the associated subsystem's test (if they have one) to verify that there are no regressions (the SELinux kernel test suite is here: https://github.com/SELinuxProject/selinux-testsuite) Lastly, when in doubt, you can always ask the mailing list; the SELinux list is a pretty friendly place :) -- paul moore www.paul-moore.com