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: <CAK-6q+jQcyyAtMD5tjzjrJg8Auy6HuugJomiSokwRhqRifVpCA@mail.gmail.com>
Date:   Tue, 4 Jul 2023 12:22:21 -0400
From:   Alexander Aring <aahringo@...hat.com>
To:     Wang Ming <machel@...o.com>
Cc:     Christine Caulfield <ccaulfie@...hat.com>,
        David Teigland <teigland@...hat.com>, cluster-devel@...hat.com,
        linux-kernel@...r.kernel.org, opensource.kernel@...o.com
Subject: Re: [Cluster-devel] [PATCH v1] fs:dlm:Fix NULL pointer dereference
 bug in accept_from_sock()

Hi,

On Tue, Jul 4, 2023 at 6:56 AM Wang Ming <machel@...o.com> wrote:
>
> newcon -> sock is NULL but dereferenced.
> First check newcon. Whether sock is a null pointer.
> If so, the subsequent operations are skipped.
> If it is not empty, perform subsequent operations.
>

did you experience some null pointer dereference? If so, on which kernel was it?

> Signed-off-by: Wang Ming <machel@...o.com>
> ---
>  fs/dlm/lowcomms.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
> index 9f14ea9f6..ea18b9478 100644
> --- a/fs/dlm/lowcomms.c
> +++ b/fs/dlm/lowcomms.c
> @@ -1081,9 +1081,12 @@ static int accept_from_sock(void)
>                 add_sock(newsock, newcon);
>

Here in add_sock() we assign newcon->sock = newsock. It cannot fail
and newsock cannot be null, so holding the newcon->sock_lock write
protected _should_ be safe that others don't manipulate newcon->sock.
It should, that's why I am asking if you experienced some issue here?

>                 /* check if we receved something while adding */
> -               lock_sock(newcon->sock->sk);
> -               lowcomms_queue_rwork(newcon);
> -               release_sock(newcon->sock->sk);

see above, newcon->sock should always be set at this point.

> +               if (newcon->sock) {
> +                       lock_sock(newcon->sock->sk);
> +                       lowcomms_queue_rwork(newcon);
> +                       release_sock(newcon->sock->sk);
> +               }
> +
>         }
>         up_write(&newcon->sock_lock);
>         srcu_read_unlock(&connections_srcu, idx);

- Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ