* [patch] ubifs: potential uninitialized variable in truncate_data_node()
@ 2017-01-05 12:46 ` Dan Carpenter
0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2017-01-05 12:46 UTC (permalink / raw)
To: Richard Weinberger, David Gstir
Cc: Artem Bityutskiy, Adrian Hunter, linux-mtd, kernel-janitors
GCC doesn't complain, but my static checker warns that if the data is
not compressed and not encrypted then "ret" isn't initialized.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index a459211a1c21..c54f04d88236 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -1281,7 +1281,8 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
int *new_len)
{
void *buf;
- int err, dlen, compr_type, out_len, old_dlen;
+ int dlen, compr_type, out_len, old_dlen;
+ int err = 0;
out_len = le32_to_cpu(dn->size);
buf = kmalloc(out_len * WORST_COMPR_FACTOR, GFP_NOFS);
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [patch] ubifs: potential uninitialized variable in truncate_data_node()
@ 2017-01-05 12:46 ` Dan Carpenter
0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2017-01-05 12:46 UTC (permalink / raw)
To: Richard Weinberger, David Gstir
Cc: Artem Bityutskiy, Adrian Hunter, linux-mtd, kernel-janitors
GCC doesn't complain, but my static checker warns that if the data is
not compressed and not encrypted then "ret" isn't initialized.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index a459211a1c21..c54f04d88236 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -1281,7 +1281,8 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
int *new_len)
{
void *buf;
- int err, dlen, compr_type, out_len, old_dlen;
+ int dlen, compr_type, out_len, old_dlen;
+ int err = 0;
out_len = le32_to_cpu(dn->size);
buf = kmalloc(out_len * WORST_COMPR_FACTOR, GFP_NOFS);
^ permalink raw reply related [flat|nested] 10+ messages in thread
* RE: [patch] ubifs: potential uninitialized variable in truncate_data_node()
2017-01-05 12:46 ` Dan Carpenter
@ 2017-01-05 12:54 ` Anurag Raghavan (RBEI/ETW11)
-1 siblings, 0 replies; 10+ messages in thread
From: Anurag Raghavan (RBEI/ETW11) @ 2017-01-05 12:54 UTC (permalink / raw)
To: Dan Carpenter, Richard Weinberger, David Gstir
Cc: kernel-janitors@vger.kernel.org, linux-mtd@lists.infradead.org,
Adrian Hunter, Artem Bityutskiy
Hi All,
My appdata partition could not be mounted or where the partition was not able to be used. Anyone can help me to find out the root cause of this. What are the possibilities of this ubifs corruption. Any patched are available to fix this issue.
Error logs:
[ 1.797141] UBI error: ubi_io_read: error -74 (ECC error) while reading 253952 bytes from PEB 445:8192, read 253952 bytes
[ 1.808274] UBIFS error (pid 491): ubifs_scan: corrupt empty space at LEB 489:233760
[ 1.816037] UBIFS error (pid 491): ubifs_scanned_corruption: corruption at LEB 489:233760
[ 1.828660] UBIFS error (pid 491): ubifs_scan: LEB 489 scanning failed
[ 1.835215] UBIFS warning (pid 491): ubifs_ro_mode: switched to read-only mode, error -117
[ 1.843502] UBIFS error (pid 491): make_reservation: cannot reserve 58 bytes in jhead 2, error -117
[ 1.852569] UBIFS error (pid 491): do_writepage: cannot write page 0 of inode 76584, error -117
dpkg: error: unable to sync new file '/var/lib/dpkg/arch-new': Structure needs cleaning
Best regards
Raghavan Anurag
RBEI/ETW1
Tel. +91(422)667-4001 | Mobil 9986968950
-----Original Message-----
From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Dan Carpenter
Sent: Thursday, January 05, 2017 6:17 PM
To: Richard Weinberger <richard@nod.at>; David Gstir <david@sigma-star.at>
Cc: kernel-janitors@vger.kernel.org; linux-mtd@lists.infradead.org; Adrian Hunter <adrian.hunter@intel.com>; Artem Bityutskiy <dedekind1@gmail.com>
Subject: [patch] ubifs: potential uninitialized variable in truncate_data_node()
GCC doesn't complain, but my static checker warns that if the data is not compressed and not encrypted then "ret" isn't initialized.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index a459211a1c21..c54f04d88236 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -1281,7 +1281,8 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
int *new_len)
{
void *buf;
- int err, dlen, compr_type, out_len, old_dlen;
+ int dlen, compr_type, out_len, old_dlen;
+ int err = 0;
out_len = le32_to_cpu(dn->size);
buf = kmalloc(out_len * WORST_COMPR_FACTOR, GFP_NOFS);
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [patch] ubifs: potential uninitialized variable in truncate_data_node()
@ 2017-01-05 12:54 ` Anurag Raghavan (RBEI/ETW11)
0 siblings, 0 replies; 10+ messages in thread
From: Anurag Raghavan (RBEI/ETW11) @ 2017-01-05 12:54 UTC (permalink / raw)
To: Dan Carpenter, Richard Weinberger, David Gstir
Cc: kernel-janitors@vger.kernel.org, linux-mtd@lists.infradead.org,
Adrian Hunter, Artem Bityutskiy
Hi All,
My appdata partition could not be mounted or where the partition was not able to be used. Anyone can help me to find out the root cause of this. What are the possibilities of this ubifs corruption. Any patched are available to fix this issue.
Error logs:
[ 1.797141] UBI error: ubi_io_read: error -74 (ECC error) while reading 253952 bytes from PEB 445:8192, read 253952 bytes
[ 1.808274] UBIFS error (pid 491): ubifs_scan: corrupt empty space at LEB 489:233760
[ 1.816037] UBIFS error (pid 491): ubifs_scanned_corruption: corruption at LEB 489:233760
[ 1.828660] UBIFS error (pid 491): ubifs_scan: LEB 489 scanning failed
[ 1.835215] UBIFS warning (pid 491): ubifs_ro_mode: switched to read-only mode, error -117
[ 1.843502] UBIFS error (pid 491): make_reservation: cannot reserve 58 bytes in jhead 2, error -117
[ 1.852569] UBIFS error (pid 491): do_writepage: cannot write page 0 of inode 76584, error -117
dpkg: error: unable to sync new file '/var/lib/dpkg/arch-new': Structure needs cleaning
Best regards
Raghavan Anurag
RBEI/ETW1
Tel. +91(422)667-4001 | Mobil 9986968950
-----Original Message-----
From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Dan Carpenter
Sent: Thursday, January 05, 2017 6:17 PM
To: Richard Weinberger <richard@nod.at>; David Gstir <david@sigma-star.at>
Cc: kernel-janitors@vger.kernel.org; linux-mtd@lists.infradead.org; Adrian Hunter <adrian.hunter@intel.com>; Artem Bityutskiy <dedekind1@gmail.com>
Subject: [patch] ubifs: potential uninitialized variable in truncate_data_node()
GCC doesn't complain, but my static checker warns that if the data is not compressed and not encrypted then "ret" isn't initialized.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index a459211a1c21..c54f04d88236 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -1281,7 +1281,8 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
int *new_len)
{
void *buf;
- int err, dlen, compr_type, out_len, old_dlen;
+ int dlen, compr_type, out_len, old_dlen;
+ int err = 0;
out_len = le32_to_cpu(dn->size);
buf = kmalloc(out_len * WORST_COMPR_FACTOR, GFP_NOFS);
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] ubifs: potential uninitialized variable in truncate_data_node()
2017-01-05 12:54 ` Anurag Raghavan (RBEI/ETW11)
@ 2017-01-05 13:12 ` Richard Weinberger
-1 siblings, 0 replies; 10+ messages in thread
From: Richard Weinberger @ 2017-01-05 13:12 UTC (permalink / raw)
To: Anurag Raghavan (RBEI/ETW11), Dan Carpenter, David Gstir
Cc: kernel-janitors@vger.kernel.org, linux-mtd@lists.infradead.org,
Adrian Hunter, Artem Bityutskiy
Raghavan Anurag,
Am 05.01.2017 um 13:54 schrieb Anurag Raghavan (RBEI/ETW11):
> Hi All,
>
> My appdata partition could not be mounted or where the partition was not able to be used. Anyone can help me to find out the root cause of this. What are the possibilities of this ubifs corruption. Any patched are available to fix this issue.
>
> Error logs:
>
> [ 1.797141] UBI error: ubi_io_read: error -74 (ECC error) while reading 253952 bytes from PEB 445:8192, read 253952 bytes
> [ 1.808274] UBIFS error (pid 491): ubifs_scan: corrupt empty space at LEB 489:233760
> [ 1.816037] UBIFS error (pid 491): ubifs_scanned_corruption: corruption at LEB 489:233760
> [ 1.828660] UBIFS error (pid 491): ubifs_scan: LEB 489 scanning failed
> [ 1.835215] UBIFS warning (pid 491): ubifs_ro_mode: switched to read-only mode, error -117
> [ 1.843502] UBIFS error (pid 491): make_reservation: cannot reserve 58 bytes in jhead 2, error -117
> [ 1.852569] UBIFS error (pid 491): do_writepage: cannot write page 0 of inode 76584, error -117
> dpkg: error: unable to sync new file '/var/lib/dpkg/arch-new': Structure needs cleaning
Why are you hijacking this mail thread?
In your case UBIFS fails because of an ECC error in 0xFF bytes.
UBIFS does not expect this and the MTD driver has to make sure that it does
not happen.
Is this a recent kernel?
Thanks,
//richard
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] ubifs: potential uninitialized variable in truncate_data_node()
@ 2017-01-05 13:12 ` Richard Weinberger
0 siblings, 0 replies; 10+ messages in thread
From: Richard Weinberger @ 2017-01-05 13:12 UTC (permalink / raw)
To: Anurag Raghavan (RBEI/ETW11), Dan Carpenter, David Gstir
Cc: kernel-janitors@vger.kernel.org, linux-mtd@lists.infradead.org,
Adrian Hunter, Artem Bityutskiy
Raghavan Anurag,
Am 05.01.2017 um 13:54 schrieb Anurag Raghavan (RBEI/ETW11):
> Hi All,
>
> My appdata partition could not be mounted or where the partition was not able to be used. Anyone can help me to find out the root cause of this. What are the possibilities of this ubifs corruption. Any patched are available to fix this issue.
>
> Error logs:
>
> [ 1.797141] UBI error: ubi_io_read: error -74 (ECC error) while reading 253952 bytes from PEB 445:8192, read 253952 bytes
> [ 1.808274] UBIFS error (pid 491): ubifs_scan: corrupt empty space at LEB 489:233760
> [ 1.816037] UBIFS error (pid 491): ubifs_scanned_corruption: corruption at LEB 489:233760
> [ 1.828660] UBIFS error (pid 491): ubifs_scan: LEB 489 scanning failed
> [ 1.835215] UBIFS warning (pid 491): ubifs_ro_mode: switched to read-only mode, error -117
> [ 1.843502] UBIFS error (pid 491): make_reservation: cannot reserve 58 bytes in jhead 2, error -117
> [ 1.852569] UBIFS error (pid 491): do_writepage: cannot write page 0 of inode 76584, error -117
> dpkg: error: unable to sync new file '/var/lib/dpkg/arch-new': Structure needs cleaning
Why are you hijacking this mail thread?
In your case UBIFS fails because of an ECC error in 0xFF bytes.
UBIFS does not expect this and the MTD driver has to make sure that it does
not happen.
Is this a recent kernel?
Thanks,
//richard
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [patch] ubifs: potential uninitialized variable in truncate_data_node()
2017-01-05 13:12 ` Richard Weinberger
@ 2017-01-05 13:22 ` Anurag Raghavan (RBEI/ETW11)
-1 siblings, 0 replies; 10+ messages in thread
From: Anurag Raghavan (RBEI/ETW11) @ 2017-01-05 13:22 UTC (permalink / raw)
To: Richard Weinberger, Dan Carpenter, David Gstir,
linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org,
Adrian Hunter, Artem Bityutskiy
> Hi All,
>
> My appdata partition could not be mounted or where the partition was not able to be used. Anyone can help me to find out the root cause of this. What are the possibilities of this ubifs corruption. Any patched are available to fix this issue.
>
> Error logs:
>
> [ 1.797141] UBI error: ubi_io_read: error -74 (ECC error) while reading 253952 bytes from PEB 445:8192, read 253952 bytes
> [ 1.808274] UBIFS error (pid 491): ubifs_scan: corrupt empty space at LEB 489:233760
> [ 1.816037] UBIFS error (pid 491): ubifs_scanned_corruption: corruption at LEB 489:233760
> [ 1.828660] UBIFS error (pid 491): ubifs_scan: LEB 489 scanning failed
> [ 1.835215] UBIFS warning (pid 491): ubifs_ro_mode: switched to read-only mode, error -117
> [ 1.843502] UBIFS error (pid 491): make_reservation: cannot reserve 58 bytes in jhead 2, error -117
> [ 1.852569] UBIFS error (pid 491): do_writepage: cannot write page 0 of inode 76584, error -117
> dpkg: error: unable to sync new file '/var/lib/dpkg/arch-new':
> Structure needs cleaning
Best regards
Raghavan Anurag
RBEI/ETW1
Tel. +91(422)667-4001 | Mobil 9986968950
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [patch] ubifs: potential uninitialized variable in truncate_data_node()
@ 2017-01-05 13:22 ` Anurag Raghavan (RBEI/ETW11)
0 siblings, 0 replies; 10+ messages in thread
From: Anurag Raghavan (RBEI/ETW11) @ 2017-01-05 13:22 UTC (permalink / raw)
To: Richard Weinberger, Dan Carpenter, David Gstir,
linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org,
Adrian Hunter, Artem Bityutskiy
> Hi All,
>
> My appdata partition could not be mounted or where the partition was not able to be used. Anyone can help me to find out the root cause of this. What are the possibilities of this ubifs corruption. Any patched are available to fix this issue.
>
> Error logs:
>
> [ 1.797141] UBI error: ubi_io_read: error -74 (ECC error) while reading 253952 bytes from PEB 445:8192, read 253952 bytes
> [ 1.808274] UBIFS error (pid 491): ubifs_scan: corrupt empty space at LEB 489:233760
> [ 1.816037] UBIFS error (pid 491): ubifs_scanned_corruption: corruption at LEB 489:233760
> [ 1.828660] UBIFS error (pid 491): ubifs_scan: LEB 489 scanning failed
> [ 1.835215] UBIFS warning (pid 491): ubifs_ro_mode: switched to read-only mode, error -117
> [ 1.843502] UBIFS error (pid 491): make_reservation: cannot reserve 58 bytes in jhead 2, error -117
> [ 1.852569] UBIFS error (pid 491): do_writepage: cannot write page 0 of inode 76584, error -117
> dpkg: error: unable to sync new file '/var/lib/dpkg/arch-new':
> Structure needs cleaning
Best regards
Raghavan Anurag
RBEI/ETW1
Tel. +91(422)667-4001 | Mobil 9986968950
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [patch] ubifs: potential uninitialized variable in truncate_data_node()
2017-01-05 13:12 ` Richard Weinberger
@ 2017-01-06 5:18 ` Anurag Raghavan (RBEI/ETW11)
-1 siblings, 0 replies; 10+ messages in thread
From: Anurag Raghavan (RBEI/ETW11) @ 2017-01-06 5:18 UTC (permalink / raw)
To: Richard Weinberger, Dan Carpenter, David Gstir
Cc: linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org,
Adrian Hunter, Artem Bityutskiy
Hi Richard,
I am using the kernel version-30.3.5
Is there any patches available to fix this issue...???
Best regards
Raghavan Anurag
RBEI/ETW1
Tel. +91(422)667-4001 | Mobil 9986968950
-----Original Message-----
From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Richard Weinberger
Sent: Thursday, January 05, 2017 6:42 PM
To: Anurag Raghavan (RBEI/ETW11) <Raghavan.Anurag@in.bosch.com>; Dan Carpenter <dan.carpenter@oracle.com>; David Gstir <david@sigma-star.at>
Cc: linux-mtd@lists.infradead.org; kernel-janitors@vger.kernel.org; Adrian Hunter <adrian.hunter@intel.com>; Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [patch] ubifs: potential uninitialized variable in truncate_data_node()
Raghavan Anurag,
Am 05.01.2017 um 13:54 schrieb Anurag Raghavan (RBEI/ETW11):
> Hi All,
>
> My appdata partition could not be mounted or where the partition was not able to be used. Anyone can help me to find out the root cause of this. What are the possibilities of this ubifs corruption. Any patched are available to fix this issue.
>
> Error logs:
>
> [ 1.797141] UBI error: ubi_io_read: error -74 (ECC error) while reading 253952 bytes from PEB 445:8192, read 253952 bytes
> [ 1.808274] UBIFS error (pid 491): ubifs_scan: corrupt empty space at LEB 489:233760
> [ 1.816037] UBIFS error (pid 491): ubifs_scanned_corruption: corruption at LEB 489:233760
> [ 1.828660] UBIFS error (pid 491): ubifs_scan: LEB 489 scanning failed
> [ 1.835215] UBIFS warning (pid 491): ubifs_ro_mode: switched to read-only mode, error -117
> [ 1.843502] UBIFS error (pid 491): make_reservation: cannot reserve 58 bytes in jhead 2, error -117
> [ 1.852569] UBIFS error (pid 491): do_writepage: cannot write page 0 of inode 76584, error -117
> dpkg: error: unable to sync new file '/var/lib/dpkg/arch-new':
> Structure needs cleaning
Why are you hijacking this mail thread?
In your case UBIFS fails because of an ECC error in 0xFF bytes.
UBIFS does not expect this and the MTD driver has to make sure that it does not happen.
Is this a recent kernel?
Thanks,
//richard
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [patch] ubifs: potential uninitialized variable in truncate_data_node()
@ 2017-01-06 5:18 ` Anurag Raghavan (RBEI/ETW11)
0 siblings, 0 replies; 10+ messages in thread
From: Anurag Raghavan (RBEI/ETW11) @ 2017-01-06 5:18 UTC (permalink / raw)
To: Richard Weinberger, Dan Carpenter, David Gstir
Cc: linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org,
Adrian Hunter, Artem Bityutskiy
Hi Richard,
I am using the kernel version-30.3.5
Is there any patches available to fix this issue...???
Best regards
Raghavan Anurag
RBEI/ETW1
Tel. +91(422)667-4001 | Mobil 9986968950
-----Original Message-----
From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Richard Weinberger
Sent: Thursday, January 05, 2017 6:42 PM
To: Anurag Raghavan (RBEI/ETW11) <Raghavan.Anurag@in.bosch.com>; Dan Carpenter <dan.carpenter@oracle.com>; David Gstir <david@sigma-star.at>
Cc: linux-mtd@lists.infradead.org; kernel-janitors@vger.kernel.org; Adrian Hunter <adrian.hunter@intel.com>; Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [patch] ubifs: potential uninitialized variable in truncate_data_node()
Raghavan Anurag,
Am 05.01.2017 um 13:54 schrieb Anurag Raghavan (RBEI/ETW11):
> Hi All,
>
> My appdata partition could not be mounted or where the partition was not able to be used. Anyone can help me to find out the root cause of this. What are the possibilities of this ubifs corruption. Any patched are available to fix this issue.
>
> Error logs:
>
> [ 1.797141] UBI error: ubi_io_read: error -74 (ECC error) while reading 253952 bytes from PEB 445:8192, read 253952 bytes
> [ 1.808274] UBIFS error (pid 491): ubifs_scan: corrupt empty space at LEB 489:233760
> [ 1.816037] UBIFS error (pid 491): ubifs_scanned_corruption: corruption at LEB 489:233760
> [ 1.828660] UBIFS error (pid 491): ubifs_scan: LEB 489 scanning failed
> [ 1.835215] UBIFS warning (pid 491): ubifs_ro_mode: switched to read-only mode, error -117
> [ 1.843502] UBIFS error (pid 491): make_reservation: cannot reserve 58 bytes in jhead 2, error -117
> [ 1.852569] UBIFS error (pid 491): do_writepage: cannot write page 0 of inode 76584, error -117
> dpkg: error: unable to sync new file '/var/lib/dpkg/arch-new':
> Structure needs cleaning
Why are you hijacking this mail thread?
In your case UBIFS fails because of an ECC error in 0xFF bytes.
UBIFS does not expect this and the MTD driver has to make sure that it does not happen.
Is this a recent kernel?
Thanks,
//richard
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-01-06 5:18 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05 12:46 [patch] ubifs: potential uninitialized variable in truncate_data_node() Dan Carpenter
2017-01-05 12:46 ` Dan Carpenter
2017-01-05 12:54 ` Anurag Raghavan (RBEI/ETW11)
2017-01-05 12:54 ` Anurag Raghavan (RBEI/ETW11)
2017-01-05 13:12 ` Richard Weinberger
2017-01-05 13:12 ` Richard Weinberger
2017-01-05 13:22 ` Anurag Raghavan (RBEI/ETW11)
2017-01-05 13:22 ` Anurag Raghavan (RBEI/ETW11)
2017-01-06 5:18 ` Anurag Raghavan (RBEI/ETW11)
2017-01-06 5:18 ` Anurag Raghavan (RBEI/ETW11)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.