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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa04fd38-a1df-4d16-bf16-e24a848a00f8@web.de>
Date: Mon, 17 Nov 2025 19:52:22 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Seungjin Bae <eeodqql09@...il.com>, linux-wireless@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>,
 Hin-Tak Leung <hintak.leung@...il.com>,
 Kyungtae Kim <Kyungtae.Kim@...tmouth.edu>
Subject: Re: [PATCH v2] rtl8187: Fix potential buffer underflow in
 rtl8187_rx_cb()

…
> +++ b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
> @@ -344,8 +344,13 @@ static void rtl8187_rx_cb(struct urb *urb)
>  	}
>  
>  	if (!priv->is_rtl8187b) {
> -		struct rtl8187_rx_hdr *hdr =
> -			(typeof(hdr))(skb_tail_pointer(skb) - sizeof(*hdr));
> +		struct rtl8187_rx_hdr *hdr;
> +
> +		if (skb->len < sizeof(struct rtl8187_rx_hdr)) {
> +			dev_kfree_skb_irq(skb);
> +			return;
> +		}
…

You may avoid duplicate exception handling code by using a corresponding goto statement.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.18-rc5#n526

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ