Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp580916ybe; Fri, 6 Sep 2019 04:13:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmUgqrcpNNzR8GrDS443maWiLBS0gjsoMGDroTNHDIFv3xaiDUtch9ZZrn5v2unrKJIx88 X-Received: by 2002:a17:90a:19c4:: with SMTP id 4mr9194954pjj.20.1567768401567; Fri, 06 Sep 2019 04:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567768401; cv=none; d=google.com; s=arc-20160816; b=xce0ptEi+ySp3W2goHP4yPJyDxxJ+CbnjOR8tDqUvAqC/8D6AbHUEe/Cjl3/oCIsYk +kj+h90/dn1fv4oAWUA8cleZapCD9z7cN29Iuv1scbTHpD68RuyHjx3wQFvzap+g0Lrb pREQHfhYOx6GuOQKHXWj84cYe/TgCSVEeFRdiqaN24hBJiIDA7dYdrgIZ2R5rRUp+7zv z4afkp0Q7FNCHsroAJiQ3qJaLPcJiN+dju06vuEbGwzkBgzxSlA6hbR8YkfoTYGCz7cL BzxLYpdo35/yjk1/s3A3i0a/Ih3Fiz9+Qnl8eNSM9an49BtF380n8wwfu42Sx9qcsaAt c3jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=w4bIbwBA6X2Yma91453uNkH+btyYonpB6IFzqOcPClU=; b=uhxRsZXAk/XhQsxvtMmHKEEURE6utaOG5Ot911o64WFdu5712Ux8cSzSU7Oo/BKTEs IvCQmgayXRVtozuecxo8kSxNSo9+6ENcfhWYDent45M2SyIGPRrsyZR4YCNwyMecZWWm yCan7b6TzQozKbrULeNkQqmVHhl5MnSgpSrvwHzNbUWj8NRVWfzif8ciCoIPcL6pQ2dZ SWoJ9GNgZ4wSMSR0JPef6c81tDKLU4v4GsLNeAx2+SJRATbU/66qtLmOaVpQq7N8AdwB a+wHR+ot8Q7lNPeESdDQXD7scoToKA/2ONaIyvId+gn//ZY0V/SCT6Z1ySx6Nrvh2e6A 4HLA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si5662990pfj.149.2019.09.06.04.13.06; Fri, 06 Sep 2019 04:13:21 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404617AbfIFJic (ORCPT + 99 others); Fri, 6 Sep 2019 05:38:32 -0400 Received: from mga11.intel.com ([192.55.52.93]:29299 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730623AbfIFJib (ORCPT ); Fri, 6 Sep 2019 05:38:31 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2019 02:38:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,472,1559545200"; d="scan'208";a="334841754" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004.jf.intel.com with ESMTP; 06 Sep 2019 02:38:30 -0700 Received: from andy by smile with local (Exim 4.92.1) (envelope-from ) id 1i6AhJ-0004N1-2z; Fri, 06 Sep 2019 12:38:29 +0300 Date: Fri, 6 Sep 2019 12:38:29 +0300 From: Andy Shevchenko To: Kees Cook Cc: "J. Bruce Fields" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/9] rtl8192*: display ESSIDs using %pE Message-ID: <20190906093829.GK2680@smile.fi.intel.com> References: <20190905193604.GC31247@fieldses.org> <1567712673-1629-1-git-send-email-bfields@redhat.com> <201909051352.89D121A4@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909051352.89D121A4@keescook> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 05, 2019 at 01:53:43PM -0700, Kees Cook wrote: > On Thu, Sep 05, 2019 at 03:44:25PM -0400, J. Bruce Fields wrote: > > From: "J. Bruce Fields" > > > > Everywhere else in the kernel ESSIDs are printed using %pE, and I can't > > see why there should be an exception here. > > I would expand this rationale slightly: using "n" here makes no sense > because they are already NUL-terminated strings. The "n" modifier could > only be used with string_escape_mem() which takes a "length" argument. SSID may have NUL in any location in the name. > > - snprintf(escaped, sizeof(escaped), "%*pEn", essid_len, essid); > > + snprintf(escaped, sizeof(escaped), "%*pE", essid_len, essid); > > - snprintf(escaped, sizeof(escaped), "%*pEn", essid_len, essid); > > + snprintf(escaped, sizeof(escaped), "%*pE", essid_len, essid); -- With Best Regards, Andy Shevchenko