Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1984728ybg; Fri, 5 Jun 2020 02:35:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+ydKTBv2lQEdg9txoaZoANJRPhlUSS5dfqbm2ok/lq2OcPhyYLHkhujwBkGXdPOfAucVF X-Received: by 2002:a50:cdc6:: with SMTP id h6mr8238853edj.111.1591349713920; Fri, 05 Jun 2020 02:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591349713; cv=none; d=google.com; s=arc-20160816; b=o0LAEaS4D6WkwQKv4HA4+OF4HcF0K4Rqg2WjgaYfz6sQ/f9+822iyef63XM4bHBYDG YV1N2yT4q7wgTM0zqbx01rmMYgav1H+CD2tEG8CPcl9sIlXic4idEH2MTUD9sJl9TG+v QnIRVt/UTAGhDb6O4l3bOMHNvIZEtNLBwd24RkwgtAu/fwBLS139mmHgY62j0Sjp6wKh R1xRhI5zeizmcK7Hawev5zxZwKMWJpwus8NeL/B6nUuFBnk5D2l+Cs79Y6YjzFp0qNfj MMpfBpGOBC+T7QRAoi3hLbFr/IV7KhHkFZjv8YMpO02gPEYZq5Zz5n/GxRgIuk4E7A4L jUpQ== 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:from:references:cc:to:subject:dkim-signature; bh=mFjpcHRNvW7jr5yAUPBmHqqZtDxdLZ2YVWSiOFI3u8k=; b=WmEyM2I3k72laeLaWEKONzR8IJi4+WqLzYh8QeeOhedZKjL40aGjf6XWZKmGGZA/Kf uv3BPhOPyXgxXPBf8dtnozUTW75A8/QIVkr8OhniGqzGQgBuCyfyS30RruPTUXFivqNq kYHPtkEZxCKjCGScV9/OiS3/XvqfovW3SpesrFXQH6xN38S2vzgDqIpRXzYA7DuSjt2N wl8v8eGDF6PdZFTRUoKYE+RovZ7deTzy0jGoNfanUnfF2iwmLvJxoo6sE7Y5haZsIYax jO9cQRUXy+44dzz6e1m5WovNdLa/q8oaApPpA1J9N9vHHVwF6czAU/lDpiw9reAVrhz1 1vYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tncq0J7a; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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. [23.128.96.18]) by mx.google.com with ESMTP id dr21si4849799ejc.489.2020.06.05.02.34.48; Fri, 05 Jun 2020 02:35:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tncq0J7a; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S1726271AbgFEJeo (ORCPT + 99 others); Fri, 5 Jun 2020 05:34:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726188AbgFEJen (ORCPT ); Fri, 5 Jun 2020 05:34:43 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBA77C08C5C2 for ; Fri, 5 Jun 2020 02:34:43 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id t7so3426609plr.0 for ; Fri, 05 Jun 2020 02:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=mFjpcHRNvW7jr5yAUPBmHqqZtDxdLZ2YVWSiOFI3u8k=; b=tncq0J7af5auIOZilp/gB2dX3myfDONuE4xiyxtAkUZfzWxzWE+sbyTZDC5D7d7q1s TkuwIFyUml77QCNoYqfDaFlrLk4gm0MIkSzkxvKksshrFIGhPlZcK+uGgVjf3YNrNvBs /IdlmAr/bS9iHgPDFNQlITywQ92gob/YoVUdOMQlJvcnyH11gGeAMOvNXa0qTEO/CaSx OQtFtESL2j/vqrX/mjW//eGGEEP3N8chrtrzWPlI5nbjHRbkIdx0dsxMvFWpYiBdr1VF zPkTDDMmdYCw+TV8jrKyb/phZbJP1e9hp00ouOrbi+pEhIj2oQHt22pf818Fbj+1nKPt b+Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=mFjpcHRNvW7jr5yAUPBmHqqZtDxdLZ2YVWSiOFI3u8k=; b=Flwq7qq5yybh9FQ21P38kQEasbq4/zu4lkCYQr3sIO99jO/UkOjE1WdCUsPFumwQsK +B3J7WnG3q3oyx95k7bdetj4iQoI/MY7kh0bupYYaz4bA3izTIg0o1sGuS5faMS8kfE5 nK76kCl5KwDIYcXQn16iEO01J5bVS+dXsboZ5/M8TF4NQ6JJ3Jhq9qL2ruamOc8Olqx1 nxXe+kDT0IfTwBXRbxtAgKa5aUK98PB4iSbOhqKyxPsQvVxn+pAFcvsC3lqOtdieBMiE 8VT1g3aucZdryvpXQwlQi79vq9A1y9Dw9TFbMhb6KBSEazwrR0ik8HOhblH7Y8jBx6oz NDVw== X-Gm-Message-State: AOAM533HqxEYpgrH4G3gqJmpNUjsWp9EkLkMPQpNjwMjqvLu7hqKlSNy tpcUDxvOsFhi2lYMGAb/hA2Nzg== X-Received: by 2002:a17:902:bd09:: with SMTP id p9mr9263783pls.214.1591349683331; Fri, 05 Jun 2020 02:34:43 -0700 (PDT) Received: from [10.110.1.98] ([45.135.186.59]) by smtp.gmail.com with ESMTPSA id j8sm7453067pjw.11.2020.06.05.02.34.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Jun 2020 02:34:42 -0700 (PDT) Subject: Re: [PATCH] crypto: hisilicon - fix strncpy warning with strlcpy To: Herbert Xu Cc: Greg Kroah-Hartman , Jonathan Cameron , wangzhou1 , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, kbuild-all@lists.01.org References: <202006032110.BEbKqovX%lkp@intel.com> <1591241524-6452-1-git-send-email-zhangfei.gao@linaro.org> <20200604033918.GA2286@gondor.apana.org.au> <20200604061811.GA28759@gondor.apana.org.au> <20200604065009.GA29822@gondor.apana.org.au> From: Zhangfei Gao Message-ID: Date: Fri, 5 Jun 2020 17:34:32 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200604065009.GA29822@gondor.apana.org.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2020/6/4 下午2:50, Herbert Xu wrote: > On Thu, Jun 04, 2020 at 02:44:16PM +0800, Zhangfei Gao wrote: >> I think it is fine. >> 1. Currently the name size is 64, bigger enough. >> Simply grep in driver name, 64 should be enough. >> We can make it larger when there is a request. >> 2. it does not matter what the name is, since it is just an interface. >> cat /sys/class/uacce/hisi_zip-0/flags >> cat /sys/class/uacce/his-0/flags >> should be both fine to app only they can be distinguished. >> 3. It maybe a hard restriction to fail just because of a long name. > I think we should err on the side of caution. IOW, unless you > know that you need it to succeed when it exceeds the limit, then > you should just make it fail. Thanks Herbert Will add a check after the copy.         strlcpy(interface.name, pdev->driver->name, sizeof(interface.name));         if (strlen(pdev->driver->name) != strlen(interface.name))                 return -EINVAL; Will resend the fix after rc1 is open. Thanks