Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8745747rwb; Thu, 24 Nov 2022 03:52:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf7QjRmEe3Cg8+QJg13hJq45qiRKhnoxuX9kRED2zFWpL5J18bmOLhV87HVARzfPueaaEubR X-Received: by 2002:a17:90a:a588:b0:218:8eb8:8502 with SMTP id b8-20020a17090aa58800b002188eb88502mr28287753pjq.179.1669290761605; Thu, 24 Nov 2022 03:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669290761; cv=none; d=google.com; s=arc-20160816; b=K5935fsl+erjgfscwcLocfX69+8IL1q0irAZ4nksN5ABy6eWJ6Vx3vc/cHj5tQ3E9g bOOkrhaeSTc/VvoibClpv3r7F+4tW5c71BL79ZGiFsu3lLjpgpGe6sHK6f0YZVLD/HRv /rY4VVjc0aFFxopjHMmb36fczwxb6zmVCFKLSKWn8cQzdyH7xvapPWG1re71tdSh0nx+ DMR///p2quflalk9XgeuNwtzeBLDTCQ11DuIhpSRpKTWm6U1k54xHm6SzsRYx6tTDX2y MTCLlCbf7pUJRNdEV/1V/dzJA2Xhmp4NXTLQRgsuFg1x+6eNUoG4cQzE5kYApXJTyyj5 pDcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=uPpZWUmxYRjglAtuqHSqyHZ5mn0molDa0iLYcLNF470=; b=st34f74cAAiC3ObvRLIEVPLQ9F0QiYqRZrHonluku9fp3VQqaNd+x2FAB/kfwoo9gt W+6BNAfhFZUG/lvd2WYKzo0HwGy6ToLqOO/dBcVKxudgOq+0o0wo24ULbSm6D5qBWGC2 Vlg2xHhxvPLGvI9PNav0mSnZK7wYLntiIwrmGLQ/gq55ixr4ZSJhC9rWwnO3T88S3BCZ hoOM6ScWUbTbkg4Lc07RrpQiE83tO7EJ867YbRM4IQYsbhzW2/61XIp5codqDstOTDMi BHwAySrj5SGmUQNPSqckln8hAS5BdsXDvftTnK4mGMHDAATlSHOuK+mQ7v8fTm8pFE7E RT2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a170902aa8900b00188ea75abfasi37365plr.257.2022.11.24.03.52.30; Thu, 24 Nov 2022 03:52:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229662AbiKXL0V (ORCPT + 86 others); Thu, 24 Nov 2022 06:26:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiKXL0U (ORCPT ); Thu, 24 Nov 2022 06:26:20 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AB9B2529C; Thu, 24 Nov 2022 03:26:19 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NHwfx2tNGz5BNRf; Thu, 24 Nov 2022 19:26:17 +0800 (CST) Received: from szxlzmapp04.zte.com.cn ([10.5.231.166]) by mse-fl2.zte.com.cn with SMTP id 2AOBQAQp098428; Thu, 24 Nov 2022 19:26:10 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Thu, 24 Nov 2022 19:26:13 +0800 (CST) Date: Thu, 24 Nov 2022 19:26:13 +0800 (CST) X-Zmail-TransId: 2b04637f54d5ffffffffd03e764f X-Mailer: Zmail v1.0 Message-ID: <202211241926133236370@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIGRtYS1idWY6IHVzZSBzdHJzY3B5KCkgdG8gaW5zdGVhZCBvZiBzdHJsY3B5KCk=?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2AOBQAQp098428 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 637F54D9.000 by FangMail milter! X-FangMail-Envelope: 1669289177/4NHwfx2tNGz5BNRf/637F54D9.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 637F54D9.000/4NHwfx2tNGz5BNRf X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xu Panda The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- drivers/dma-buf/dma-buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index b6c36914e7c6..485cf4f3431e 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -51,7 +51,7 @@ static char *dmabuffs_dname(struct dentry *dentry, char *buffer, int buflen) dmabuf = dentry->d_fsdata; spin_lock(&dmabuf->name_lock); if (dmabuf->name) - ret = strlcpy(name, dmabuf->name, DMA_BUF_NAME_LEN); + ret = strscpy(name, dmabuf->name, DMA_BUF_NAME_LEN); spin_unlock(&dmabuf->name_lock); return dynamic_dname(buffer, buflen, "/%s:%s", -- 2.15.2