Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2030219imm; Fri, 7 Sep 2018 09:44:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYQZpIetEY17iDA9I7TaQbbIU+mO9Ot87+mGhQ+P+i9EvjDpjfDKRIMcN7NCl1HbBrB+L+g X-Received: by 2002:a62:1815:: with SMTP id 21-v6mr9362162pfy.227.1536338666583; Fri, 07 Sep 2018 09:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536338666; cv=none; d=google.com; s=arc-20160816; b=ILb7Ovb5ZqPg+Tx1lOn6mk3wPTuHwvRGwV+02qtSE22T2OHyDFeaN1Xv/UK93CbbG8 5XekXlWK2TyKwAMxci+stG0r8JUQHQlRiOv1L/2MA85XYulJdQU1KQM4/yX4EmKIlYHB F0i1PXNyJ27+MoPffFncxDHo0MuLcTMg16zvGsim6ddY2VI/KOUlgcfzdW2UirQcAeey Hsoh/WmPIeuZ86YrlIJW3N8Lfl1DOQ7ovQkhkfl99cAiDARcdg8rxSMeHPvEHUnldEGr NJBpQIF/sCslxRN9h3R3hXpy5tFI9fsUdomxaniEH9j94lWjHsUCuv4tssNEcqC+kTcV IY0Q== 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:cc:references:to:subject; bh=cOyrwPV4SzmEPnDwyxXzsQtiOT3m+tZ8Leuw/cHFwiE=; b=i1DSYBdLUJOQQRMQYwSNC/mRTm73Ml94eP1JR32fcubuxOMOiksEpTzpMqdXw3MbcW ryVRK2F9YM03Vg3k3+gC2KBxdUhzmBLyZhAoDneeppscFDnyKG75iQk51Acg6tQs1vB1 VGQu/L3kbXmkPzKpNlHUWe3MZYl0JawmzqJLCPA8/6XZkgPIl51SLKKgYg2mSreTN01e Vl47bsxaEtFBUE0XirCLP6Vd4T8YXBZt/h6KOeMvlB9LOwT1u5UYvf0gpPij4TJbbAj2 Q69QiwLESALe8cANSM4fH3it9WsWEEYE+VpN/b/iiWoUIqBamR33byOCaWU0Q8PeOsME VUfA== ARC-Authentication-Results: i=1; mx.google.com; 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 k18-v6si9188138pgm.102.2018.09.07.09.44.10; Fri, 07 Sep 2018 09:44:26 -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; 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 S1726237AbeIGVYq (ORCPT + 99 others); Fri, 7 Sep 2018 17:24:46 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:34479 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbeIGVYq (ORCPT ); Fri, 7 Sep 2018 17:24:46 -0400 Received: from fsav105.sakura.ne.jp (fsav105.sakura.ne.jp [27.133.134.232]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w87Gh1DT018302; Sat, 8 Sep 2018 01:43:01 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav105.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp); Sat, 08 Sep 2018 01:43:01 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp) Received: from [192.168.1.8] (softbank060157066051.bbtec.net [60.157.66.51]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id w87Gh0FI018298 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 8 Sep 2018 01:43:01 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Subject: [PATCH] selinux: Add __GFP_NOWARN to allocation at str_read() To: selinux@tycho.nsa.gov References: <000000000000038dab0575476b73@google.com> Cc: syzbot , eparis@parisplace.org, linux-kernel@vger.kernel.org, paul@paul-moore.com, peter.enderborg@sony.com, sds@tycho.nsa.gov, syzkaller-bugs@googlegroups.com From: Tetsuo Handa Message-ID: Date: Sat, 8 Sep 2018 01:42:58 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <000000000000038dab0575476b73@google.com> Content-Type: text/plain; charset=utf-8 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 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 --- security/selinux/ss/policydb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index e9394e7..f4eadd3 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1101,7 +1101,7 @@ static int str_read(char **strp, gfp_t flags, void *fp, u32 len) if ((len == 0) || (len == (u32)-1)) return -EINVAL; - str = kmalloc(len + 1, flags); + str = kmalloc(len + 1, flags | __GFP_NOWARN); if (!str) return -ENOMEM; -- 1.8.3.1