Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp522225ybi; Thu, 30 May 2019 02:24:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/ILZHGiNqLo8EWYpLTlYj3TPoljk30vDdFPPE6BUJyoDTM/XUrRIj/c9pS9eDdI0ctcLC X-Received: by 2002:a17:902:f81:: with SMTP id 1mr2877435plz.242.1559208241457; Thu, 30 May 2019 02:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559208241; cv=none; d=google.com; s=arc-20160816; b=u8JEm3ZSuaiLhzjRyq5VUSD3nF5f9+SgqE8iRQXg7eJrQh1emfMozTCxzqAK4SF8/H tk84CfjW2N3eScL4HuWiJ7V/yh+IHc9tEvOxsY6enNAoApz/UdpgQlcoRLv4Spx9AX6P OOIsPDgyoVuhPmeR+zv9dsvDtZX0kXV9pjlVjQAYkw69CYuBW6FeyEc0EbYLTb/OxDh6 3+o6wrArvQCNtzcRAiZghKoOMiFD/NH9oucEaKjSWHSklK98NayaskIZED/UnDa8w3Wk bLqikHZn3+ueBt0iUYDWa6Vg3ttYczPwxjNY4EdDMDwrLi/lp/Wt0/aksDukFs8UMAtR KpHA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=MZLYGTyIcU65t5L2uyp6Otqtskjo+juH9YbDeDOrWoQ=; b=P7CAT5+6FmBxwRpyx6mJH0Q+EE0wE6GcrFow3Zck6PR1MD0hHsniHJZ0n4bFW2dMat GFTp8sZwxJ/nNh/nhOfiSHjx0OBtlPNWpPQQY90rQw2q6ns2rJUN2qrsJzcRfK950zIR 430ebghn78NvpKCDDbZ3Xg/rckBvHUG5k4xc7M8MLTsqCGoABrXwW0jMDR7LIxKh6IWK Gk5o+IheZIQAa9qyxwqIXj141+gu/U3jv0l/Hod225aQpqtrMWQSxhijXOLwV3WmSvwF 9b5Vv80d7bjbJk14Yi8ZWHL5AUJj5xgjkLmcROv55VNc6zfRFlQBI+qaILoS1t+9DkVz 6MgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=z9gMudh7; 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 c134si2614701pga.268.2019.05.30.02.23.46; Thu, 30 May 2019 02:24:01 -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=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=z9gMudh7; 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 S1727367AbfE3JWo (ORCPT + 99 others); Thu, 30 May 2019 05:22:44 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:34702 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727068AbfE3JWn (ORCPT ); Thu, 30 May 2019 05:22:43 -0400 Received: by mail-lj1-f195.google.com with SMTP id j24so5391349ljg.1 for ; Thu, 30 May 2019 02:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MZLYGTyIcU65t5L2uyp6Otqtskjo+juH9YbDeDOrWoQ=; b=z9gMudh7d9JcCGlrp8eWDNV2yJxcWLzjkU8oQz0Dg0eByjAW1m0O38+oMguoLKRC/T s9zVhaIawSMhlsxObZ/J08tyjEfJWbD+Hmj9VWnbCGr7t23kteJSTuqJZNSFeG1DRkQ+ c5wM4s2VYLG7vMSnohAP/Bqy6NkCGL3cbrNe+ggkBCOUxa7zIHpELT96fmR3MZP9wDLJ r3QkGtnNIgZFOjgqWVTVaG8fJUXQ/HIeqbXgyY4ZiimZZ+4CkuWcQ14Xj7JBTcEoneOd SwGXPfjZuCeec5/tQYe9wj2ccqIB1uAmG9eTS7SgVmrBGF8p6nNh2LOYTZiKFwmSRU/k 30lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MZLYGTyIcU65t5L2uyp6Otqtskjo+juH9YbDeDOrWoQ=; b=MbBGSbuo3TTn2lWM7DNOVDdGfIUQDDU7zxHNMOxEi9Q7CwN0b4OlYQIzpLBCPHWG9w Ohp2/MvbyatcEhex15xUl8W45EpMWm+Hf9vcjRYDsiFf+YuvYiuutKn4nro3FiVlGpxT bPtXtczGtE4hCbMdnVHgITI+f1Et+eWXSbSRncbloTURUPLMGloQVfvKaWHcxvqoU6ey pirkeRTjNxq3gLl+s7sRAxVazbnVzsFw48KvtKXYUHWEKRgMicCw0DaNc/dxvYu3dYKh W9MqHcUDPPlglQnjlN3BiucnoeVaPSYi/nk8r17WnZPI45GKEFYdyl05WVcNec2sjbTp G+OA== X-Gm-Message-State: APjAAAXCWmu2ZEvEoYVVIqk8sCOSwZUT2PpFYbedT5cxE90JUKo5UOi5 yksV1SnpBNPA5VSgJpF8r2a6zQ== X-Received: by 2002:a2e:b0d0:: with SMTP id g16mr1460905ljl.132.1559208161804; Thu, 30 May 2019 02:22:41 -0700 (PDT) Received: from [192.168.0.199] ([31.173.85.229]) by smtp.gmail.com with ESMTPSA id j5sm367557ljc.67.2019.05.30.02.22.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 May 2019 02:22:41 -0700 (PDT) Subject: Re: [PATCH] hooks: fix a missing-check bug in selinux_add_mnt_opt() To: Gen Zhang Cc: paul@paul-moore.com, sds@tycho.nsa.gov, eparis@parisplace.org, ccross@android.com, selinux@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20190530080602.GA3600@zhanggen-UX430UQ> <20190530091848.GA3499@zhanggen-UX430UQ> From: Sergei Shtylyov Message-ID: <236195a3-b607-5cf6-ac60-8c5ea2e95b41@cogentembedded.com> Date: Thu, 30 May 2019 12:22:15 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190530091848.GA3499@zhanggen-UX430UQ> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30.05.2019 12:18, Gen Zhang wrote: >> On 30.05.2019 11:06, Gen Zhang wrote: >> >>> In selinux_add_mnt_opt(), 'val' is allcoted by kmemdup_nul(). It returns >> >> Allocated? > Thanks for your reply, Sergei. I used 'allocated' because kmemdup_nul() > does some allocation in its implementation. And its docs descrips: Describes? > "Return: newly allocated copy of @s with NUL-termination or %NULL in > case of error". I think it is proper to use 'allocated' here. But it > could be 'assigned', which is better, right? I was only trying to point out the typos in this word. :-) > Thanks > Gen >> >>> NULL when fails. So 'val' should be checked. >>> >>> Signed-off-by: Gen Zhang >> [...] MBR, Sergei