Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3788906imm; Mon, 8 Oct 2018 09:31:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV62un259v6Z9yUesQIsYfnn/y+/dRZxJgaVZCLyQtUFeua7RrpVITGVEwpS0YRExZlsj7kxi X-Received: by 2002:a62:1316:: with SMTP id b22-v6mr25934460pfj.37.1539016262680; Mon, 08 Oct 2018 09:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539016262; cv=none; d=google.com; s=arc-20160816; b=IbLvQn9omSo13A2cPAQNCiahgxb95vJ4EV4t0jZlwHdVuiFluxKw4t1V2HjstjPTud 60YUp1oRFe7mkCtgBaWhk6+TS+lgMHKlLZgj/521YgUzul2ycKwfiI3S6th8hYj9FleG np08q2gUvLa0mpD1G4s328QOgVBbsvd39ZLpdFbcLyUA/1vfYupaHlSqpoW7DbHlyFWt lIhzqE1onKnXuDNVEi1NLeQ/bDVd8HocJbRIQkoD4dkvb/S/me7hHCW2gV6I+H/iT3e/ L5klzr1PT93HBu0Ja9Pvij+V7k8JGenO29/FueF0hPbuogZ9VcvcPExQ5mdBA0BgOaVx f2WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=eR9Pp/DM+Ex3SRmBMTrq097rPQGl96w9TH6Kmv5e7oc=; b=mkucJ8ftpycT8a+ruWBaD7cDyRqL6K8gLHBxW/oplnu52yvyCkbe+yKJzZA326lKV6 n7Y4NSUhPjCHRu9zi0o+w2npYRXnvFF0e936+bhwA1oCYSBuM0Xx82SYEnI67cJeGaNy Dc1V1bwHbJcZSXTt2rf7B+JdwYOspfHqpUeeh88TA6uZlplmhiOzKUI1lYoA6W4UE6g/ MZ5hppywqsSBJJ7Ve7rSRI133qvedIRYTzxpoqCZPiJR6Cs3fP9Sj3D0/onzgABKmewv 9XWqwo1pznBWtWgiYZcDdlWM9/IICFUSIePR2U1zTnJxiuzjz3NxnQgxGJVtqS1LhkfH Q41Q== 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 w14-v6si18136965plp.183.2018.10.08.09.30.47; Mon, 08 Oct 2018 09:31:02 -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 S1727216AbeJHXm6 (ORCPT + 99 others); Mon, 8 Oct 2018 19:42:58 -0400 Received: from mail1.windriver.com ([147.11.146.13]:41964 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726731AbeJHXm5 (ORCPT ); Mon, 8 Oct 2018 19:42:57 -0400 Received: from ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id w98GUFoV019858 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 8 Oct 2018 09:30:15 -0700 (PDT) Received: from [128.224.162.216] (128.224.162.216) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 8 Oct 2018 09:30:15 -0700 Subject: Re: [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G To: Petr Mladek CC: , , References: <1538239553-81805-1-git-send-email-zhe.he@windriver.com> <1538239553-81805-4-git-send-email-zhe.he@windriver.com> <20181008135916.gg4kkmoki5bgtco5@pathway.suse.cz> From: He Zhe Message-ID: <2a9ea0e6-f1df-7dcd-e2e8-383e297ccc5f@windriver.com> Date: Tue, 9 Oct 2018 00:30:12 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181008135916.gg4kkmoki5bgtco5@pathway.suse.cz> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [128.224.162.216] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018年10月08日 21:59, Petr Mladek wrote: > I tried this patch with log_buf_len=5G. The kernel did not crash > but dmesg shown some mess. There are several 32-bit variables > to store the size, for example: > > static u32 log_buf_len = __LOG_BUF_LEN; > u32 log_buf_len_get(void) > static u32 log_first_idx; > static u32 log_next_idx; > > I guess that the code somewhere does not detect an overflows > correctly. > > I am not motivated enought to add support for such huge message > buffer. Therefore I suggest to limit it to 32G for now. I'm also fine with this suggestion. Thanks. Zhe