lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a6bp8kfn.fsf@kernel.org>
Date:   Tue, 10 May 2022 18:41:00 +0300
From:   Kalle Valo <kvalo@...nel.org>
To:     Abhishek Kumar <kuabhs@...omium.org>
Cc:     netdev@...r.kernel.org, dianders@...omium.org,
        linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
        ath10k@...ts.infradead.org,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH v3] ath10k: improve BDF search fallback strategy

Abhishek Kumar <kuabhs@...omium.org> writes:

> Board data files wrapped inside board-2.bin files are
> identified based on a combination of bus architecture,
> chip-id, board-id or variants. Here is one such example
> of a BDF entry in board-2.bin file:
> bus=snoc,qmi-board-id=67,qmi-chip-id=320,variant=GO_XXXX
> It is possible for few platforms none of the combinations
> of bus,qmi-board,chip-id or variants match, e.g. if
> board-id is not programmed and thus reads board-id=0xff,
> there won't be any matching BDF to be found. In such
> situations, the wlan will fail to enumerate.
>
> Currently, to search for BDF, there are two fallback
> boardnames creates to search for BDFs in case the full BDF
> is not found. It is still possible that even the fallback
> boardnames do not match.
>
> As an improvement, search for BDF with full BDF combination
> and perform the fallback searches by stripping down the last
> elements until a BDF entry is found or none is found for all
> possible BDF combinations.e.g.
> Search for initial BDF first then followed by reduced BDF
> names as follows:
> bus=snoc,qmi-board-id=67,qmi-chip-id=320,variant=GO_XXXX
> bus=snoc,qmi-board-id=67,qmi-chip-id=320
> bus=snoc,qmi-board-id=67
> bus=snoc
> <No BDF found>
>
> Tested-on: WCN3990/hw1.0 WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1
> Signed-off-by: Abhishek Kumar <kuabhs@...omium.org>

[...]

>  static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
>  					      const char *boardname,
> -					      const char *fallback_boardname1,
> -					      const char *fallback_boardname2,
>  					      const char *filename)
>  {
> -	size_t len, magic_len;
> +	size_t len, magic_len, board_len;
>  	const u8 *data;
>  	int ret;
> +	char temp_boardname[100];
> +
> +	board_len = 100 * sizeof(temp_boardname[0]);

Why not:

board_len = sizeof(temp_board-name);

That way number 100 is used only once.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ