X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fbinfmt_flat.c;h=e92f229e3c6e9d994d61f5581625c35c2bde6bd7;hb=6e455b897bb6be3a4c0c6578f679e83d399e5b92;hp=697f6b5f13139ac5ea95a3f7456687299f26775e;hpb=366890df46c2fd9492c04fe3a8775447b7b053e4;p=mv-sheeva.git diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index 697f6b5f131..e92f229e3c6 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c @@ -828,15 +828,22 @@ static int load_flat_shared_library(int id, struct lib_info *libs) if (IS_ERR(bprm.file)) return res; + bprm.cred = prepare_exec_creds(); + res = -ENOMEM; + if (!bprm.cred) + goto out; + res = prepare_binprm(&bprm); if (res <= (unsigned long)-4096) res = load_flat_file(&bprm, libs, id, NULL); - if (bprm.file) { - allow_write_access(bprm.file); - fput(bprm.file); - bprm.file = NULL; - } + + abort_creds(bprm.cred); + +out: + allow_write_access(bprm.file); + fput(bprm.file); + return(res); }