Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1827248imm; Mon, 3 Sep 2018 10:27:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdafFBaC9sYs3Nvfbbawqt/n1EQpB1EXnQyc0Fxl4dJedtEucN8u3Cg22fTCW+pIFY3mRQSb X-Received: by 2002:a63:5706:: with SMTP id l6-v6mr28012143pgb.118.1535995645995; Mon, 03 Sep 2018 10:27:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995645; cv=none; d=google.com; s=arc-20160816; b=o30iNaN27D9dFMDArYp72SOAaAsZ5HYu1VjN9uJMgcTm0ZNihRoeg4S3XsFJO6nR9I RLVDXy7zx95EpzabDd1gaybAOxDIWNa9wuBlSMxjDojydNUe51NJM8KKwpRrccUjB14T +xhBDVipqy4yoaLP56x7L8f2aylpr5ctMNwvtjnbdTwMFPsXekB3407DJJ6XN3LR1pUR EL8y0xRq4DPjZmfBkrOijJryNrv0QOAQ5URYnb5GGDMAEM/LyXEPmcsltvWrTcKDmg/U 8RhPkOQW+fGtGxRd7eMx85enfwcc3xk4ZLvWoOH1yMM2pTi5+FmP4oW5+L2tmyQJTSY4 Tcrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3M2RYzVoc+upNsAEFkqritZh098lDhZFb0w4PX6vZmA=; b=xqscUD8gGQs9RBjFOuDpXMQiXQUXky8kqFnYE5vzaQccF5k+LA80jTWWyV9fRAEJQ7 swF/U4XWwKZdxsFrYCEPhfa5gy/A9N8Wukm7bp2aXFVb+KZIRSQIaInQYhhX+SeaUGtX 4+5KQcDk9F/AqYrDjO0K4u11rk6lP8mEUsqfnF6Y2k9Iqo2r39qFx1DO/5xdFuucdHcA MrjKt95aRD8jFcv+BPCDm/6ixagbEgdALWnqp4FSVqJMhmR3hh/ky8YPi8fofcBV1lJv 4lYmFqieu+9EQ8JrYVZ9ZIon1c9vQiJiTjQxyzy4N619619QcaKaibM36scta4l9K/TP Meqg== ARC-Authentication-Results: i=1; mx.google.com; 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 66-v6si17492420plb.428.2018.09.03.10.27.10; Mon, 03 Sep 2018 10:27:25 -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; 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 S1730787AbeICVrP (ORCPT + 99 others); Mon, 3 Sep 2018 17:47:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45856 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728500AbeICVrO (ORCPT ); Mon, 3 Sep 2018 17:47:14 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 782B3D24; Mon, 3 Sep 2018 17:26:07 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Buesch , Kalle Valo Subject: [PATCH 4.14 129/165] b43legacy/leds: Ensure NUL-termination of LED name string Date: Mon, 3 Sep 2018 18:56:55 +0200 Message-Id: <20180903165702.033795576@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Buesch commit 4d77a89e3924b12f4a5628b21237e57ab4703866 upstream. strncpy might not NUL-terminate the string, if the name equals the buffer size. Use strlcpy instead. Signed-off-by: Michael Buesch Cc: stable@vger.kernel.org Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/broadcom/b43legacy/leds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/broadcom/b43legacy/leds.c +++ b/drivers/net/wireless/broadcom/b43legacy/leds.c @@ -101,7 +101,7 @@ static int b43legacy_register_led(struct led->dev = dev; led->index = led_index; led->activelow = activelow; - strncpy(led->name, name, sizeof(led->name)); + strlcpy(led->name, name, sizeof(led->name)); led->led_dev.name = led->name; led->led_dev.default_trigger = default_trigger;