[yocto] bitbake is corrupting my files during unpacking

MOHAMMAD RASIM mohammad.rasim96 at gmail.com
Sat Jul 21 00:55:13 PDT 2018


well apparently this is caused by the unzip binary that is compiled by 
the openembedded unzip recipe.
If I unzip the same zip file with the unzip binary that is shipped with 
my system(manjaro) then the files are not corrupted but when I use the 
unzip binary compiled by the openembedded recipe I get error and file 
corruptions.
These are some of the errors I get when unzipping with the openembedded 
unzip:
lchmod (file attributes) error: Function not implemented
linux-amlogic-amlogic-3.14-nougat/security/keys/request_key_auth.c -> /* 
Request key authorisation token key definition.^J *^J * Copyright (C) 
2005 Red Hat, Inc. All Rights Reserved.^J * Written by David Howells 
(dhowells at redhat.com)^J *^J * This program is free software; you can 
redistribute it and/or^J * modify it under the terms of the GNU General 
Public License^J * as published by the Free Software Foundation; either 
version^J * 2 of the License, or (at your option) any later version.^J 
*^J * See Documentation/security/keys-request-key.txt^J */^J^J#include 
<linux/module.h>^J#include <linux/sched.h>^J#include 
<linux/err.h>^J#include <linux/seq_file.h>^J#include 
<linux/slab.h>^J#include <asm/uaccess.h>^J#include 
"internal.h"^J#include <keys/user-type.h>^J^Jstatic int 
request_key_auth_instantiate(struct key *,^J^I^I^I^I^Istruct 
key_preparsed_payload *);^Jstatic void request_key_auth_describe(const 
struct key *, struct seq_file *);^Jstatic void 
request_key_auth_revoke(struct key *);^Jstatic void 
request_key_auth_destroy(struct key *);^Jstatic long 
request_key_auth_read(const struct key *, char __user *, 
size_t);^J^J/*^J * The request-key authorisation key type definition.^J 
*/^Jstruct key_type key_type_request_key_auth = {^J^I.name^I^I= 
".request_key_auth",^J^I.def_datalen^I= sizeof(struct 
request_key_auth),^J^I.instantiate^I= 
request_key_auth_instantiate,^J^I.describe^I= 
request_key_auth_describe,^J^I.revoke^I^I= 
request_key_auth_revoke,^J^I.destroy^I= 
request_key_auth_destroy,^J^I.read^I^I= 
request_key_auth_read,^J};^J^J/*^J * Instantiate a request-key 
authorisation key.^J */^Jstatic int request_key_auth_instantiate(struct 
key *key,^J^I^I^I^I^Istruct key_preparsed_payload 
*prep)^J{^J^Ikey->payload.data = (struct request_key_auth 
*)prep->data;^J^Ireturn 0;^J}^J^J/*^J * Describe an authorisation 
token.^J */^Jstatic void request_key_auth_describe(const struct key 
*key,^J^I^I^I^I struct seq_file *m)^J{^J^Istruct request_key_auth *rka = 
key->payload.data;^J^J^Iseq_puts(m, "key:");^J^Iseq_puts(m, 
key->description);^J^Iif (key_is_instantiated(key))^J^I^Iseq_printf(m, " 
pid:%d ci:%zu", rka->pid, rka->callout_len);^J}^J^J/*^J * Read the 
callout_info data (retrieves the callout information).^J * - the key's 
semaphore is read-locked^J */^Jstatic long request_key_auth_read(const 
struct key *key,^J^I^I^I^I  char __user *buffer, size_t 
buflen)^J{^J^Istruct request_key_auth *rka = 
key->payload.data;^J^Isize_t datalen;^J^Ilong ret;^J^J^Idatalen = 
rka->callout_len;^J^Iret = datalen;^J^J^I/* we can return the data as is 
*/^J^Iif (buffer && buflen > 0) {^J^I^Iif (buflen > 
datalen)^J^I^I^Ibuflen = datalen;^J^J^I^Iif (copy_to_user(buffer, 
rka->callout_info, buflen) != 0)^J^I^I^Iret = -EFAULT;^J^I}^J^J^Ireturn 
ret;^J}^J^J/*^J * Handle revocation of an authorisation token key.^J *^J 
* Called with the key sem write-locked.^J */^Jstatic void 
request_key_auth_revoke(struct key *key)^J{^J^Istruct request_key_auth 
*rka = key->payload.data;^J^J^Ikenter("{%d}", key->serial);^J^J^Iif 
(rka->cred) {^J^I^Iput_cred(rka->cred);^J^I^Irka->cred = 
NULL;^J^I}^J}^J^J/*^J * Destroy an instantiation authorisation token 
key.^J */^Jstatic void request_key_auth_destroy(struct key 
*key)^J{^J^Istruct request_key_auth *rka = 
key->payload.data;^J^J^Ikenter("{%d}", key->serial);^J^J^Iif (rka->cred) 
{^J^I^Iput_cred(rka->cred);^J^I^Irka->cred = 
NULL;^J^I}^J^J^Ikey_put(rka->target_key);^J^Ikey_put(rka->dest_keyring);^J^Ikfree(rka->callout_info);^J^Ikfree(rka);^J}^J^J/*^J 
* Create an authorisation token for /sbin/request-key or whoever to 
gain^J * access to the caller's security data.^J */^Jstruct key 
*request_key_auth_new(struct key *target, const void 
*callout_info,^J^I^I^I^I size_t callout_len, struct key 
*dest_keyring)^J{^J^Istruct request_key_auth *rka, *irka;^J^Iconst 
struct cred *cred = current->cred;^J^Istruct key *authkey = 
NULL;^J^Ichar desc[20];^J^Iint ret;^J^J^Ikenter("%d,", 
target->serial);^J^J^I/* allocate a auth record */^J^Irka = 
kmalloc(sizeof(*rka), GFP_KERNEL);^J^Iif (!rka) {^J^I^Ikleave(" = 
-ENOMEM");^J^I^Ireturn ERR_PTR(-ENOMEM);^J^I}^J^Irka->callout_info = 
kmalloc(callout_len, GFP_KERNEL);^J^Iif (!rka->callout_info) 
{^J^I^Ikleave(" = -ENOMEM");^J^I^Ikfree(rka);^J^I^Ireturn 
ERR_PTR(-ENOMEM);^J^I}^J^J^I/* see if the calling process is already 
servicing the key request of^J^I * another process */^J^Iif 
(cred->request_key_auth) {^J^I^I/* it is - use that instantiation 
context here too 
*/^J^I^Idown_read(&cred->request_key_auth->sem);^J^J^I^I/* if the auth 
key has been revoked, then the key we're^J^I^I * servicing is already 
instantiated */^J^I^Iif (test_bit(KEY_FLAG_REVOKED, 
&cred->request_key_auth->flags))^J^I^I^Igoto 
auth_key_revoked;^J^J^I^Iirka = 
cred->request_key_auth->payload.data;^J^I^Irka->cred = 
get_cred(irka->cred);^J^I^Irka->pid = 
irka->pid;^J^J^I^Iup_read(&cred->request_key_auth->sem);^J^I}^J^Ielse 
{^J^I^I/* it isn't - use this process as the context */^J^I^Irka->cred = 
get_cred(cred);^J^I^Irka->pid = current->pid;^J^I}^J^J^Irka->target_key 
= key_get(target);^J^Irka->dest_keyring = 
key_get(dest_keyring);^J^Imemcpy(rka->callout_info, callout_info, 
callout_len);^J^Irka->callout_len = callout_len;^J^J^I/* allocate the 
auth key */^J^Isprintf(desc, "%x", target->serial);^J^J^Iauthkey = 
key_alloc(&key_type_request_key_auth, desc,^J^I^I^I cred->fsuid, 
cred->fsgid, cred,^J^I^I^I    KEY_POS_VIEW | KEY_POS_READ | 
KEY_POS_SEARCH |^J^I^I^I    KEY_USR_VIEW, KEY_ALLOC_NOT_IN_QUOTA);^J^Iif 
(IS_ERR(authkey)) {^J^I^Iret = PTR_ERR(authkey);^J^I^Igoto 
error_alloc;^J^I}^J^J^I/* construct the auth key */^J^Iret = 
key_instantiate_and_link(authkey, rka, 0, NULL, NULL);^J^Iif (ret < 
0)^J^I^Igoto error_inst;^J^J^Ikleave(" = {%d,%d}", authkey->serial, 
atomic_read(&authkey->usage));^J^Ireturn 
authkey;^J^Jauth_key_revoked:^J^Iup_read(&cred->request_key_auth->sem);^J^Ikfree(rka->callout_info);^J^Ikfree(rka);^J^Ikleave("= 
-EKEYREVOKED");^J^Ireturn 
ERR_PTR(-EKEYREVOKED);^J^Jerror_inst:^J^Ikey_revoke(authkey);^J^Ikey_put(authkey);^Jerror_alloc:^J^Ikey_put(rka->target_key);^J^Ikey_put(rka->dest_keyring);^J^Ikfree(rka->callout_info);^J^Ikfree(rka);^J^Ikleave("= 
%d", ret);^J^Ireturn ERR_PTR(ret);^J}^J^J/*^J * Search the current 
process's keyrings for the authorisation key for^J * instantiation of a 
key.^J */^Jstruct key *key_get_instantiation_authkey(key_serial_t 
target_id)^J{^J^Ichar description[16];^J^Istruct keyring_search_context 
ctx = {^J^I^I.index_key.type^I^I= 
&key_type_request_key_auth,^J^I^I.index_key.description^I= 
description,^J^I^I.cred^I^I^I= current_cred(),^J^I^I.match^I^I^I= 
user_match,^J^I^I.match_data^I^I= description,^J^I^I.flags^I^I^I= 
KEYRING_SEARCH_LOOKUP_DIRECT,^J^I};^J^Istruct key *authkey;^J^Ikey_ref_t 
authkey_ref;^J^J^Isprintf(description, "%x", 
target_id);^J^J^Iauthkey_ref = search_process_keyrings(&ctx);^J^J^Iif 
(IS_ERR(authkey_ref)) {^J^I^Iauthkey = ERR_CAST(authkey_ref);^J^I^Iif 
(authkey == ERR_PTR(-EAGAIN))^J^I^I^Iauthkey = 
ERR_PTR(-ENOKEY);^J^I^Igoto error;^J^I}^J^J^Iauthkey = 
key_ref_to_ptr(authkey_ref);^J^Iif (test_bit(KEY_FLAG_REVOKED, 
&authkey->flags)) {^J^I^Ikey_put(authkey);^J^I^Iauthkey = 
ERR_PTR(-EKEYREVOKED);^J^I}^J^Jerror:^J^Ireturn authkey;^J}^J
symlink error: File name too long
lchmod (file attributes) error: Function not implemented
linux-amlogic-amlogic-3.14-nougat/tools/gator/daemon/k/perf_event.h -> 
perf_event.3.12.h
lchmod (file attributes) error: Function not implemented

This error happens to multiple files where the file is symlinked to the 
content of the file and not to a path !
Where should I report this bug ? openembedded ? unzip upstream ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20180721/e983d633/attachment.html>


More information about the yocto mailing list