Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2526961imu; Thu, 29 Nov 2018 06:25:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/UsmvCVsCtQEyyyBTa58WpAhBkh/jjDb4JHUaE/uwUpYxfNlF8gKYpxC3w6PiHvLREjD9N3 X-Received: by 2002:a63:2c82:: with SMTP id s124mr1388100pgs.73.1543501556072; Thu, 29 Nov 2018 06:25:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501556; cv=none; d=google.com; s=arc-20160816; b=psvIkCgxUSpI48VKg3qWn/7wlCkprK/VbAm5xMPRtv5Y7AOGzGZ4H+yf2pl+3An4jd LwGG73RT4TEleFVlc4ey83ZyMV6qsNafAl0E/T4HOz+w/00UX8+F+BvOQCA0RmN/rtTl z0Du4s8sk0y+27OXgZrOZoVytRxoQfLfzTAKVJqKzudLugswU0DeUNRO5rSPEINxbD/r qrJmWH7F089KDGFOqflcIudb9soYnj7eFhahOi2oyHRK0V+adNVZnKUY/TZ5VHXLChFn R5Y/Ro7p48kFSz3BRVjzf+dm1ckmA8NFvYoF5A0Xn90QE8vhPdm6qLUC0VX12XlD/k98 lH4Q== 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=JveN6Ec4PKyuxsKJCtwrGppfqVOSgwCzzA/CfJpffVw=; b=mTc35a+Ty8olCH4CBpuiNkT1Nas3zMki0f7JwmRDKqEliP23GB/pSY4m69altM/lOG hWIzdPT9wcitt+ckpN4hoc7AHl++nsEnhtaGx3u9IP0lYIVzmivI4eUvfZ/aTW2XdWjJ CI4GkMH6giOgBoZiFJ9miQt9vhdKgyaTWvrOvSewHrlQnhUvXe8+desyZX1p3UWyRxJL JzNSX1DsSA3B3sWN4mb4XhYEDcjCFDDFfK6ZAtyp0jI+28DVKhQpsfCYG6IUw+yTX3fb yxCf3Y9WKTKDlZ0iA7H/98cHIMUv7PQ0Vpv1CCfetkHnIw0wC8LgCDiCid2lR+0cr0Ns IwYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ANkyxc3i; 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 l3si2274233pld.155.2018.11.29.06.25.40; Thu, 29 Nov 2018 06:25:56 -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=ANkyxc3i; 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 S1732809AbeK3Ba3 (ORCPT + 99 others); Thu, 29 Nov 2018 20:30:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:57524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732149AbeK3Ba2 (ORCPT ); Thu, 29 Nov 2018 20:30:28 -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 367E42145D; Thu, 29 Nov 2018 14:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501496; bh=f9Yz0k8FiFQWVIMEatl4pb6toGklidIF/dY9lvcu9qw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ANkyxc3i1tN28TTXZSxWzZG1f7RmlSTYzfEqSBj7lOUYmqy5vGKcvjnoBZCJcryG6 Af9HV9bhZgAyXXwNYYoGkaTEz/6LsVSsnzFtn+qb8AT/bp37K0xvknQclkPqrj4sCo 1JUx5yqNxQPU/6Iy4kPpo4wk1aA7N9msDLyhxzeY= 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.14 022/100] selinux: Add __GFP_NOWARN to allocation at str_read() Date: Thu, 29 Nov 2018 15:11:52 +0100 Message-Id: <20181129140100.661463680@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@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.14-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 @@ -1099,7 +1099,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;