Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1754939pxf; Fri, 26 Mar 2021 14:10:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/HrAf0Bw6mLm/q6o0ASZZcoscBaUIadepu+RAOxFMXxvL++quAfv/mVAPiGYebFSt4ctV X-Received: by 2002:a17:906:d787:: with SMTP id pj7mr16991047ejb.257.1616793052342; Fri, 26 Mar 2021 14:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616793052; cv=none; d=google.com; s=arc-20160816; b=LpPl2RgbxmoyCsj/I96KXjS9cUmPtwNvEcaDoEYwzhWinaGDoDRO2AUDiRcV8JbIH5 feOFIJemC2qmu4XlxzAZhZAxRB1bBNhZ6ulfO/Z81ufdsK9LnIUC5g5PVri9LAvfa+2H sqfpIizQbTd06g+WdmqW2dS4FPbu6o++Ae6d+7GNF/O6qrFH2Ztc2DZHRcy0QvJ/1WTc P02eBjVKcxNUVlll1ev3DfZLUM9Mur7MK04RQmUJ+3AysWLjjXeqhkC+bzDY0fYyVp9U UDxyPQizbR2oSCxseVMTWyj2IFFeo5xEKgJi31puG5CwErrmytsZ/rASmtdEfxtBI6dx MfMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id; bh=MG2yycOw8cR2T5WsQ3vGU8kV/AO+Gv53MbXhf/VfWqk=; b=TLrmiptsyePLJXnQ1xu5Vsiyad7CWeCQGo6etildXpcPSZ3uwiq7B6X//1SBdwMz9p ueqq4tC8o26B49xjX108c5lADccc1cmfDl2UQPDdr+85ovk6DXCg+qwnGnLjVaE7ci8T DfLlC3rgMyRaOy2/NK0qHvNFLUT7Hy2PuKEqGGE09OUGAJbLGWH/yg0RQQPa1k7l/a6T y8ffjwWGoErA05VhAGKKXg/SannA8LiyNObWbo7H1r3ul0iG6/LZxLHuRQfZEMrRg1HG nYG6bhQR9XIpT4cbPw3SZ9fO228LBXFMuXiW9P1FiXRuQCf9ydyKzlNxW4dCrtyYPqCI kRrQ== ARC-Authentication-Results: i=1; mx.google.com; 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 j3si7586725eds.542.2021.03.26.14.10.24; Fri, 26 Mar 2021 14:10:52 -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; 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 S230159AbhCZVJv (ORCPT + 99 others); Fri, 26 Mar 2021 17:09:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbhCZVJm (ORCPT ); Fri, 26 Mar 2021 17:09:42 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1F13C0613AA for ; Fri, 26 Mar 2021 14:09:41 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lPti6-003cyy-S5; Fri, 26 Mar 2021 22:09:38 +0100 Message-ID: <249e2022c17f2555445061e533353ccd6f9e9b60.camel@sipsolutions.net> Subject: Re: [PATCH 1/3] mt76: mt7615: 0-terminate firmware log messages From: Johannes Berg To: Felix Fietkau , linux-wireless@vger.kernel.org Date: Fri, 26 Mar 2021 22:09:35 +0100 In-Reply-To: <20210326205505.74383-1-nbd@nbd.name> (sfid-20210326_215548_974123_3E7CAD0D) References: <20210326205505.74383-1-nbd@nbd.name> (sfid-20210326_215548_974123_3E7CAD0D) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > > + 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? johannes