Received: by 10.213.65.68 with SMTP id h4csp294123imn; Mon, 12 Mar 2018 14:07:03 -0700 (PDT) X-Google-Smtp-Source: AG47ELs7sSUcJyrJPSH+UDrU929TrL2T2Mo6S2APB7gx9RynXMh6pajitBX7TU1mNRUwZzwNS/qd X-Received: by 10.99.97.16 with SMTP id v16mr7572187pgb.104.1520888823597; Mon, 12 Mar 2018 14:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520888823; cv=none; d=google.com; s=arc-20160816; b=LS5eFwQMuMVERxGBzgLvnxQUjAcF6OiE65aL4xS4n4GH7EUablyOC0Metzir6O10Nj qhkhmpdJU7ijmNM4YWfHwFuarEWcFfV175Q2zI99Xw3+EzgWLYx7+sqzUGaNqeo2kD1x kHoE0GXQ/qdG0RvGuCMFDE6kysko/z1dVLohc2/rJcyJ8a+Oeh2HX85yfGTK0UQmbAXm dMKsZ1qLFOCZ+RgpmWToWx5Pfx8ek7oZAgcm4a2dIzLwh9267wRlqtuyBsTlmB2Uuthw UpMHlTJSzxCHqw/4chMCDitfgvMXlCVM/PMAK/w2uFVazZ9a2+9Fi36zE6Nryc5//LAs 5X8g== 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:organization:from:references:cc:to:subject :arc-authentication-results; bh=UZBJSmoUl4PZyg6We9R1sAjQ9eVDvUkqam3WhTxydqc=; b=ELPHchY0F77/SwlAJD/CJkFc0aWpJL5SL1s11KvqmU+uA9pKLguKUozB9sg2xZbuOD YGTfaDkU9IjcoUMCpqp5yWAdNknxcnqDugjqpZLDlj3CeMhiH9nsFPN9ONobsgRhs+Yz y5HQ2/gvtBV07gKpDro9hrOjVGwiG75nHHrSobX1OZ5/EtzBrKUCgkiHsh+fgeVuO55K 9X8WzVfA87J+Pkfape128L5+fNdRN1dApwaD7j4eXW5+CrlbKq55DjEZchitIN4nvDoF 6kaesVsqNOjdALr4KzIhzTf8jq5CluECIlIpawlUEJaGux1QIoZT913wCPUFpcNasGMy /biQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e92-v6si6529363pld.736.2018.03.12.14.06.48; Mon, 12 Mar 2018 14:07:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932498AbeCLVE7 (ORCPT + 99 others); Mon, 12 Mar 2018 17:04:59 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56874 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932372AbeCLVE6 (ORCPT ); Mon, 12 Mar 2018 17:04:58 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E67A8D1445; Mon, 12 Mar 2018 21:04:57 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-75.bos.redhat.com [10.18.17.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id B68AB202660D; Mon, 12 Mar 2018 21:04:57 +0000 (UTC) Subject: Re: [PATCH v4 3/6] sysctl: Warn when a clamped sysctl parameter is set out of range To: Andrew Morton Cc: "Luis R. Rodriguez" , Kees Cook , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Al Viro , Matthew Wilcox References: <1520885744-1546-1-git-send-email-longman@redhat.com> <1520885744-1546-4-git-send-email-longman@redhat.com> <20180312140027.97db31d5dfc5c5f52a7c19a3@linux-foundation.org> From: Waiman Long Organization: Red Hat Message-ID: Date: Mon, 12 Mar 2018 17:04:57 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180312140027.97db31d5dfc5c5f52a7c19a3@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 12 Mar 2018 21:04:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 12 Mar 2018 21:04:58 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/12/2018 05:00 PM, Andrew Morton wrote: > On Mon, 12 Mar 2018 16:15:41 -0400 Waiman Long wrote: > >> Even with clamped sysctl parameters, it is still not that straight >> forward to figure out the exact range of those parameters. One may >> try to write extreme parameter values to see if they get clamped. >> To make it easier, a warning with the expected range will now be >> printed into the kernel ring buffer when a clamped sysctl parameter >> receives an out of range value. >> >> The pr_warn_ratelimited() macro is used to limit the number of warning >> messages that can be printed within a given period of time. >> >> ... >> >> +#ifdef pr_fmt >> +#undef pr_fmt >> +#endif >> +#define pr_fmt(fmt) "sysctl: " fmt > Why is it necessary to undefine pr_fmt? That's a somewhat unusual > thing to do. > > Because it is defined in the printk.h. I should have put the pr_fmt definition before the iinclude file to eliminate the need to undefine it. -Longman