linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [V9fs-developer] [PATCH] version pointer uninitialized
@ 2018-07-09 22:29 Tomas Bortoli
  2018-07-10  1:02 ` piaojun
  2018-07-11  1:26 ` jiangyiwen
  0 siblings, 2 replies; 4+ messages in thread
From: Tomas Bortoli @ 2018-07-09 22:29 UTC (permalink / raw)
  To: ericvh, rminnich, lucho
  Cc: davem, v9fs-developer, netdev, linux-kernel, syzkaller, Tomas Bortoli

The p9_client_version() does not initialize the version
pointer. If the call to p9pdu_readf() returns an error and version has not
been allocated in p9pdu_readf(), then the program will jump to the "error"
label and will try to free the version pointer. If version is not
initialized, free() will be called with uninitialized, garbage data and
will provoke a crash.

Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
Reported-by: syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com
---
 net/9p/client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/9p/client.c b/net/9p/client.c
index 18c5271910dc..40f7c47f2f74 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -957,7 +957,7 @@ static int p9_client_version(struct p9_client *c)
 {
 	int err = 0;
 	struct p9_req_t *req;
-	char *version;
+	char *version = NULL;
 	int msize;
 
 	p9_debug(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n",
-- 
2.11.0


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

* Re: [V9fs-developer] [PATCH] version pointer uninitialized
  2018-07-09 22:29 [V9fs-developer] [PATCH] version pointer uninitialized Tomas Bortoli
@ 2018-07-10  1:02 ` piaojun
  2018-07-11  1:26 ` jiangyiwen
  1 sibling, 0 replies; 4+ messages in thread
From: piaojun @ 2018-07-10  1:02 UTC (permalink / raw)
  To: Tomas Bortoli, ericvh, rminnich, lucho
  Cc: netdev, linux-kernel, syzkaller, v9fs-developer, davem

LGTM

On 2018/7/10 6:29, Tomas Bortoli wrote:
> The p9_client_version() does not initialize the version
> pointer. If the call to p9pdu_readf() returns an error and version has not
> been allocated in p9pdu_readf(), then the program will jump to the "error"
> label and will try to free the version pointer. If version is not
> initialized, free() will be called with uninitialized, garbage data and
> will provoke a crash.
> 
> Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
> Reported-by: syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com
Reviewed-by: Jun Piao <piaojun@huawei.com>
> ---
>  net/9p/client.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/9p/client.c b/net/9p/client.c
> index 18c5271910dc..40f7c47f2f74 100644
> --- a/net/9p/client.c
> +++ b/net/9p/client.c
> @@ -957,7 +957,7 @@ static int p9_client_version(struct p9_client *c)
>  {
>  	int err = 0;
>  	struct p9_req_t *req;
> -	char *version;
> +	char *version = NULL;
>  	int msize;
>  
>  	p9_debug(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n",
> 

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

* Re: [V9fs-developer] [PATCH] version pointer uninitialized
  2018-07-09 22:29 [V9fs-developer] [PATCH] version pointer uninitialized Tomas Bortoli
  2018-07-10  1:02 ` piaojun
@ 2018-07-11  1:26 ` jiangyiwen
  2018-07-12 16:44   ` Tomas Bortoli
  1 sibling, 1 reply; 4+ messages in thread
From: jiangyiwen @ 2018-07-11  1:26 UTC (permalink / raw)
  To: Tomas Bortoli, ericvh, rminnich, lucho
  Cc: netdev, linux-kernel, syzkaller, v9fs-developer, davem

On 2018/7/10 6:29, Tomas Bortoli wrote:
> The p9_client_version() does not initialize the version
> pointer. If the call to p9pdu_readf() returns an error and version has not
> been allocated in p9pdu_readf(), then the program will jump to the "error"
> label and will try to free the version pointer. If version is not
> initialized, free() will be called with uninitialized, garbage data and
> will provoke a crash.
> 
> Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>

Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>

> Reported-by: syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com
> ---
>  net/9p/client.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/9p/client.c b/net/9p/client.c
> index 18c5271910dc..40f7c47f2f74 100644
> --- a/net/9p/client.c
> +++ b/net/9p/client.c
> @@ -957,7 +957,7 @@ static int p9_client_version(struct p9_client *c)
>  {
>  	int err = 0;
>  	struct p9_req_t *req;
> -	char *version;
> +	char *version = NULL;
>  	int msize;
>  
>  	p9_debug(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n",
> 



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

* Re: [V9fs-developer] [PATCH] version pointer uninitialized
  2018-07-11  1:26 ` jiangyiwen
@ 2018-07-12 16:44   ` Tomas Bortoli
  0 siblings, 0 replies; 4+ messages in thread
From: Tomas Bortoli @ 2018-07-12 16:44 UTC (permalink / raw)
  To: jiangyiwen, ericvh, rminnich, lucho
  Cc: netdev, linux-kernel, syzkaller, v9fs-developer, davem, Andrew Morton

On 07/11/2018 03:26 AM, jiangyiwen wrote:
> On 2018/7/10 6:29, Tomas Bortoli wrote:
>> The p9_client_version() does not initialize the version
>> pointer. If the call to p9pdu_readf() returns an error and version has not
>> been allocated in p9pdu_readf(), then the program will jump to the "error"
>> label and will try to free the version pointer. If version is not
>> initialized, free() will be called with uninitialized, garbage data and
>> will provoke a crash.
>>
>> Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
> Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>
>
>> Reported-by: syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com
>> ---
>>  net/9p/client.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/9p/client.c b/net/9p/client.c
>> index 18c5271910dc..40f7c47f2f74 100644
>> --- a/net/9p/client.c
>> +++ b/net/9p/client.c
>> @@ -957,7 +957,7 @@ static int p9_client_version(struct p9_client *c)
>>  {
>>  	int err = 0;
>>  	struct p9_req_t *req;
>> -	char *version;
>> +	char *version = NULL;
>>  	int msize;
>>  
>>  	p9_debug(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n",
>>
>

+ Cc: Andrew Morton <akpm@linux-foundation.org>

This goes with the other patch: [V9fs-developer] [PATCH]
p9_parse_header() validate PDU length

Tomas

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

end of thread, other threads:[~2018-07-12 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-09 22:29 [V9fs-developer] [PATCH] version pointer uninitialized Tomas Bortoli
2018-07-10  1:02 ` piaojun
2018-07-11  1:26 ` jiangyiwen
2018-07-12 16:44   ` Tomas Bortoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).