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]
Date:	Thu, 18 Nov 2010 13:18:28 +0100
From:	richard -rw- weinberger <richard.weinberger@...il.com>
To:	Will Newton <will.newton@...il.com>
Cc:	Linux Kernel list <linux-kernel@...r.kernel.org>,
	user-mode-linux-devel@...ts.sourceforge.net,
	Jeff Dike <jdike@...toit.com>
Subject: Re: [PATCH 1/2] uml: Safely iterate list of winch handlers in line driver.

On Sat, Nov 13, 2010 at 6:44 PM, Will Newton <will.newton@...il.com> wrote:
> unregister_winch should use list_for_each_safe, as it can
> potentially delete from the list.
>
> Signed-off-by: Will Newton <will.newton@...il.com>
> ---
>  arch/um/drivers/line.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
> index 7f7338c..5f12fef 100644
> --- a/arch/um/drivers/line.c
> +++ b/arch/um/drivers/line.c
> @@ -820,12 +820,12 @@ void register_winch_irq(int fd, int tty_fd, int
> pid, struct tty_struct *tty,
>
>  static void unregister_winch(struct tty_struct *tty)
>  {
> -       struct list_head *ele;
> +       struct list_head *ele, *next;
>        struct winch *winch;
>
>        spin_lock(&winch_handler_lock);
>
> -       list_for_each(ele, &winch_handlers) {
> +       list_for_each_safe(ele, next, &winch_handlers) {
>                winch = list_entry(ele, struct winch, list);
>                if (winch->tty == tty) {
>                        free_winch(winch, 1);
> --
> 1.7.0.4
>

Please send your patches to akpm.

-- 
Thanks,
//richard
--
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