mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fs: ext4: fix symlink read function
@ 2016-07-06 19:58 Antony Pavlov
  2016-07-07  7:18 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Antony Pavlov @ 2016-07-06 19:58 UTC (permalink / raw)
  To: barebox, Sascha Hauer; +Cc: Ronald Zachariah

From: Ronald Zachariah <rozachar@cisco.com>

From U-Boot commit:

| commit 37f23885e4905ff500a8524328aa3084ac11cdb4
| Author: Ronald Zachariah <rozachar@cisco.com>
| Date:   Thu Apr 28 07:08:34 2016 +0200
|
|     fs: ext4: fix symlink read function
|
|     The function ext4fs_read_symlink was unable to handle a symlink
|     which had target name of exactly 60 characters.
|
|     Signed-off-by: Ronald Zachariah <rozachar@cisco.com>
|     Signed-off-by: Stefan Roese <sr@denx.de>
|     Reviewed-by: Stephen Warren <swarren@nvidia.com>
|     Cc: Tom Rini <trini@konsulko.com>

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 fs/ext4/ext4_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 1ecbb8d..6c4083e 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -377,7 +377,7 @@ char *ext4fs_read_symlink(struct ext2fs_node *node)
 	if (!symlink)
 		return 0;
 
-	if (__le32_to_cpu(diro->inode.size) <= 60) {
+	if (__le32_to_cpu(diro->inode.size) < sizeof(diro->inode.b.symlink)) {
 		strncpy(symlink, diro->inode.b.symlink,
 			 __le32_to_cpu(diro->inode.size));
 	} else {
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs: ext4: fix symlink read function
  2016-07-06 19:58 [PATCH] fs: ext4: fix symlink read function Antony Pavlov
@ 2016-07-07  7:18 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-07-07  7:18 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox, Ronald Zachariah

On Wed, Jul 06, 2016 at 10:58:44PM +0300, Antony Pavlov wrote:
> From: Ronald Zachariah <rozachar@cisco.com>
> 
> From U-Boot commit:
> 
> | commit 37f23885e4905ff500a8524328aa3084ac11cdb4
> | Author: Ronald Zachariah <rozachar@cisco.com>
> | Date:   Thu Apr 28 07:08:34 2016 +0200
> |
> |     fs: ext4: fix symlink read function
> |
> |     The function ext4fs_read_symlink was unable to handle a symlink
> |     which had target name of exactly 60 characters.
> |
> |     Signed-off-by: Ronald Zachariah <rozachar@cisco.com>
> |     Signed-off-by: Stefan Roese <sr@denx.de>
> |     Reviewed-by: Stephen Warren <swarren@nvidia.com>
> |     Cc: Tom Rini <trini@konsulko.com>
> 
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
>  fs/ext4/ext4_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
> index 1ecbb8d..6c4083e 100644
> --- a/fs/ext4/ext4_common.c
> +++ b/fs/ext4/ext4_common.c
> @@ -377,7 +377,7 @@ char *ext4fs_read_symlink(struct ext2fs_node *node)
>  	if (!symlink)
>  		return 0;
>  
> -	if (__le32_to_cpu(diro->inode.size) <= 60) {
> +	if (__le32_to_cpu(diro->inode.size) < sizeof(diro->inode.b.symlink)) {
>  		strncpy(symlink, diro->inode.b.symlink,
>  			 __le32_to_cpu(diro->inode.size));
>  	} else {
> -- 
> 2.8.1
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-07  7:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-06 19:58 [PATCH] fs: ext4: fix symlink read function Antony Pavlov
2016-07-07  7:18 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox