Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1835034imm; Mon, 3 Sep 2018 10:39:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZf7ZII+1H/+W8lzxaFhxaw5N9rludDYvAtFcNI9GFAeYPlZP63OkNpznUHdSpsBJzrWnPf X-Received: by 2002:a62:219b:: with SMTP id o27-v6mr30365936pfj.235.1535996352893; Mon, 03 Sep 2018 10:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535996352; cv=none; d=google.com; s=arc-20160816; b=eoGhTKapqKeff8PMz9ONBKcICiWfKgY0SV9rv2vxSROgKy15Q5rJLY5JyfWxVzmd7s WQ6aQulN3pziLIlNV/59D/ZRHX5L9Ugn3C6HC5uohCJqpIlFdHm1xY/gPgi10ZepfakD p5MacpfCjTq72+cewBEDz+WqA2wgWXtYW51+IHsFQBGznjMLtOGw+94UMvVb+TYygI4m Yk2ZP64+im1mN7+9I9QrnOHEpH3C7balfnopdUGXNtVRFvIRZwY7uAJNA5s80VBNSFp0 Kr/FUb02hdDxD/rAhznniZR8qkUuL5s9MrALMjtxKlzNbEowoIDLv+44AHaIyIrjGqSc 0wcQ== 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=1ashsLHOeRKnrc6yElWby3A7NrOex4w/RRn4lcVy7+I=; b=h0XRjfvHz7VOP5f5mBHqM5I20fragF38AqoxTAShw5GMlvHhcAbj6TDN6Ny0RNMnxG ullPKunUcs00PWcg33uFqtJIDFNhUJ6r2eEFVlgJQYquwOhgt5Uk4bwP4mlNq787VHQm 58vxOg/iN27m6jsTDx8fTIPfj8lZ7GHVMsKjN/s4c+CWMDRswxaBUM5G8xfBQ9doYwTJ hyXKeHE5aOuuuVVlA/6CWNztptahCt6JwXgqDHlPvlOdKNVA9LEHtezayPw1alZL6pwN LIiOdekTYSNCQdEep/NlrVLY6CEXLoosVkt5Es1vv/iLlt6JpJs4885H1k8Ys+idOtN7 Kg0g== 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 p84-v6si19262559pfj.101.2018.09.03.10.38.57; Mon, 03 Sep 2018 10:39:12 -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 S1731701AbeICV6f (ORCPT + 99 others); Mon, 3 Sep 2018 17:58:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48724 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728430AbeICV6e (ORCPT ); Mon, 3 Sep 2018 17:58:34 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0A234A95; Mon, 3 Sep 2018 17:37:23 +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.18 070/123] b43legacy/leds: Ensure NUL-termination of LED name string Date: Mon, 3 Sep 2018 18:56:54 +0200 Message-Id: <20180903165722.384943922@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165719.499675257@linuxfoundation.org> References: <20180903165719.499675257@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.18-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;