From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09891C606CF for ; Tue, 9 Jul 2019 03:14:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DCB1F216C4 for ; Tue, 9 Jul 2019 03:14:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727329AbfGIDOF (ORCPT ); Mon, 8 Jul 2019 23:14:05 -0400 Received: from fieldses.org ([173.255.197.46]:38332 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725905AbfGIDOF (ORCPT ); Mon, 8 Jul 2019 23:14:05 -0400 Received: by fieldses.org (Postfix, from userid 2815) id B01192013; Mon, 8 Jul 2019 23:14:04 -0400 (EDT) Date: Mon, 8 Jul 2019 23:14:04 -0400 From: "J. Bruce Fields" To: Joe Perches Cc: Chuck Lever , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 8/8] nfsd: Fix misuse of strlcpy Message-ID: <20190709031404.GD14439@fieldses.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 04, 2019 at 04:57:48PM -0700, Joe Perches wrote: > Probable cut&paste typo - use the correct field size. Huh, that's been there forever, I wonder why we haven't seen crashes? Oh, I see, name and authname both have the same size. Anyway, makes sense, thanks. Will apply for 5.3. (Unless someone else is getting this; I didn't get copied on the rest of the series.) --b. > > Signed-off-by: Joe Perches > --- > fs/nfsd/nfs4idmap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c > index 2961016097ac..d1f285245af8 100644 > --- a/fs/nfsd/nfs4idmap.c > +++ b/fs/nfsd/nfs4idmap.c > @@ -83,7 +83,7 @@ ent_init(struct cache_head *cnew, struct cache_head *citm) > new->type = itm->type; > > strlcpy(new->name, itm->name, sizeof(new->name)); > - strlcpy(new->authname, itm->authname, sizeof(new->name)); > + strlcpy(new->authname, itm->authname, sizeof(new->authname)); > } > > static void > -- > 2.15.0