Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp770856imd; Sat, 3 Nov 2018 09:55:49 -0700 (PDT) X-Google-Smtp-Source: AJdET5cqyQ4ziPdEAbtwj0Lds0fj9Rz1tTmVxMA/x4mf0OeBXheCLWADN73CTfLR0aRr15DbpSYK X-Received: by 2002:a65:66ce:: with SMTP id c14mr7781143pgw.450.1541264149501; Sat, 03 Nov 2018 09:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541264149; cv=none; d=google.com; s=arc-20160816; b=GwZ1aQd62nUeipO6Hk7FvN6cdkIgoQXYsDvFWpfAquqgQVxzs1MBkpBl1b7sm10cgl BxwRzmn/NsrNXnX2mnrxpI+RsNhLKsOOfMXFX/Pflc1Bbe+2geYaojD8vXPM1OIKW5yo 24H+sWXqCsKoTD6PNMBYLn52qFxAMACrVjsrryY5O1151jOZJOx1cKPnYR4S2MMGbE3U v6XHLdxQNaZxiT14ns3ofmynK3iZ/hOKQFIaeq5xWfdlPHbcF8zOsgMcyK5QgUbVJnn6 XHEjClPx7wOfge5CgSFeIdy+Dm8TpU8vM5uLL/Yn6izaaEyn6JAKwPLLydukJ+zivp9X QmFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EMor0NdrpgL6yqrFYKPg91jhsk2eWtYuGIven9mHULc=; b=SxScBG8J3mi51ycesJSAZ3kE955SK0c+nG7viW18cmXJE6YirmMvv9Ah+8a7NjnKuV 3/FoB4ST7TNnSacJZ28Kfv+8jJhcxX4OdsZGrnxK9kFMTNgidrKojJCAeESlGGa/HiA9 kxie3fw6NiFFPk5FC/vf6+uYNgyUylUoB5k4mDDQnKkU9y8pMoCAIXqebT6AqgrQhmja XG4XvpOAP4VP12aKkg9hNfp5IOdrzWSJECuNaBd/dcvlrMw5MfEkJAwGq0FXt79KLs/p FtbVXqs5sLuHzqPls8i5glpmXcuNiHWPVH/FjjwlJrob6Vq2bksIhx0t+ojm0eci13kj whwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=zjWs5bMg; 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 b1-v6si772103pfg.27.2018.11.03.09.55.21; Sat, 03 Nov 2018 09:55:49 -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=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=zjWs5bMg; 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 S1728384AbeKDCGY (ORCPT + 99 others); Sat, 3 Nov 2018 22:06:24 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37801 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727508AbeKDCGY (ORCPT ); Sat, 3 Nov 2018 22:06:24 -0400 Received: by mail-lj1-f196.google.com with SMTP id e5-v6so254451lja.4 for ; Sat, 03 Nov 2018 09:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EMor0NdrpgL6yqrFYKPg91jhsk2eWtYuGIven9mHULc=; b=zjWs5bMgMNiTLIuV+RZepD7shHDxg0HDZYi9WDIj/0M/nHz9GyiO0+iFZ76L01zntI /INoqYA1eb1u4OolRDQDiScKyrYAanucHK+wBxtOwoX/ljonJXIMdgCidxbhIm+CGlRP gFUVeN4uzG6Zx0oixD20FWRJ+6U0tOHU+1s/74tH1Ik1FTAkQ33kWqQ6jnsPIQ+WaHWw 1KDGtczHvyRulNFgfOEVegI7tCHxEx/96j3oxKY0CXmRriFF2sJtOZ6/LLXiJCB15DzF E9ueHpP7wea3tMvdn++s2I9h4itVEmzKTgJ3oMmm8DEuapbey95JvTbvsRE3Sh19Xwv6 rwvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EMor0NdrpgL6yqrFYKPg91jhsk2eWtYuGIven9mHULc=; b=NOR9UJOV0KjgPUudylcQa5h4hG8ZW3uGh0nLTi9Sr8Fy/W+SM1Ysh4NLJ262mTi9/F 0em0TYWd2XMefPBbk1utodq1lRCdykhmEbRw4CJFTApOgqR573m4h/E7gFTQmVnXkTJt BPIrHmyO/CrXW1UjCi3NoW6ZS38VHCb68SJ2IRiUjUhnZGzlO4mmDcFoIMvLw5mI8Qka gK8F7kGYoBqxYrLzXjJt/HsczMkLmqW28EdOsj+gyqD8af+Zb7TO08wLxm8lmjA46mzV +lPYajU8OQ0bMY5VWl1W7rrci/toHSsLh3ZNKFR486ui32WH/WjlHd6bkPKrLJSh1fqw +ZkQ== X-Gm-Message-State: AGRZ1gKbnSulrST8w0h1AF0AeDsXMUm/dOHxWgPH+V3AAEwZ7FK4tcgO dYzzu7EIgdOKaDgADvMP6yNPvwkl20uBa921IthiIQ== X-Received: by 2002:a2e:9107:: with SMTP id m7-v6mr10534619ljg.23.1541264073861; Sat, 03 Nov 2018 09:54:33 -0700 (PDT) MIME-Version: 1.0 References: <20181102212405.5911-1-olof@lixom.net> <20181103153925.ozyb4pqnixu6hw4z@holly.lan> In-Reply-To: <20181103153925.ozyb4pqnixu6hw4z@holly.lan> From: Olof Johansson Date: Sat, 3 Nov 2018 09:54:22 -0700 Message-ID: Subject: Re: [PATCH] kdb: fix strncpy warning To: Daniel Thompson Cc: Jason Wessel , Linux Kernel Mailing List , kgdb-bugreport@lists.sourceforge.net, prarit@redhat.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 3, 2018 at 8:39 AM Daniel Thompson wrote: > > On Fri, Nov 02, 2018 at 02:24:05PM -0700, Olof Johansson wrote: > > kdb does a strncpy(a, b, strlen(b)+1), which makes no sense. Might as > > well do a strcpy at this point. > > > > Fixes this warning: > > > > In function 'strncpy', inlined from 'kallsyms_symbol_next' at kernel/debug/kdb/kdb_support.c:239:4: > > ./include/linux/string.h:253:9: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=] > > I think we already have a pending patch for this: > https://lore.kernel.org/patchwork/patch/989013/ > > When we looked into this there actually is an unchecked overflow here so > Prarit's fix adds infrastructure to keep track of the remaining length. I'm not surprised that there are more bugs. The above patch was posted a month and a half ago though, why is it not yet merged? Can we get it in by -rc2, please? -Olof