Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2532867imu; Thu, 29 Nov 2018 06:30:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/UE0qx9gM76k7X3k7c2DfSRuBRrXYUK4fdr1QbusISac8r1J7WX4t2cqOsihaj0dCxA3WoC X-Received: by 2002:a62:399b:: with SMTP id u27mr1641864pfj.181.1543501840631; Thu, 29 Nov 2018 06:30:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501840; cv=none; d=google.com; s=arc-20160816; b=b0rAZzUPJn/d343+VPoRB99gtxyjc+zoiSXRKx/1I+SKfUGM7PriGDRDGHHN1QbxdP icxa/vC+hdYbNcI1IGqAkVTEDf4t8zAbFd6J8QC0ERWN9Yr0YScPPNS8gLqQoR/7wxao qOCbYUAeDKoi4E/j6n48UobkpOZOgbU3POJKFSnAhcUehMa3jvUhtmLF3TWLkED758qT H/QO4PpU85vb6hRP6FfpTALeBEqZXT+QyqNnQHhmUCFyLjLhujD3ZAV7lidfs4xgBzOw EOCoaOgyQB3GWhrsyyNjs928jOSLXTnPa29TPgqQVNOdm7PrF2VBzSCOrWuxCuIGOudi eGpA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QZDgUcuzMdUmfGbqM0gpTE6u//AfVtkAOEufgiMSZok=; b=TTqlriply1vSmJFZiyZ5SDkfMacgjEDQQKEL+kUBC7uz4sMus5fYLygq4rFFO596yR 4uwAHv3OPg1xoI8/g5HdHh3FSiWqFmA6quMuJCvNs8ZkO59npBhzWgnvrJyouSvOC362 EkjC+9M+E3Rr6WBjIFI0/073qKySHW1dQs/P3irXU9Vc90PnKW2QOroeT8Phe9Gt8iFd kUSvWoT8fOHjIHmYwWqvRz2MjQ0m02LaKPapAx4fVHghSI3ArLYtEeAYVENwt88wVYIk gThcPjcT3qtMklLveOyE097+PIsutP59DHaFIdujs0xCpfU9gKHoyD1xnwGcR8ao9sNP eGwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HV874xA3; 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 e35si1852509pgb.548.2018.11.29.06.30.25; Thu, 29 Nov 2018 06:30:40 -0800 (PST) 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=@kernel.org header.s=default header.b=HV874xA3; 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 S2388424AbeK3Be4 (ORCPT + 99 others); Thu, 29 Nov 2018 20:34:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:36432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387401AbeK3Bez (ORCPT ); Thu, 29 Nov 2018 20:34:55 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B0702147D; Thu, 29 Nov 2018 14:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501762; bh=bU6Vy8ucRqXrdSCg84k56V7d9j2G7NihYWmrdUQ0tI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HV874xA3WgDXEO64ObxM6znlnzJXdf9uDmf0KxhEWQm802lfMe5i2WyYBAVduSzgw Ytjz9AemyBE3KBiYIFjEHUFHZQyfwUk6OlkmLZl8Ri5419A6sqrzXHAoGg9I68J8SP 40UAMHr3eeb2FGDTGEuqpbMC6RqiU+2HP2jk7KYQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tetsuo Handa , syzbot , Paul Moore Subject: [PATCH 4.19 031/110] selinux: Add __GFP_NOWARN to allocation at str_read() Date: Thu, 29 Nov 2018 15:12:02 +0100 Message-Id: <20181129135922.528897978@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129135921.231283053@linuxfoundation.org> References: <20181129135921.231283053@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tetsuo Handa commit 4458bba09788e70e8fb39ad003f087cd9dfbd6ac upstream. syzbot is hitting warning at str_read() [1] because len parameter can become larger than KMALLOC_MAX_SIZE. We don't need to emit warning for this case. [1] https://syzkaller.appspot.com/bug?id=7f2f5aad79ea8663c296a2eedb81978401a908f0 Signed-off-by: Tetsuo Handa Reported-by: syzbot Signed-off-by: Paul Moore Signed-off-by: Greg Kroah-Hartman --- security/selinux/ss/policydb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1101,7 +1101,7 @@ static int str_read(char **strp, gfp_t f if ((len == 0) || (len == (u32)-1)) return -EINVAL; - str = kmalloc(len + 1, flags); + str = kmalloc(len + 1, flags | __GFP_NOWARN); if (!str) return -ENOMEM;