Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1782551pxf; Fri, 26 Mar 2021 14:54:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwY8bJWQq6rdw9On1BqYuwd4ivaQoz59H8LGx0yya3yw4doDYPoERGZgBYmDPZotNsZGYQo X-Received: by 2002:a17:906:828e:: with SMTP id h14mr17621889ejx.529.1616795694199; Fri, 26 Mar 2021 14:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616795694; cv=none; d=google.com; s=arc-20160816; b=zUQ1kzpG4uqWh4+kE2Q1XNNskwZrPTwgfrBPNnsBppRK0aUp9CHu5G7KAksAf0UDrT 8tMtNkN2IbyQRwnoFOIajlRjlHS5edsaKC+JMwyXru5rgG+3eEouBpR/W4mp8CniRSzD eElwtnOhw2KiITcy5be3AOy10CuU3WYCSN1icj+Xk5JjAG2dFF7srgPZIa6Coz/uv9xM wu9QOd0ectcbjA3vSq4t09aPqawISYZh/NA8U0otn5t8k0We91/aHgNAs+HNBCZmx4Ks d5WTw6vS93n9rMitgkH2GRG5igfqay9FS5++fqXBKQiY/KInadPUGFIe+1mhXGel5163 xf5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=MngQf5KHu6+ug9LH4Hz5GZZZKR+KxYngAx5ubI/wuLI=; b=Ddk0Jc4V1m7wRa0BGUBJZ/NtVve5fxfGG1JdaPyOWwz7PcAw35OLODA7LFpswwiJH3 sC/m3x6hAgsdGprhON5vfccbR8G0wXsnnapVFv8JLgx9QaidHhKZehbziYtLf5UPE7dM IN476qFzpr60XQIiddA6qiXpW26DBPx4WPNcN72GC+rRN0f4P/CJ/rR6qeinZI2SwUu1 MCkx+MH7euctPasy38bsBe9UX6p1epoNBfgGHc4I3VURCy/npSVo/6SqeGPNwJoSq4qm lCWTcts2D4wU5sYxsyhz3dx/xQM1ZMPeEGgeTz1cgNnkQOIFlC5d0H3Rv073gprERFuM 6eBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=NxRZU2CK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si8496493ejx.286.2021.03.26.14.54.30; Fri, 26 Mar 2021 14:54:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=NxRZU2CK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229986AbhCZVx5 (ORCPT + 99 others); Fri, 26 Mar 2021 17:53:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbhCZVxa (ORCPT ); Fri, 26 Mar 2021 17:53:30 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68C65C0613AA for ; Fri, 26 Mar 2021 14:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=MngQf5KHu6+ug9LH4Hz5GZZZKR+KxYngAx5ubI/wuLI=; b=NxRZU2CKYEPoOvnqzWLmIIYoKY li6eUgogvD8LeRdiIeK2Z1HaOAWXlOq8Dxyp7Z/C2yscOLAIBKLywHt2hPbNpU5W6u/Kqq65T1WjH yFH9mu0iuqd+EeOni9soc4nrrS5WvT4AIzy+wDfkufFlXfNswpJP9mNYoes5Ral0EhVE=; Received: from p4ff13c8d.dip0.t-ipconnect.de ([79.241.60.141] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lPuOS-0004rO-PZ; Fri, 26 Mar 2021 22:53:24 +0100 Subject: Re: [PATCH 1/3] mt76: mt7615: 0-terminate firmware log messages To: Johannes Berg , linux-wireless@vger.kernel.org References: <20210326205505.74383-1-nbd@nbd.name> <249e2022c17f2555445061e533353ccd6f9e9b60.camel@sipsolutions.net> From: Felix Fietkau Message-ID: Date: Fri, 26 Mar 2021 22:53:23 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <249e2022c17f2555445061e533353ccd6f9e9b60.camel@sipsolutions.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2021-03-26 22:09, Johannes Berg wrote: >> >> + skb->data[skb->len] = 0; >>   wiphy_info(mt76_hw(dev)->wiphy, "%s: %s", type, data); >>  } >> > > Are you sure there's always enough space to write to the skb? Following > the code up I'm not even sure it's always a linear skb :-) > > Might be safer/better to do > > wiphy_info(..., "%s: %*s", type, skb->len - sizeof(*rxd), > data); > > instead? Maybe it does trust the firmware too much. I'll send a v2 based on your suggestion. Thanks, - Felix