Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp513041ybi; Thu, 30 May 2019 02:13:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/9sjTuRpdubDvIgo4BVmFCtXdlbsrcKY6EkjLuynLw30F9+HIVHN40FH2b8EBknrPbJaf X-Received: by 2002:a65:56cb:: with SMTP id w11mr2814186pgs.236.1559207618059; Thu, 30 May 2019 02:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559207618; cv=none; d=google.com; s=arc-20160816; b=vwZO6QImHbrIEgY8YWOBBjGM30GVau5fv0PLroVXcooEvNF15hT4DDunz0ihBMzIf0 YUHWPIfpFXxoIBus/FuXRPeeJFclvgG2maybmq0tLRaOM53lIFtAn/K7NHqRDPNoIEqo cPenYt82cc+/07yJySn8vurwiBgQUDdOJ7+afgHPls7JRc4+o8+4GZGnGUmMrDLxFmEc InuDhWnzy7ae1RxAewRduemLKhX8nzmRRqN8xWGo/r0dxvE7+6YSfeX6xYMzDUck1meu 6PIKOp0VV92GePAnlQuuULgLUspU+sdkZSPc1n8GRKDKKUQFyv/TRpywwq+/IHtC/e8b HTeA== 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=voAp2WtjCrorqQ5ljFVovFNN+W4jtil5Y8wsKYlsKkY=; b=FOgOyId+FxKhaRF1hX59dWs+GrX8HksE8FFuVCZt5bbWx4f6aJBIrkbjtCc6ZxroWf XyT5nQJxjfIeZNKRuNVRJZxnGKxIOmLdsItanTcY3z/pF8J/2aUa5LQ7VTPEgNyXS8Nq nl7JIB3GLQ1qyKQo7N+9LQBbbagSK3Q0Xcy+Z3LAqtsrHYGe+ufFD6B3S8MkAc2W5cY0 /Hegn7s7UKuWrIeaqaRZnMen9PqD0Ox0i11wUZ1K9KyJ+xXvOPAHF1ZMxNTZYlEu2msR vYnt4pp0jPPMUAJW6QanACmaks4ZqYEIg2bJMhhO2GHLpXJjwxwOHImNLbZ1kbJQm137 o0Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=Aljnxgrc; 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 j66si2634044pgc.224.2019.05.30.02.13.20; Thu, 30 May 2019 02:13:38 -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=Aljnxgrc; 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 S1727196AbfE3JMA (ORCPT + 99 others); Thu, 30 May 2019 05:12:00 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:34503 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfE3JMA (ORCPT ); Thu, 30 May 2019 05:12:00 -0400 Received: by mail-lf1-f66.google.com with SMTP id v18so4439985lfi.1 for ; Thu, 30 May 2019 02:11:59 -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=voAp2WtjCrorqQ5ljFVovFNN+W4jtil5Y8wsKYlsKkY=; b=AljnxgrcoViOjePLPkPD/RTOG6RAXos1o39z1MBQxUJXhCIvWU2t+ZVa8IUEWmSojD J7PdDiDHIaJT0U5E9J6N1bWJPMWoBHMHvxTGmK/s/+/qTiGjAMiVg7HgX6YdtenYpSeT TqfBLc2tsAHrhgq5uZHORqxAB4XQPHVUD+9j556B6kymMdNLVUqe9B76zgGqMqN/bCLv T27ZgOA5hKVXKudSC1VVCtYLuf5W5U1zD20ts5kTaAmZRFqubrCyf4JQqHaNcma+TETC v4dIfV3XTVN3pnw1IlDpaZduN+QmY1RzkCRPSbKBtAqFRQEOv6wOtwO4OMAEKokE8tzJ jK9A== 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=voAp2WtjCrorqQ5ljFVovFNN+W4jtil5Y8wsKYlsKkY=; b=rXzLm4iydXILbwhLFH7VFO0tKliSpvpi0+Ndx1h8I1SSZp0+C2MW/ApvxBrUbedxhY YT/heuE7p0tIyz7UueFW5kn8Abrjxrzz2X5sHaw3dUMFKblG/7x1ykbHtZ2kgAzGGhk0 fTWJcBwV6TZ1Kb7T8zyoCUtDijtBy74lR53BGIANAj2E+Uo4cO/BJcs4kf+APoXuWtO/ 8e5gxOwMcLF6GhW6BzBD7+NFpws6XclV2vZvZ69K9NkwTrnoKq7P+34nQIcWCJkFRuVG pTR0y9wGqwUwyLOlFSBvrTDFuJmW52TN10B7IxwfwFi7cRfZ35/rBQKyPLFpJ27NXakd IseQ== X-Gm-Message-State: APjAAAXA0/ykGld7km4+Hd0X6M6EmcZdgqyWf29AlroBlQNRXBEJDIAU wbP8yPae4Riztx4OnrFzxjWYBw== X-Received: by 2002:ac2:514b:: with SMTP id q11mr1533656lfd.33.1559207518496; Thu, 30 May 2019 02:11:58 -0700 (PDT) Received: from [192.168.0.199] ([31.173.85.229]) by smtp.gmail.com with ESMTPSA id t13sm352381lji.47.2019.05.30.02.11.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 May 2019 02:11:57 -0700 (PDT) Subject: Re: [PATCH] hooks: fix a missing-check bug in selinux_add_mnt_opt() To: Gen Zhang , paul@paul-moore.com, sds@tycho.nsa.gov, eparis@parisplace.org, ccross@android.com Cc: selinux@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20190530080602.GA3600@zhanggen-UX430UQ> From: Sergei Shtylyov Message-ID: Date: Thu, 30 May 2019 12:11:33 +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: <20190530080602.GA3600@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 Hello! On 30.05.2019 11:06, Gen Zhang wrote: > In selinux_add_mnt_opt(), 'val' is allcoted by kmemdup_nul(). It returns Allocated? > NULL when fails. So 'val' should be checked. > > Signed-off-by: Gen Zhang [...] MBR, Sergei