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: <1865922a0711041206m4a132200m19e33189137c901@mail.gmail.com>
Date:	Sun, 4 Nov 2007 22:06:45 +0200
From:	"Ahmed S. Darwish" <darwish.07@...il.com>
To:	"Casey Schaufler" <casey@...aufler-ca.com>
Cc:	akpm@...l.org, torvalds@...l.org,
	linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Smackv10: Smack rules grammar + their stateful parser

On 11/3/07, Ahmed S. Darwish <darwish.07@...il.com> wrote:
>  static int smk_open_load(struct inode *inode, struct file *file)
>  {
> -       return seq_open(file, &load_seq_ops);
> +       if ((file->f_flags & O_ACCMODE) == O_RDONLY)
> +               return seq_open(file, &load_seq_ops);
> +
> +       if (down_interruptible(&smack_write_sem))
> +               return -ERESTARTSYS;
> +
> +       load_state = kzalloc(sizeof(struct smack_load_state), GFP_KERNEL);
> +       if (!load_state)
> +               return -ENOMEM;
> +
> +       return 0;
> +}

Is it right to do the kzalloc with the semaphore being held? Will the
lock be held forever If kzalloc failed and -ENOMEM was returned ?

Thanks,

-- 
Ahmed S. Darwish
Homepage: http://darwish.07.googlepages.com
Blog: http://darwish-07.blogspot.com
-
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