Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp622139imm; Fri, 13 Jul 2018 03:34:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcAIr6bSZ2XEhh8P1FDxXio2WmZtNcZGF7mE+i9bJsewZnBh9B20uGLxJfzExLUAm2lpO/9 X-Received: by 2002:a17:902:b48c:: with SMTP id y12-v6mr5767272plr.97.1531478069050; Fri, 13 Jul 2018 03:34:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531478069; cv=none; d=google.com; s=arc-20160816; b=zKlOkCjZt432hBptlAXfIsPpKTrLKsQqtLVPUDeqeh/vIODwQr9ujH3VzpLwgUGdg+ LRzz5Ndw9Y9qX+FsLwx7ozh7P8oiLc0C4PleyZg+uWYJGMC9p9j/wt4BYVUpHVSPtHPq cgvpD3483C8/f/NlMkEZ5BDtZKNzimkY0Y2f4xXnkMoHFtcjVJJdyYDXBmkYm2Sx1dso +wX1JBpeXEsinim0MOzqCQY1IwNEJHhihEVEjtcv+MajKEcnlQFiggtWFTLIcSH/Si4J 83/LA96kws1ZnTKs61JC+i6mqTxlwOIchhRG6INrRA6o/RqzEtEDiYSg2w4TX126h7+S eNsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=/mTk72gQhbDl3f59Fk0kWeVwNlTNNGb9jxkZRmsGQ2w=; b=Mf7hIpIZvCJqWuAM7nbfpSzbVQytspNX+FATTMdwIx6GDzRDuwCv8aM+aYIhDw6FZ4 pMNVqw9BcfODuQ6QQv9MqxlosIImARsqvEXC+BZ7a/+JxEKd4S6cH5Hs3qaYX59BQRgE k6IPkXok0cryPK8CWkF/mfflk6YE5R/BEeEzA0DRaahHcqnwlblzXTRh63Q7lCB1+0sc E5qbMYOfC6j1KRn5h3UXNtrhWoaqxCxK6UBgAPUAStSCFusakrsLfZFMiWlqZqijECd7 nYPWEVhXMNke0jtlEt8moMeNOthpfaenUY9X4Jrff3sNoW9yUulxcjyNB8x2n1oqCx94 /hoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="L/2hASTj"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7-v6si21723636pgr.593.2018.07.13.03.34.14; Fri, 13 Jul 2018 03:34:29 -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; dkim=pass header.i=@linaro.org header.s=google header.b="L/2hASTj"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729616AbeGMKr3 (ORCPT + 99 others); Fri, 13 Jul 2018 06:47:29 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42712 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727147AbeGMKr3 (ORCPT ); Fri, 13 Jul 2018 06:47:29 -0400 Received: by mail-wr1-f67.google.com with SMTP id e7-v6so5056524wrs.9 for ; Fri, 13 Jul 2018 03:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/mTk72gQhbDl3f59Fk0kWeVwNlTNNGb9jxkZRmsGQ2w=; b=L/2hASTjq7lXdvbt28XKx0SlFuAnbYGnWf7uAyQnkxqgdA0GRvUlNGBQD/tl3PXIHt AQvNap6i1TqIHjEmum9nPKZAwhvHaWWZX0WI8Xo9gjR/o5+yjyipd1jUBtu+j2cjaAot z1syWu590D3SFs2esK1kurcwL6iLUds7NmBJY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/mTk72gQhbDl3f59Fk0kWeVwNlTNNGb9jxkZRmsGQ2w=; b=gCzQESKMmvkDz4d7pcbSWXw/y1V91p6VZaBrjEsjqlJmxIdh9uJ/KULJ/bMKhTogT4 bAvt/s7EODdQ0hgt8mrn37CJdm3Ru1Sn2irgSwmITymxo5W4Q1Qt5cTSP59CJ93R64by JRk+I8k2oA+5cRDb6Ap3Rg7JRY7fJ52YfkK+k0Z5yPXKFYjXD2fhzIXAfLb10cudUlSM gJfRKe3qSfQcxekR7mBqtTj5hZec9cuyAdAHGmiclOvB/BommTUw6sKrUYCkqqRg1Lxi acP7mQDwzvqZSY5mGWR88iDAomc7gsPMQkoprsUBgOkkBrx54fMcRlyXqYC78zW8tABd MgZQ== X-Gm-Message-State: AOUpUlGjOxn/1T9vwaMjsQEwvR5k9YNc0lkkrT50hWR6XoFfutfqotUn DEA9rX+ByNnyh1fsVhxbaYpJMg== X-Received: by 2002:adf:d24a:: with SMTP id o10-v6mr4399465wri.229.1531478004458; Fri, 13 Jul 2018 03:33:24 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id b190-v6sm10080613wma.24.2018.07.13.03.33.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jul 2018 03:33:23 -0700 (PDT) Date: Fri, 13 Jul 2018 11:33:21 +0100 From: Daniel Thompson To: Dominique Martinet Cc: Jason Wessel , Arnd Bergmann , kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH 14/18] kdb_support: change strncpy+truncation to strlcpy Message-ID: <20180713103321.thjpohla6fuszona@holly.lan> References: <1531444483-17338-1-git-send-email-asmadeus@codewreck.org> <1531445158-19731-1-git-send-email-asmadeus@codewreck.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1531445158-19731-1-git-send-email-asmadeus@codewreck.org> User-Agent: NeoMutt/20180622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 13, 2018 at 03:25:58AM +0200, Dominique Martinet wrote: > Generated by scripts/coccinelle/misc/strncpy_truncation.cocci > > Signed-off-by: Dominique Martinet It would have been good for you to mention in the changelog how you reviewed your change to verify that the extra zero padding from strncpy() isn't required. However... I have taken a look and can't see any problem so: Reviewed-by: Daniel Thompson > --- > > Please see https://marc.info/?l=linux-kernel&m=153144450722324&w=2 (the > first patch of the serie) for the motivation behind this patch > > kernel/debug/kdb/kdb_support.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/kernel/debug/kdb/kdb_support.c b/kernel/debug/kdb/kdb_support.c > index 990b3cc526c8..1f6a4b6bde0b 100644 > --- a/kernel/debug/kdb/kdb_support.c > +++ b/kernel/debug/kdb/kdb_support.c > @@ -119,8 +119,7 @@ int kdbnearsym(unsigned long addr, kdb_symtab_t *symtab) > * What was Rusty smoking when he wrote that code? > */ > if (symtab->sym_name != knt1) { > - strncpy(knt1, symtab->sym_name, knt1_size); > - knt1[knt1_size-1] = '\0'; > + strlcpy(knt1, symtab->sym_name, knt1_size); > } > for (i = 0; i < ARRAY_SIZE(kdb_name_table); ++i) { > if (kdb_name_table[i] && > -- > 2.17.1 >