All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shayne Chen <shayne.chen@mediatek.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "Toke Høiland-Jørgensen" <toke@toke.dk>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	"Ryder Lee" <ryder.lee@mediatek.com>,
	linux-mediatek <linux-mediatek@lists.infradead.org>,
	"Sujuan Chen" <sujuan.chen@mediatek.com>,
	"Lorenzo Bianconi" <lorenzo.bianconi@redhat.com>,
	"Felix Fietkau" <nbd@nbd.name>
Subject: Re: [PATCH] mac80211: fix incorrect strlen of .write in debugfs
Date: Tue, 12 Jan 2021 09:42:32 +0800	[thread overview]
Message-ID: <1610415752.4985.16.camel@mtksdccf07> (raw)
In-Reply-To: <036e334c2a0a2ebaf940d3f7ae03ab0d9f7c45fb.camel@sipsolutions.net>

On Mon, 2021-01-11 at 13:10 +0100, Johannes Berg wrote:
> On Mon, 2021-01-11 at 14:19 +0800, Shayne Chen wrote:
> > 
> > Regarding the case "10\n\0\0\0\0", both count and strlen() fail to get
> > the correct strlen.
> 
> Yeah.
> 
> I don't think we need to worry about this case.
> 
Got it.
> > # echo "10\n\0\0\0\0" > /sys/kernel/debug/ieee80211/phy0/airtime_flags
> > airtime_flags_write: count = 13, strlen = 15 
> > > > +	buf[count] = '\0';
> > > 
> > > But if count == sizeof(buf) then this is an out-of-bounds write.
> > > 
> > > Same for all the other copied instances.
> > > 
> > > johannes
> > > 
> > 
> > Should we consider this kind of case here?
> 
> Sure, we're at the kernel/userspace trust boundary, we can't just read
> out-of-bounds? Or what do you mean?
> 
> johannes
> 
> 

Sorry, I put the reply in a wrong place.
I meant should we consider the case "10\n\0\0\0\0" here.

Will send v2, thank you.

Shayne
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Shayne Chen <shayne.chen@mediatek.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	"Toke Høiland-Jørgensen" <toke@toke.dk>,
	"Felix Fietkau" <nbd@nbd.name>,
	"Lorenzo Bianconi" <lorenzo.bianconi@redhat.com>,
	"Ryder Lee" <ryder.lee@mediatek.com>,
	linux-mediatek <linux-mediatek@lists.infradead.org>,
	"Sujuan Chen" <sujuan.chen@mediatek.com>
Subject: Re: [PATCH] mac80211: fix incorrect strlen of .write in debugfs
Date: Tue, 12 Jan 2021 09:42:32 +0800	[thread overview]
Message-ID: <1610415752.4985.16.camel@mtksdccf07> (raw)
In-Reply-To: <036e334c2a0a2ebaf940d3f7ae03ab0d9f7c45fb.camel@sipsolutions.net>

On Mon, 2021-01-11 at 13:10 +0100, Johannes Berg wrote:
> On Mon, 2021-01-11 at 14:19 +0800, Shayne Chen wrote:
> > 
> > Regarding the case "10\n\0\0\0\0", both count and strlen() fail to get
> > the correct strlen.
> 
> Yeah.
> 
> I don't think we need to worry about this case.
> 
Got it.
> > # echo "10\n\0\0\0\0" > /sys/kernel/debug/ieee80211/phy0/airtime_flags
> > airtime_flags_write: count = 13, strlen = 15 
> > > > +	buf[count] = '\0';
> > > 
> > > But if count == sizeof(buf) then this is an out-of-bounds write.
> > > 
> > > Same for all the other copied instances.
> > > 
> > > johannes
> > > 
> > 
> > Should we consider this kind of case here?
> 
> Sure, we're at the kernel/userspace trust boundary, we can't just read
> out-of-bounds? Or what do you mean?
> 
> johannes
> 
> 

Sorry, I put the reply in a wrong place.
I meant should we consider the case "10\n\0\0\0\0" here.

Will send v2, thank you.

Shayne

  reply	other threads:[~2021-01-12  1:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 10:56 [PATCH] mac80211: fix incorrect strlen of .write in debugfs Shayne Chen
2021-01-08 10:56 ` Shayne Chen
2021-01-08 12:27 ` Toke Høiland-Jørgensen
2021-01-08 12:27   ` Toke Høiland-Jørgensen
2021-01-08 20:02 ` Johannes Berg
2021-01-08 20:02   ` Johannes Berg
2021-01-09  0:22   ` Ryder Lee
2021-01-09  0:22     ` Ryder Lee
2021-01-11  6:19   ` Shayne Chen
2021-01-11  6:19     ` Shayne Chen
2021-01-11 12:10     ` Johannes Berg
2021-01-11 12:10       ` Johannes Berg
2021-01-12  1:42       ` Shayne Chen [this message]
2021-01-12  1:42         ` Shayne Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1610415752.4985.16.camel@mtksdccf07 \
    --to=shayne.chen@mediatek.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=sujuan.chen@mediatek.com \
    --cc=toke@toke.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.