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] [day] [month] [year] [list]
Message-ID: <89eb0939d50045ff8d248e6f8fd87d1a@SC-EXCH04.marvell.com>
Date:	Fri, 9 Oct 2015 11:36:44 +0000
From:	Amitkumar Karwar <akarwar@...vell.com>
To:	Arnd Bergmann <arnd@...db.de>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	"y2038@...ts.linaro.org" <y2038@...ts.linaro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Nishant Sarmukadam <nishants@...vell.com>,
	Kalle Valo <kvalo@...eaurora.org>,
	"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>
Subject: RE: [PATCH 04/12] mwifiex: use ktime_get_real for timestamping

Hi Arnd,

> From: Arnd Bergmann [mailto:arnd@...db.de]
> Sent: Wednesday, September 30, 2015 4:57 PM
> To: netdev@...r.kernel.org
> Cc: y2038@...ts.linaro.org; linux-kernel@...r.kernel.org; David S.
> Miller; Arnd Bergmann; Amitkumar Karwar; Nishant Sarmukadam; Kalle Valo;
> linux-wireless@...r.kernel.org
> Subject: [PATCH 04/12] mwifiex: use ktime_get_real for timestamping
> 
> The mwifiex_11n_aggregate_pkt() function creates a ktime_t from a
> timeval returned by do_gettimeofday, which is slow and causes an
> overflow in 2038 on 32-bit architectures.
> 
> This solves both problems by using the appropriate ktime_get_real()
> function.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Cc: Amitkumar Karwar <akarwar@...vell.com>
> Cc: Nishant Sarmukadam <nishants@...vell.com>
> Cc: Kalle Valo <kvalo@...eaurora.org>
> Cc: linux-wireless@...r.kernel.org
> ---
>  drivers/net/wireless/mwifiex/11n_aggr.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c
> b/drivers/net/wireless/mwifiex/11n_aggr.c
> index f7c717253a66..78853c51774d 100644
> --- a/drivers/net/wireless/mwifiex/11n_aggr.c
> +++ b/drivers/net/wireless/mwifiex/11n_aggr.c
> @@ -173,7 +173,6 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private
> *priv,
>  	int pad = 0, aggr_num = 0, ret;
>  	struct mwifiex_tx_param tx_param;
>  	struct txpd *ptx_pd = NULL;
> -	struct timeval tv;
>  	int headroom = adapter->iface_type == MWIFIEX_USB ? 0 :
> INTF_HEADER_LEN;
> 
>  	skb_src = skb_peek(&pra_list->skb_head); @@ -203,8 +202,7 @@
> mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
>  	tx_info_aggr->flags |= MWIFIEX_BUF_FLAG_AGGR_PKT;
>  	skb_aggr->priority = skb_src->priority;
> 
> -	do_gettimeofday(&tv);
> -	skb_aggr->tstamp = timeval_to_ktime(tv);
> +	skb_aggr->tstamp = ktime_get_real();
> 
>  	do {
>  		/* Check if AMSDU can accommodate this MSDU */
> --
> 2.1.0.rc2

Looks good.

Acked-by: Amitkumar Karwar <akarwar@...vell.com>

Regards,
Amitkumar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ