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: <43236E0D-65B4-46F5-A4F7-1659FC1F33A0@oracle.com>
Date:   Wed, 31 Mar 2021 18:26:15 +0000
From:   Haakon Bugge <haakon.bugge@...cle.com>
To:     Lv Yunlong <lyl2019@...l.ustc.edu.cn>
CC:     Santosh Shilimkar <santosh.shilimkar@...cle.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        OFED mailing list <linux-rdma@...r.kernel.org>,
        "rds-devel@....oracle.com" <rds-devel@....oracle.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] net/rds: Fix a use after free in rds_message_map_pages



> On 31 Mar 2021, at 03:59, Lv Yunlong <lyl2019@...l.ustc.edu.cn> wrote:
> 
> In rds_message_map_pages, the rm is freed by rds_message_put(rm).
> But rm is still used by rm->data.op_sg in return value.
> 
> My patch assigns ERR_CAST(rm->data.op_sg) to err before the rm is
> freed to avoid the uaf.
> 
> Fixes: 7dba92037baf3 ("net/rds: Use ERR_PTR for rds_message_alloc_sgs()")
> Signed-off-by: Lv Yunlong <lyl2019@...l.ustc.edu.cn>

Reviewed-by: Håkon Bugge <haakon.bugge@...cle.com>


Thanks for fixing this:-)

Håkon


> ---
> net/rds/message.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/rds/message.c b/net/rds/message.c
> index 071a261fdaab..799034e0f513 100644
> --- a/net/rds/message.c
> +++ b/net/rds/message.c
> @@ -347,8 +347,9 @@ struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned in
> 	rm->data.op_nents = DIV_ROUND_UP(total_len, PAGE_SIZE);
> 	rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs);
> 	if (IS_ERR(rm->data.op_sg)) {
> +		void *err = ERR_CAST(rm->data.op_sg);
> 		rds_message_put(rm);
> -		return ERR_CAST(rm->data.op_sg);
> +		return err;
> 	}
> 
> 	for (i = 0; i < rm->data.op_nents; ++i) {
> -- 
> 2.25.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ