Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1553110 > unrolled thread
| Started by | Fabian Frederick <fabf@skynet.be> |
|---|---|
| First post | 2017-01-06 22:00 +0100 |
| Last post | 2017-01-10 12:00 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 12/12 linux-next] udf: check partition reference in udf_read_inode() Fabian Frederick <fabf@skynet.be> - 2017-01-06 22:00 +0100
Re: [PATCH 12/12 linux-next] udf: check partition reference in udf_read_inode() Jan Kara <jack@suse.cz> - 2017-01-10 12:00 +0100
| From | Fabian Frederick <fabf@skynet.be> |
|---|---|
| Date | 2017-01-06 22:00 +0100 |
| Subject | [PATCH 12/12 linux-next] udf: check partition reference in udf_read_inode() |
| Message-ID | <sWJMd-7eR-1@gated-at.bofh.it> |
We were checking block number without checking partition.
sbi->s_partmaps[iloc->partitionReferenceNum] could lead to
bad memory access. See udf_nfs_get_inode() path for instance.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
fs/udf/inode.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 47638eb..3926973 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -1276,6 +1276,12 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode)
int ret = -EIO;
reread:
+ if (iloc->partitionReferenceNum >= sbi->s_partitions) {
+ udf_debug("partition reference: %d > logical volume partitions: %d\n",
+ iloc->partitionReferenceNum, sbi->s_partitions);
+ return -EIO;
+ }
+
if (iloc->logicalBlockNum >=
sbi->s_partmaps[iloc->partitionReferenceNum].s_partition_len) {
udf_debug("block=%d, partition=%d out of range\n",
--
2.7.4
[toc] | [next] | [standalone]
| From | Jan Kara <jack@suse.cz> |
|---|---|
| Date | 2017-01-10 12:00 +0100 |
| Subject | Re: [PATCH 12/12 linux-next] udf: check partition reference in udf_read_inode() |
| Message-ID | <sY2jL-he-15@gated-at.bofh.it> |
| In reply to | #1553110 |
On Fri 06-01-17 21:54:43, Fabian Frederick wrote:
> We were checking block number without checking partition.
> sbi->s_partmaps[iloc->partitionReferenceNum] could lead to
> bad memory access. See udf_nfs_get_inode() path for instance.
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Thanks. Applied.
Honza
> ---
> fs/udf/inode.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/fs/udf/inode.c b/fs/udf/inode.c
> index 47638eb..3926973 100644
> --- a/fs/udf/inode.c
> +++ b/fs/udf/inode.c
> @@ -1276,6 +1276,12 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode)
> int ret = -EIO;
>
> reread:
> + if (iloc->partitionReferenceNum >= sbi->s_partitions) {
> + udf_debug("partition reference: %d > logical volume partitions: %d\n",
> + iloc->partitionReferenceNum, sbi->s_partitions);
> + return -EIO;
> + }
> +
> if (iloc->logicalBlockNum >=
> sbi->s_partmaps[iloc->partitionReferenceNum].s_partition_len) {
> udf_debug("block=%d, partition=%d out of range\n",
> --
> 2.7.4
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web