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: <20090903175823.GA28752@redhat.com>
Date:	Thu, 3 Sep 2009 19:58:23 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Cyrill Gorcunov <gorcunov@...il.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	David Howells <dhowells@...hat.com>,
	James Morris <jmorris@...ei.org>,
	Roland McGrath <roland@...hat.com>,
	Tom Horsley <tom.horsley@....net>, linux-kernel@...r.kernel.org
Subject: Re: binfmt_flat.c && bprm->cred (Was: [PATCH 0/1] exec: do not
	sleep in TASK_TRACED under ->cred_guard_mutex)

On 09/03, Cyrill Gorcunov wrote:
>
> [Oleg Nesterov - Thu, Sep 03, 2009 at 06:29:39PM +0200]
> | On 09/03, Oleg Nesterov wrote:
> | >
> | > load_flat_shared_library() does something strange (but hopefully this
> | > patch doesn't break it). I do not understand why does it create the
> | > new bprm. Afaics, it could reuse bprm pointer which comes as an argument
> | > of ->load_binary(), all we need is to temporary change/restore bprm->file
> | > for load_flat_file().
> |
> | IOW, afaics the patch below makes sense. Imho it is a bit ugly binfmt_flat.c
> | plays with prepare_exec_creds().
> |
> | But again, I don't understand this code, and I didn't even try to compile
> | this patch.
> |
> | Oleg.
> |
> ...
> | -static int load_flat_shared_library(int id, struct lib_info *libs)
> | +static int load_flat_shared_library(struct linux_binprm *bprm, int id,
> | +						struct lib_info *libs)
> |  {
> ...
> | +	sprintf(buf, "/lib/lib%d.so", id);
>
> Hi Oleg, perhaps it is a good moment to switch sprintf to snprintf
> as well? buf is only 16 bytes long so we have 4 byte room for number.

Agreed. As you pointed out privately we have MAX_SHARED_LIBS=4, but
still snprintf() is safer.

Oleg.

--
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