linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@primarydata.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: bfields@redhat.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsd4: fix printk format string in nfsd4_open
Date: Fri, 13 Dec 2013 11:55:42 +0200	[thread overview]
Message-ID: <52AAD99E.40706@primarydata.com> (raw)
In-Reply-To: <20131212161931.GF11521@fieldses.org>



On 12/12/2013 06:19 PM, J. Bruce Fields wrote:
> On Mon, Dec 09, 2013 at 07:05:43PM +0200, Benny Halevy wrote:
>> Signed-off-by: Benny Halevy <bhalevy@primarydata.com>
> 
> Are you sure?  Reminding myself from the sprintf man page.... %*s
> provides padding, %.*s limits the number of characters taken from the
> string.  We need that limit since there's no guarantee of null
> termination here.

Well, the .* format doesn't seem to be supported in the kernel library as
far as I could tell. At least it doesn't work for me. We may need to copy
the string and null terminate it if it's indeed the case.

Benny

> 
> --b.
> 
>> ---
>>  fs/nfsd/nfs4proc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
>> index 0a964f1..8624bee 100644
>> --- a/fs/nfsd/nfs4proc.c
>> +++ b/fs/nfsd/nfs4proc.c
>> @@ -361,7 +361,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>>  	struct net *net = SVC_NET(rqstp);
>>  	struct nfsd_net *nn = net_generic(net, nfsd_net_id);
>>  
>> -	dprintk("NFSD: nfsd4_open filename %.*s op_openowner %p\n",
>> +	dprintk("NFSD: nfsd4_open filename %*s op_openowner %p\n",
>>  		(int)open->op_fname.len, open->op_fname.data,
>>  		open->op_openowner);
>>  
>> -- 
>> 1.8.3.1
>>

  reply	other threads:[~2013-12-13  9:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-09 17:05 [PATCH] nfsd4: fix printk format string in nfsd4_open Benny Halevy
2013-12-12 16:19 ` J. Bruce Fields
2013-12-13  9:55   ` Benny Halevy [this message]
2013-12-13 12:30     ` Jim Rees

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=52AAD99E.40706@primarydata.com \
    --to=bhalevy@primarydata.com \
    --cc=bfields@fieldses.org \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 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).